public class AccountHeader
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
AccountHeader.OnAccountHeaderItemLongClickListener |
static interface |
AccountHeader.OnAccountHeaderListener |
static interface |
AccountHeader.OnAccountHeaderProfileImageListener |
static interface |
AccountHeader.OnAccountHeaderSelectionViewClickListener |
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
BUNDLE_SELECTION_HEADER |
protected AccountHeaderBuilder |
mAccountHeaderBuilder |
protected static double |
NAVIGATION_DRAWER_ACCOUNT_ASPECT_RATIO |
| Modifier | Constructor and Description |
|---|---|
protected |
AccountHeader(AccountHeaderBuilder accountHeaderBuilder) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProfile(IProfile profile,
int position)
Add a new profile at a specific position to the list
|
void |
addProfiles(IProfile... profiles)
Add new profiles to the existing list of profiles
|
void |
clear()
Clear the header
|
IProfile |
getActiveProfile()
get the current active profile
|
android.widget.ImageView |
getHeaderBackgroundView()
Returns the header background view so the dev can set everything on it
|
java.util.List<IProfile> |
getProfiles()
returns the current list of profiles set for this header
|
android.view.View |
getView()
Get the Root view for the Header
|
boolean |
isSelectionListShown()
returns if the selection list is currently shown
|
void |
removeProfile(int position)
remove a profile from the given position
|
void |
removeProfile(IProfile profile)
try to remove the given profile
|
void |
removeProfileByIdentifier(long identifier)
remove the profile with the given identifier
|
android.os.Bundle |
saveInstanceState(android.os.Bundle savedInstanceState)
add the values to the bundle for saveInstanceState
|
void |
setActiveProfile(IProfile profile)
Selects the given profile and sets it to the new active profile
|
void |
setActiveProfile(IProfile profile,
boolean fireOnProfileChanged)
Selects the given profile and sets it to the new active profile
|
void |
setActiveProfile(long identifier)
Selects a profile by its identifier
|
void |
setActiveProfile(long identifier,
boolean fireOnProfileChanged)
Selects a profile by its identifier
|
void |
setBackground(android.graphics.drawable.Drawable headerBackground)
Set the background for the Header
|
void |
setBackgroundRes(int headerBackgroundRes)
Set the background for the Header as resource
|
void |
setDrawer(Drawer drawer)
Set the drawer for the AccountHeader so we can use it for the select
|
void |
setHeaderBackground(ImageHolder imageHolder)
set the background for the header via the ImageHolder class
|
void |
setProfiles(java.util.List<IProfile> profiles)
Set a new list of profiles for the header
|
void |
setSelectionFirstLine(java.lang.String selectionFirstLine)
set this to define the first line in the selection area if there is no profile
note this will block any values from profiles!
|
void |
setSelectionFirstLineShown(boolean selectionFirstLineShown)
set this to false if you want to hide the first line of the selection box in the header (first line would be the name)
|
void |
setSelectionSecondLine(java.lang.String selectionSecondLine)
set this to define the second line in the selection area if there is no profile
note this will block any values from profiles!
|
void |
setSelectionSecondLineShown(boolean selectionSecondLineShown)
set this to false if you want to hide the second line of the selection box in the header (second line would be the e-mail)
|
void |
toggleSelectionList(android.content.Context ctx)
Toggle the selection list (show or hide it)
|
void |
updateProfile(IProfile newProfile)
Helper method to update a profile using it's identifier
|
void |
updateProfileByIdentifier(IProfile newProfile)
Deprecated.
|
protected static final double NAVIGATION_DRAWER_ACCOUNT_ASPECT_RATIO
protected static final java.lang.String BUNDLE_SELECTION_HEADER
protected final AccountHeaderBuilder mAccountHeaderBuilder
protected AccountHeader(AccountHeaderBuilder accountHeaderBuilder)
public android.view.View getView()
public void setDrawer(Drawer drawer)
drawer - public android.widget.ImageView getHeaderBackgroundView()
public void setHeaderBackground(ImageHolder imageHolder)
imageHolder - public void setBackground(android.graphics.drawable.Drawable headerBackground)
headerBackground - public void setBackgroundRes(@DrawableRes
int headerBackgroundRes)
headerBackgroundRes - public void toggleSelectionList(android.content.Context ctx)
ctx - public boolean isSelectionListShown()
public void setSelectionFirstLineShown(boolean selectionFirstLineShown)
selectionFirstLineShown - public void setSelectionSecondLineShown(boolean selectionSecondLineShown)
selectionSecondLineShown - public void setSelectionFirstLine(java.lang.String selectionFirstLine)
selectionFirstLine - public void setSelectionSecondLine(java.lang.String selectionSecondLine)
selectionSecondLine - public java.util.List<IProfile> getProfiles()
public void setProfiles(java.util.List<IProfile> profiles)
profiles - public void setActiveProfile(IProfile profile)
profile - public void setActiveProfile(IProfile profile, boolean fireOnProfileChanged)
profile - public void setActiveProfile(long identifier)
identifier - public void setActiveProfile(long identifier,
boolean fireOnProfileChanged)
identifier - public IProfile getActiveProfile()
public void updateProfile(@NonNull
IProfile newProfile)
newProfile - @Deprecated
public void updateProfileByIdentifier(@NonNull
IProfile newProfile)
newProfile - public void addProfiles(@NonNull
IProfile... profiles)
profiles - public void addProfile(@NonNull
IProfile profile,
int position)
profile - position - public void removeProfile(int position)
position - public void removeProfileByIdentifier(long identifier)
identifier - public void removeProfile(@NonNull
IProfile profile)
profile - public void clear()
public android.os.Bundle saveInstanceState(android.os.Bundle savedInstanceState)
savedInstanceState -