@Override public boolean onProfileChanged(View view, IProfile profile, boolean current) { //sample usage of the onProfileChanged listener //if the clicked item has the identifier 1 add a new profile ;) if (profile instanceof IDrawerItem && ((IDrawerItem) profile).getIdentifier() == PROFILE_SETTING) { IProfile newProfile = new ProfileDrawerItem().withNameShown(true).withName("Batman").withEmail("batman@gmail.com").withIcon(getResources().getDrawable(R.drawable.profile5)); if (headerResult.getProfiles() != null) { //we know that there are 2 setting elements. set the new profile above them ;) headerResult.addProfile(newProfile, headerResult.getProfiles().size() - 2); } else { headerResult.addProfiles(newProfile); } } //false if you have not consumed the event and it should close the drawer return false; } })
@Override public boolean onProfileChanged(View view, IProfile profile, boolean current) { //sample usage of the onProfileChanged listener //if the clicked item has the identifier 1 add a new profile ;) if (profile instanceof IDrawerItem && ((IDrawerItem) profile).getIdentifier() == PROFILE_SETTING) { IProfile newProfile = new ProfileDrawerItem().withNameShown(true).withName("Batman").withEmail("batman@gmail.com").withIcon(getResources().getDrawable(R.drawable.profile5)); if (headerResult.getProfiles() != null) { //we know that there are 2 setting elements. set the new profile above them ;) headerResult.addProfile(newProfile, headerResult.getProfiles().size() - 2); } else { headerResult.addProfiles(newProfile); } } //false if you have not consumed the event and it should close the drawer return false; } })
@Override public boolean onProfileChanged(View view, IProfile profile, boolean current) { //sample usage of the onProfileChanged listener //if the clicked item has the identifier 1 add a new profile ;) if (profile instanceof IDrawerItem && ((IDrawerItem) profile).getIdentifier() == PROFILE_SETTING) { IProfile newProfile = new ProfileDrawerItem().withNameShown(true).withName("Batman").withEmail("batman@gmail.com").withIcon(getResources().getDrawable(R.drawable.profile5)); if (headerResult.getProfiles() != null) { //we know that there are 2 setting elements. set the new profile above them ;) headerResult.addProfile(newProfile, headerResult.getProfiles().size() - 2); } else { headerResult.addProfiles(newProfile); } } //false if you have not consumed the event and it should close the drawer return false; } })
@Override public boolean onProfileChanged(View view, IProfile profile, boolean current) { //sample usage of the onProfileChanged listener //if the clicked item has the identifier 1 add a new profile ;) if (profile instanceof IDrawerItem && profile.getIdentifier() == PROFILE_SETTING) { int count = 100 + headerResult.getProfiles().size() + 1; IProfile newProfile = new ProfileDrawerItem().withNameShown(true).withName("Batman" + count).withEmail("batman" + count + "@gmail.com").withIcon(R.drawable.profile5).withIdentifier(count); if (headerResult.getProfiles() != null) { //we know that there are 2 setting elements. set the new profile above them ;) headerResult.addProfile(newProfile, headerResult.getProfiles().size() - 2); } else { headerResult.addProfiles(newProfile); } } //false if you have not consumed the event and it should close the drawer return false; } })
.withNameShown(true) .withName(R.string.integrated_inbox_title) .withEmail(parent.getString(R.string.integrated_inbox_detail)) .withNameShown(true) .withName(account.getDescription()) .withEmail(account.getEmail())