-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91a5f30
commit e6e3408
Showing
5 changed files
with
36 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,31 +73,31 @@ public void run() { | |
.setId(2) | ||
.setUsername("Raphaël Bussa") | ||
.setEmail("[email protected]") | ||
.setAvatar("https://avatars1.githubusercontent.com/u/3964819?v=3&s=460") | ||
.setAvatar("https://github.com/rebus007.png?size=512") | ||
.setBackground("https://images.unsplash.com/photo-1473220464492-452fb02e6221?dpr=2&auto=format&fit=crop&w=767&h=512&q=80&cs=tinysrgb&crop=") | ||
.build(); | ||
|
||
Profile profile2 = new Profile.Builder() | ||
.setId(4) | ||
.setUsername("Federico Gentile") | ||
.setEmail("[email protected]") | ||
.setAvatar("https://avatars2.githubusercontent.com/u/22976202?v=3&s=460") | ||
.setAvatar("https://github.com/FedeGens.png?size=512") | ||
.setBackground("https://images.unsplash.com/photo-1469173479606-ada03df615ac?dpr=2&auto=format&fit=crop&w=767&h=511&q=80&cs=tinysrgb&crop=") | ||
.build(); | ||
|
||
Profile profile3 = new Profile.Builder() | ||
.setId(6) | ||
.setUsername("Luca Rurio") | ||
.setEmail("[email protected]") | ||
.setAvatar("https://avatars3.githubusercontent.com/u/16242044?v=3&s=460") | ||
.setAvatar("https://github.com/RurioLuca.png?size=512") | ||
.setBackground("https://images.unsplash.com/photo-1473789810014-375ed569d0ed?dpr=2&auto=format&fit=crop&w=767&h=511&q=80&cs=tinysrgb&crop=") | ||
.build(); | ||
|
||
Profile profile4 = new Profile.Builder() | ||
.setId(8) | ||
.setUsername("Claudio Pastorini") | ||
.setEmail("[email protected]") | ||
.setAvatar("https://avatars0.githubusercontent.com/u/4195199?v=3&s=460") | ||
.setAvatar("https://github.com/claudiopastorini.png?size=512") | ||
.setBackground("https://images.unsplash.com/photo-1452509133926-2b180c6d6245?dpr=2&auto=format&fit=crop&w=767&h=431&q=80&cs=tinysrgb&crop=") | ||
.build(); | ||
|
||
|
@@ -113,15 +113,21 @@ public void run() { | |
|
||
|
||
headerView.setStyle(HeaderView.STYLE_NORMAL); | ||
headerView.setShowGradient(true); | ||
headerView.setTheme(HeaderView.THEME_LIGHT); | ||
headerView.setShowGradient(true); | ||
headerView.setHighlightColor(ContextCompat.getColor(this, R.color.colorAccent)); | ||
headerView.addProfile(profile, profile2, profile3, profile4); | ||
headerView.addDialogItem(item, item2); | ||
headerView.setShowAddButton(true); | ||
//headerView.setAddIconDrawable(R.drawable.ic_action_settings); | ||
headerView.setAddIconDrawable(R.drawable.ic_action_settings); | ||
headerView.setDialogTitle("Choose account"); | ||
//headerView.setShowArrow(false); | ||
headerView.setShowArrow(true); | ||
headerView.setOnHeaderClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
drawerLayout.closeDrawer(GravityCompat.START, true); | ||
} | ||
}); | ||
headerView.setFragmentManager(getFragmentManager()); | ||
headerView.setCallback(new HeaderCallback() { | ||
|
||
|
@@ -152,13 +158,13 @@ public boolean onAdd() { | |
Profile newProfile = new Profile.Builder() | ||
.setId(100) | ||
.setUsername("Mattia Novelli") | ||
.setEmail("@mattinove") | ||
.setAvatar("https://avatars1.githubusercontent.com/u/12815527?v=3&s=460") | ||
.setEmail("mattinove@me.com") | ||
.setAvatar("https://github.com/mattinove.png?size=512") | ||
.setBackground("https://images.unsplash.com/photo-1478194409487-fa5c1eb18622?dpr=2&auto=format&fit=crop&w=767&h=496&q=80&cs=tinysrgb&crop=") | ||
.build(); | ||
headerView.addProfile(newProfile); | ||
headerView.setProfileActive(100); | ||
return false; | ||
return true; | ||
} | ||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ The MIT License (MIT) | ||
~ | ||
~ Copyright (c) 2017 Raphaël Bussa | ||
|
@@ -26,10 +25,19 @@ | |
<rebus.header.view.HeaderView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/header_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:hv_add_icon="@drawable/ic_action_settings" | ||
app:hv_add_status_bar_height="true" | ||
app:hv_style="compact" | ||
app:hv_theme="light" | ||
app:hv_highlight_color="@color/colorAccent" | ||
app:hv_background_color="@color/colorPrimaryDark" | ||
app:hv_dialog_title="@string/account" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" /> | ||
app:hv_highlight_color="@color/colorAccent" | ||
app:hv_profile_avatar="@drawable/ic_placeholder" | ||
app:hv_profile_background="@drawable/ic_placeholder_bg" | ||
app:hv_profile_email="[email protected]" | ||
app:hv_profile_username="Bruce Wayne" | ||
app:hv_show_add_button="true" | ||
app:hv_show_arrow="true" | ||
app:hv_show_gradient="true" | ||
app:hv_style="normal" | ||
app:hv_theme="light" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters