public abstract class MultiTypeDelegate<T>
extends java.lang.Object
Created by tysheng Date: 2017/4/6 08:41. Email: tyshengsx@gmail.com
more information: https://github.com/CymChad/BaseRecyclerViewAdapterHelper/issues/968
| Constructor and Description |
|---|
MultiTypeDelegate() |
MultiTypeDelegate(android.util.SparseIntArray layouts) |
| Modifier and Type | Method and Description |
|---|---|
int |
getDefItemViewType(java.util.List<T> data,
int position) |
protected abstract int |
getItemType(T t)
get the item type from specific entity.
|
int |
getLayoutId(int viewType) |
MultiTypeDelegate |
registerItemType(int type,
int layoutResId)
set your own type one by one.
|
MultiTypeDelegate |
registerItemTypeAutoIncrease(int... layoutResIds)
auto increase type vale, start from 0.
|
public MultiTypeDelegate(android.util.SparseIntArray layouts)
public MultiTypeDelegate()
public final int getDefItemViewType(java.util.List<T> data, int position)
protected abstract int getItemType(T t)
t - entitypublic final int getLayoutId(int viewType)
public MultiTypeDelegate registerItemTypeAutoIncrease(int... layoutResIds)
layoutResIds - layout id arrayspublic MultiTypeDelegate registerItemType(int type, int layoutResId)
type - type valuelayoutResId - layout id