public abstract class AbstractExpandableItem<T> extends java.lang.Object implements IExpandable<T>
A helper to implement expandable item.
if you don't want to extent a class, you can also implement the interface IExpandable
Created by luoxw on 2016/8/9.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
mExpandable |
protected java.util.List<T> |
mSubItems |
| Constructor and Description |
|---|
AbstractExpandableItem() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSubItem(int position,
T subItem) |
void |
addSubItem(T subItem) |
boolean |
contains(T subItem) |
T |
getSubItem(int position) |
int |
getSubItemPosition(T subItem) |
java.util.List<T> |
getSubItems() |
boolean |
hasSubItem() |
boolean |
isExpanded() |
boolean |
removeSubItem(int position) |
boolean |
removeSubItem(T subItem) |
void |
setExpanded(boolean expanded) |
void |
setSubItems(java.util.List<T> list) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLevelprotected boolean mExpandable
protected java.util.List<T> mSubItems
public boolean isExpanded()
isExpanded in interface IExpandable<T>public void setExpanded(boolean expanded)
setExpanded in interface IExpandable<T>public java.util.List<T> getSubItems()
getSubItems in interface IExpandable<T>public boolean hasSubItem()
public void setSubItems(java.util.List<T> list)
public T getSubItem(int position)
public int getSubItemPosition(T subItem)
public void addSubItem(T subItem)
public void addSubItem(int position,
T subItem)
public boolean contains(T subItem)
public boolean removeSubItem(T subItem)
public boolean removeSubItem(int position)