Skip to content

Commit 7270971

Browse files
committed
version 2.0.7
- update libs
1 parent d6579ec commit 7270971

36 files changed

Lines changed: 7117 additions & 16 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repositories {
1818
```
1919
```Gradle
2020
dependencies {
21-
compile 'rebus:header-view:2.0.6'
21+
compile 'rebus:header-view:2.0.7'
2222
}
2323
```
2424
### How to use

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ buildscript {
2929
compileSdk: 27,
3030
minSdk : 14,
3131
targetSdk : 27,
32-
version : "2.0.6",
33-
supportLib: "27.1.0"
32+
version : "2.0.7",
33+
supportLib: "27.1.1"
3434
]
3535
}
3636

@@ -40,7 +40,7 @@ buildscript {
4040
}
4141

4242
dependencies {
43-
classpath 'com.android.tools.build:gradle:3.0.1'
43+
classpath 'com.android.tools.build:gradle:3.1.1'
4444
classpath 'com.novoda:bintray-release:0.8.0'
4545
}
4646
}

docs/_config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: Nav Utils
2+
description: Easy manage commit Fragment and Activity, with some little extra
3+
google_analytics:
4+
show_downloads: true
5+
theme: jekyll-theme-architect
6+
7+
gems:
8+
- jekyll-mentions

docs/index.md

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
# Header View
2+
3+
[![Join the chat at https://gitter.im/rebus007/HeaderView](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/rebus007/HeaderView?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4+
[ ![Download](https://api.bintray.com/packages/raphaelbussa/maven/header-view/images/download.svg) ](https://bintray.com/raphaelbussa/maven/header-view/_latestVersion) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Header--View-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2123)
5+
6+
![Logo](https://raw.githubusercontent.com/rebus007/HeaderView/master/img/ic_launcher-web.png)
7+
8+
This is a view for NavigationView in android.support.design library
9+
10+
### Import
11+
At the moment the library is in my personal maven repo
12+
```Gradle
13+
repositories {
14+
maven {
15+
url 'http://dl.bintray.com/raphaelbussa/maven'
16+
}
17+
}
18+
```
19+
```Gradle
20+
dependencies {
21+
compile 'rebus:header-view:2.0.7'
22+
}
23+
```
24+
### How to use
25+
#### Via XML
26+
Create a layout named like this header_drawer.xml
27+
```XML
28+
<rebus.header.view.HeaderView xmlns:android="http://schemas.android.com/apk/res/android"
29+
xmlns:app="http://schemas.android.com/apk/res-auto"
30+
android:id="@+id/header_view"
31+
android:layout_width="match_parent"
32+
android:layout_height="wrap_content"
33+
app:hv_add_icon="@drawable/ic_action_settings"
34+
app:hv_add_status_bar_height="true"
35+
app:hv_background_color="@color/colorPrimaryDark"
36+
app:hv_dialog_title="@string/account"
37+
app:hv_highlight_color="@color/colorAccent"
38+
app:hv_profile_avatar="@drawable/ic_placeholder"
39+
app:hv_profile_background="@drawable/ic_placeholder_bg"
40+
app:hv_profile_email="batman@gotham.city"
41+
app:hv_profile_username="Bruce Wayne"
42+
app:hv_show_add_button="true"
43+
app:hv_show_arrow="true"
44+
app:hv_show_gradient="true"
45+
app:hv_style="normal"
46+
app:hv_theme="light" />
47+
```
48+
And in your NavigationView
49+
50+
```XML
51+
<android.support.design.widget.NavigationView
52+
android:id="@+id/nav_view"
53+
android:layout_width="wrap_content"
54+
android:layout_height="match_parent"
55+
android:layout_gravity="start"
56+
app:headerLayout="@layout/header_drawer"
57+
app:menu="@menu/drawer" />
58+
```
59+
#### Manage Profiles
60+
The new HeaderView manage different profile and a new profile chooser inspired from YouTube android app
61+
- Create a profile
62+
```Java
63+
Profile profile = new Profile.Builder()
64+
.setId(2)
65+
.setUsername("Raphaël Bussa")
66+
.setEmail("raphaelbussa@gmail.com")
67+
.setAvatar("https://github.com/rebus007.png?size=512")
68+
.setBackground("https://images.unsplash.com/photo-1473220464492-452fb02e6221?dpr=2&auto=format&fit=crop&w=767&h=512&q=80&cs=tinysrgb&crop=")
69+
.build();
70+
```
71+
- Add a profile
72+
```Java
73+
headerView.addProfile(profile);
74+
```
75+
- Set a profile active
76+
```Java
77+
headerView.setProfileActive(2);
78+
```
79+
- Remove a profile
80+
```Java
81+
headerView.removeProfile(2);
82+
```
83+
- Get actual active profile
84+
```Java
85+
int activeProfileId = headerView.getProfileActive();
86+
```
87+
88+
#### Customize Profile Chooser
89+
You can also customize the profile chooser
90+
- Add bottom items
91+
```Java
92+
Item item = new Item.Builder()
93+
.setId(1)
94+
.setTitle("Remove all profile")
95+
.build();
96+
97+
headerView.addDialogItem(item);
98+
```
99+
- HighlightColor in dialog
100+
```
101+
headerView.setHighlightColor(ContextCompat.getColor(this, R.color.colorAccent));
102+
app:hv_highlight_color="@color/colorAccent"
103+
```
104+
- Change dialog title
105+
```
106+
headerView.setDialogTitle("Choose account");
107+
app:hv_dialog_title="Dialog title"
108+
```
109+
- Change dialog top icon
110+
```
111+
headerView.setAddIconDrawable(R.drawable.ic_action_settings);
112+
app:hv_add_icon="@drawable/ic_action_settings"
113+
```
114+
- Or hide dialog top icon
115+
```
116+
headerView.setShowAddButton(true);
117+
app:hv_show_add_button="true"
118+
```
119+
- Dismiss profile chooser dialog
120+
```Java
121+
headerView.dismissProfileChooser();
122+
```
123+
#### Callback
124+
```Java
125+
headerView.setCallback(new HeaderCallback() {
126+
127+
@Override
128+
public boolean onSelect(int id, boolean isActive) {
129+
//return profile id selected and if is the active profile
130+
return true; //true for close the dialog, false for do nothing
131+
}
132+
133+
@Override
134+
public boolean onItem(int id) {
135+
//return witch buttom item is selected
136+
return true; //true for close the dialog, false for do nothing
137+
}
138+
139+
@Override
140+
public boolean onAdd() {
141+
return true; //true for close the dialog, false for do nothing
142+
}
143+
});
144+
```
145+
#### Loading image from network
146+
Just add this in your class Application (of course you can use your preferred libs for load images)
147+
```Java
148+
ImageLoader.init(new ImageLoader.ImageLoaderInterface() {
149+
@Override
150+
public void loadImage(Uri url, ImageView imageView, @ImageLoader.Type int type) {
151+
switch (type) {
152+
case ImageLoader.AVATAR:
153+
Glide.with(imageView.getContext())
154+
.load(url)
155+
.asBitmap()
156+
.placeholder(R.drawable.ic_placeholder)
157+
.error(R.drawable.ic_placeholder)
158+
.into(imageView);
159+
break;
160+
case ImageLoader.HEADER:
161+
Glide.with(imageView.getContext())
162+
.load(url)
163+
.asBitmap()
164+
.placeholder(R.drawable.ic_placeholder_bg)
165+
.error(R.drawable.ic_placeholder_bg)
166+
.into(imageView);
167+
break;
168+
}
169+
}
170+
171+
});
172+
```
173+
#### Use custom font with Calligraphy
174+
You can set a custom font with [Calligraphy](https://github.com/chrisjenx/Calligraphy) just add a CustomViewTypeface with HeaderView.class in CalligraphyConfig
175+
```Java
176+
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
177+
.setDefaultFontPath("Oswald-Stencbab.ttf")
178+
.setFontAttrId(R.attr.fontPath)
179+
.addCustomViewWithSetTypeface(HeaderView.class)
180+
.build()
181+
);
182+
```
183+
### Screen
184+
![Screen](https://raw.githubusercontent.com/rebus007/HeaderView/master/img/screen.png)
185+
186+
### Sample
187+
Browse the sample code [here](https://github.com/rebus007/HeaderView/tree/master/sample) or download sample app from the [Play Store](https://play.google.com/store/apps/details?id=rebus.header.view.sample)
188+
189+
### Javadoc
190+
Browse Javadoc [here](https://rebus007.github.io/HeaderView/javadoc/)
191+
192+
### App using Header View
193+
If you use this lib [contact me](mailto:raphaelbussa@gmail.com) and I will add it to the list below:
194+
- [Mister Gadget](https://play.google.com/store/apps/details?id=rebus.mister.gadget)
195+
- [Git Chat](https://github.com/rebus007/Git-Chat)
196+
- [The Coding Love](https://play.google.com/store/apps/details?id=rebus.thecodinglove)
197+
- [Romanews.eu](https://play.google.com/store/apps/details?id=it.daigan.romanews)
198+
- [Mob@rt](https://play.google.com/store/apps/details?id=it.artigiancassa.mobile.android.mobart)
199+
200+
### Developed By
201+
Raphaël Bussa - [raphaelbussa@gmail.com](mailto:raphaelbussa@gmail.com)
202+
203+
[ ![Twitter](https://raw.githubusercontent.com/rebus007/Header-View/master/img/social/twitter-icon.png) ](https://twitter.com/rebus_007)[ ![Google Plus](https://raw.githubusercontent.com/rebus007/Header-View/master/img/social/google-plus-icon.png) ](https://plus.google.com/+RaphaelBussa/posts)[ ![Linkedin](https://raw.githubusercontent.com/rebus007/Header-View/master/img/social/linkedin-icon.png) ](https://www.linkedin.com/in/rebus007)
204+
205+
### License
206+
```
207+
The MIT License (MIT)
208+
209+
Copyright (c) 2017 Raphaël Bussa <raphaelbussa@gmail.com>
210+
211+
Permission is hereby granted, free of charge, to any person obtaining a copy
212+
of this software and associated documentation files (the "Software"), to deal
213+
in the Software without restriction, including without limitation the rights
214+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
215+
copies of the Software, and to permit persons to whom the Software is
216+
furnished to do so, subject to the following conditions:
217+
218+
The above copyright notice and this permission notice shall be included in all
219+
copies or substantial portions of the Software.
220+
221+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
222+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
223+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
224+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
225+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
226+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
227+
SOFTWARE.
228+
```

docs/javadoc/META-INF/MANIFEST.MF

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Manifest-Version: 1.0
2+

docs/javadoc/allclasses-frame.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<!-- NewPage -->
3+
<html lang="it">
4+
<head>
5+
<!-- Generated by javadoc (1.8.0_162) on Mon Apr 16 15:40:35 CEST 2018 -->
6+
<title>All Classes (library API)</title>
7+
<meta name="date" content="2018-04-16">
8+
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
9+
<script type="text/javascript" src="script.js"></script>
10+
</head>
11+
<body>
12+
<h1 class="bar">All&nbsp;Classes</h1>
13+
<div class="indexContainer">
14+
<ul>
15+
<li><a href="rebus/header/view/HeaderCallback.html" title="class in rebus.header.view" target="classFrame">HeaderCallback</a></li>
16+
<li><a href="rebus/header/view/HeaderView.html" title="class in rebus.header.view" target="classFrame">HeaderView</a></li>
17+
<li><a href="rebus/header/view/HeaderView.Style.html" title="annotation in rebus.header.view" target="classFrame">HeaderView.Style</a></li>
18+
<li><a href="rebus/header/view/HeaderView.Theme.html" title="annotation in rebus.header.view" target="classFrame">HeaderView.Theme</a></li>
19+
<li><a href="rebus/header/view/ImageLoader.html" title="class in rebus.header.view" target="classFrame">ImageLoader</a></li>
20+
<li><a href="rebus/header/view/ImageLoader.ImageLoaderInterface.html" title="interface in rebus.header.view" target="classFrame"><span class="interfaceName">ImageLoader.ImageLoaderInterface</span></a></li>
21+
<li><a href="rebus/header/view/ImageLoader.Type.html" title="annotation in rebus.header.view" target="classFrame">ImageLoader.Type</a></li>
22+
<li><a href="rebus/header/view/Item.html" title="class in rebus.header.view" target="classFrame">Item</a></li>
23+
<li><a href="rebus/header/view/Item.Builder.html" title="class in rebus.header.view" target="classFrame">Item.Builder</a></li>
24+
<li><a href="rebus/header/view/Profile.html" title="class in rebus.header.view" target="classFrame">Profile</a></li>
25+
<li><a href="rebus/header/view/Profile.Builder.html" title="class in rebus.header.view" target="classFrame">Profile.Builder</a></li>
26+
<li><a href="rebus/header/view/Profile.IdValue.html" title="annotation in rebus.header.view" target="classFrame">Profile.IdValue</a></li>
27+
<li><a href="rebus/header/view/ProfileChooserFragment.html" title="class in rebus.header.view" target="classFrame">ProfileChooserFragment</a></li>
28+
</ul>
29+
</div>
30+
</body>
31+
</html>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<!-- NewPage -->
3+
<html lang="it">
4+
<head>
5+
<!-- Generated by javadoc (1.8.0_162) on Mon Apr 16 15:40:35 CEST 2018 -->
6+
<title>All Classes (library API)</title>
7+
<meta name="date" content="2018-04-16">
8+
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
9+
<script type="text/javascript" src="script.js"></script>
10+
</head>
11+
<body>
12+
<h1 class="bar">All&nbsp;Classes</h1>
13+
<div class="indexContainer">
14+
<ul>
15+
<li><a href="rebus/header/view/HeaderCallback.html" title="class in rebus.header.view">HeaderCallback</a></li>
16+
<li><a href="rebus/header/view/HeaderView.html" title="class in rebus.header.view">HeaderView</a></li>
17+
<li><a href="rebus/header/view/HeaderView.Style.html" title="annotation in rebus.header.view">HeaderView.Style</a></li>
18+
<li><a href="rebus/header/view/HeaderView.Theme.html" title="annotation in rebus.header.view">HeaderView.Theme</a></li>
19+
<li><a href="rebus/header/view/ImageLoader.html" title="class in rebus.header.view">ImageLoader</a></li>
20+
<li><a href="rebus/header/view/ImageLoader.ImageLoaderInterface.html" title="interface in rebus.header.view"><span class="interfaceName">ImageLoader.ImageLoaderInterface</span></a></li>
21+
<li><a href="rebus/header/view/ImageLoader.Type.html" title="annotation in rebus.header.view">ImageLoader.Type</a></li>
22+
<li><a href="rebus/header/view/Item.html" title="class in rebus.header.view">Item</a></li>
23+
<li><a href="rebus/header/view/Item.Builder.html" title="class in rebus.header.view">Item.Builder</a></li>
24+
<li><a href="rebus/header/view/Profile.html" title="class in rebus.header.view">Profile</a></li>
25+
<li><a href="rebus/header/view/Profile.Builder.html" title="class in rebus.header.view">Profile.Builder</a></li>
26+
<li><a href="rebus/header/view/Profile.IdValue.html" title="annotation in rebus.header.view">Profile.IdValue</a></li>
27+
<li><a href="rebus/header/view/ProfileChooserFragment.html" title="class in rebus.header.view">ProfileChooserFragment</a></li>
28+
</ul>
29+
</div>
30+
</body>
31+
</html>

0 commit comments

Comments
 (0)