public abstract class AbstractDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder> extends java.lang.Object implements IDrawerItem<T,VH>, Selectable<T>, Tagable<T>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
mEnabled |
protected long |
mIdentifier |
Drawer.OnDrawerItemClickListener |
mOnDrawerItemClickListener |
protected OnPostBindViewListener |
mOnPostBindViewListener |
protected boolean |
mSelectable |
protected boolean |
mSelected |
protected java.util.List<IDrawerItem> |
mSubItems |
protected java.lang.Object |
mTag |
| Constructor and Description |
|---|
AbstractDrawerItem() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(int id) |
boolean |
equals(long id)
If this item equals to the given identifier
|
boolean |
equals(java.lang.Object o)
If this item equals to the given object
|
android.view.View |
generateView(android.content.Context ctx)
generates a view by the defined LayoutRes
|
android.view.View |
generateView(android.content.Context ctx,
android.view.ViewGroup parent)
generates a view by the defined LayoutRes and pass the LayoutParams from the parent
|
abstract com.mikepenz.fastadapter.utils.ViewHolderFactory<VH> |
getFactory()
the abstract method to retrieve the ViewHolder factory
The ViewHolder factory implementation should look like (see the commented code above)
|
long |
getIdentifier()
returns the identifier of this item
-1 is the default not set state
|
Drawer.OnDrawerItemClickListener |
getOnDrawerItemClickListener() |
OnPostBindViewListener |
getOnPostBindViewListener() |
IDrawerItem |
getParent() |
java.util.List<IDrawerItem> |
getSubItems() |
java.lang.Object |
getTag() |
VH |
getViewHolder(android.view.ViewGroup parent)
This method returns the ViewHolder for our item, using the provided View.
|
int |
hashCode()
the hashCode implementation
|
boolean |
isAutoExpanding()
overwrite this method and return true if the item should auto expand on click, false if you want to disable this
|
boolean |
isEnabled() |
boolean |
isExpanded() |
boolean |
isSelectable() |
boolean |
isSelected() |
void |
onPostBindView(IDrawerItem drawerItem,
android.view.View view)
is called after bindView to allow some post creation setps
|
void |
unbindView(VH holder)
called when the view is unbound
|
T |
withEnabled(boolean enabled)
set if this item is enabled
|
T |
withIdentifier(long identifier)
set the identifier of this item
|
T |
withIsExpanded(boolean expanded) |
T |
withOnDrawerItemClickListener(Drawer.OnDrawerItemClickListener onDrawerItemClickListener)
this listener is called when an item is clicked in the drawer.
|
IDrawerItem |
withParent(IDrawerItem parent)
the parent for this item
|
T |
withPostOnBindViewListener(OnPostBindViewListener onPostBindViewListener)
add this listener and hook in if you want to modify a drawerItems view without creating a custom drawer item
|
T |
withSelectable(boolean selectable)
set if this item is selectable
|
T |
withSetSelected(boolean selected)
set if this item is selected
|
T |
withSubItems(IDrawerItem... subItems)
an array of subItems
|
T |
withSubItems(java.util.List<IDrawerItem> subItems)
a list of subItems
|
T |
withTag(java.lang.Object object)
set the tag of this item
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitbindView, getLayoutRes, getTypeprotected long mIdentifier
protected java.lang.Object mTag
protected boolean mEnabled
protected boolean mSelected
protected boolean mSelectable
public Drawer.OnDrawerItemClickListener mOnDrawerItemClickListener
protected OnPostBindViewListener mOnPostBindViewListener
protected java.util.List<IDrawerItem> mSubItems
public T withIdentifier(long identifier)
withIdentifier in interface com.mikepenz.fastadapter.IIdentifyable<T>identifier - public long getIdentifier()
getIdentifier in interface com.mikepenz.fastadapter.IIdentifyable<T>public T withTag(java.lang.Object object)
public java.lang.Object getTag()
getTag in interface com.mikepenz.fastadapter.IItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>getTag in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>getTag in interface Tagable<T>public T withEnabled(boolean enabled)
public boolean isEnabled()
public T withSetSelected(boolean selected)
withSetSelected in interface com.mikepenz.fastadapter.IItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>withSetSelected in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>selected - true if this item is selectedpublic boolean isSelected()
isSelected in interface com.mikepenz.fastadapter.IItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>isSelected in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>public T withSelectable(boolean selectable)
withSelectable in interface com.mikepenz.fastadapter.IItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>withSelectable in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>withSelectable in interface Selectable<T>selectable - true if this item is selectablepublic boolean isSelectable()
isSelectable in interface com.mikepenz.fastadapter.IItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>isSelectable in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>isSelectable in interface Selectable<T>public Drawer.OnDrawerItemClickListener getOnDrawerItemClickListener()
public T withOnDrawerItemClickListener(Drawer.OnDrawerItemClickListener onDrawerItemClickListener)
onDrawerItemClickListener - public OnPostBindViewListener getOnPostBindViewListener()
public T withPostOnBindViewListener(OnPostBindViewListener onPostBindViewListener)
onPostBindViewListener - public void onPostBindView(IDrawerItem drawerItem, android.view.View view)
drawerItem - the drawerItem which is bound to the viewview - the currently view which will be boundpublic IDrawerItem getParent()
getParent in interface com.mikepenz.fastadapter.ISubItem<IDrawerItem,IDrawerItem>public IDrawerItem withParent(IDrawerItem parent)
withParent in interface com.mikepenz.fastadapter.ISubItem<IDrawerItem,IDrawerItem>parent - it's parentpublic T withSubItems(java.util.List<IDrawerItem> subItems)
withSubItems in interface com.mikepenz.fastadapter.IExpandable<T,IDrawerItem>subItems - public T withSubItems(IDrawerItem... subItems)
subItems - public java.util.List<IDrawerItem> getSubItems()
getSubItems in interface com.mikepenz.fastadapter.IExpandable<T,IDrawerItem>public T withIsExpanded(boolean expanded)
withIsExpanded in interface com.mikepenz.fastadapter.IExpandable<T,IDrawerItem>expanded - defines if this item is now expanded or notpublic boolean isExpanded()
isExpanded in interface com.mikepenz.fastadapter.IExpandable<T,IDrawerItem>public boolean isAutoExpanding()
isAutoExpanding in interface com.mikepenz.fastadapter.IExpandable<T,IDrawerItem>public abstract com.mikepenz.fastadapter.utils.ViewHolderFactory<VH> getFactory()
public android.view.View generateView(android.content.Context ctx)
generateView in interface com.mikepenz.fastadapter.IItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>generateView in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>ctx - public android.view.View generateView(android.content.Context ctx,
android.view.ViewGroup parent)
generateView in interface com.mikepenz.fastadapter.IItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>generateView in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>ctx - parent - public void unbindView(VH holder)
unbindView in interface com.mikepenz.fastadapter.IItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>unbindView in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>holder - public VH getViewHolder(android.view.ViewGroup parent)
getViewHolder in interface com.mikepenz.fastadapter.IItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>getViewHolder in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>parent - public boolean equals(long id)
equals in interface IDrawerItem<T,VH extends android.support.v7.widget.RecyclerView.ViewHolder>id - public boolean equals(int id)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - public int hashCode()
hashCode in class java.lang.Object