-
public abstract class BaseMultiTypeDelegate<T extends Object>help you to achieve multi type easily
Created by tysheng Date: 2017/4/6 08:41. Email: tyshengsx@gmail.com
more information: https://github.com/CymChad/BaseRecyclerViewAdapterHelper/issues/968
-
-
Constructor Summary
Constructors Constructor Description BaseMultiTypeDelegate(SparseIntArray layouts)
-
Method Summary
Modifier and Type Method Description abstract IntegergetItemType(List<T> data, Integer position)get the item type from specific entity. final IntegergetLayoutId(Integer viewType)final BaseMultiTypeDelegate<T>addItemTypeAutoIncrease(@LayoutRes() Integer layoutResIds)auto increase type vale, start from 0. final BaseMultiTypeDelegate<T>addItemType(Integer type, @LayoutRes() Integer layoutResId)set your own type one by one. -
-
Constructor Detail
-
BaseMultiTypeDelegate
BaseMultiTypeDelegate(SparseIntArray layouts)
-
-
Method Detail
-
getItemType
abstract Integer getItemType(List<T> data, Integer position)
get the item type from specific entity.
- Parameters:
data- entity
-
getLayoutId
final Integer getLayoutId(Integer viewType)
-
addItemTypeAutoIncrease
final BaseMultiTypeDelegate<T> addItemTypeAutoIncrease(@LayoutRes() Integer layoutResIds)
auto increase type vale, start from 0.
- Parameters:
layoutResIds- layout id arrays
-
addItemType
final BaseMultiTypeDelegate<T> addItemType(Integer type, @LayoutRes() Integer layoutResId)
set your own type one by one.
- Parameters:
type- type valuelayoutResId- layout id
-
-
-
-