protected class TuSdkGridView.GridViewAdapter extends TuSdkAdapter<T>
构造器和说明 |
---|
GridViewAdapter() |
GridViewAdapter(int viewLayoutId) |
GridViewAdapter(int viewLayoutId,
java.util.List<T> modeList) |
限定符和类型 | 方法和说明 |
---|---|
boolean |
getEnableMultiSelection()
是否支持多选 (默认: true)
|
int |
getItemSelectionIndex(int position)
获取元素的选择索引
|
int |
getItemSelectionIndex(T item)
获取元素的选择索引
|
java.util.ArrayList<T> |
getSelectedItems()
当前选中的元素列表
|
void |
onBindViewHolder(TuSdkViewHolder<T> holder,
int position)
绑定视图
|
TuSdkViewHolder<T> |
onCreateViewHolder(android.view.ViewGroup parent,
int viewType)
创建视图
|
void |
onViewAttachedToWindow(TuSdkViewHolder<T> holder) |
void |
resetSelections()
清除选择数据
|
void |
setEnableMultiSelection(boolean mEnableMultiSelection)
是否支持多选 (默认: true)
|
void |
setItemSelected(int position,
boolean selected)
设置元素的选择状态
|
void |
setSelectedItems(java.util.ArrayList<T> items)
设置选中的元素列表
|
getItem, getItemClickListener, getItemCount, getItemId, getItemPosition, getModeList, getSelectedPosition, getViewLayoutId, onViewRecycled, setItemClickListener, setModeList, setSelectedPosition, setViewLayoutId
bindViewHolder, createViewHolder, getItemViewType, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewDetachedFromWindow, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver
public GridViewAdapter()
public GridViewAdapter(int viewLayoutId, java.util.List<T> modeList)
public GridViewAdapter(int viewLayoutId)
public TuSdkViewHolder<T> onCreateViewHolder(android.view.ViewGroup parent, int viewType)
onCreateViewHolder
在类中 TuSdkAdapter<T>
public void onBindViewHolder(TuSdkViewHolder<T> holder, int position)
onBindViewHolder
在类中 TuSdkAdapter<T>
public void onViewAttachedToWindow(TuSdkViewHolder<T> holder)
onViewAttachedToWindow
在类中 TuSdkAdapter<T>
public void setEnableMultiSelection(boolean mEnableMultiSelection)
public boolean getEnableMultiSelection()
public java.util.ArrayList<T> getSelectedItems()
public void setSelectedItems(java.util.ArrayList<T> items)
items
- 选中的元素列表public void setItemSelected(int position, boolean selected)
position
- the position to setselected
- true / falsepublic int getItemSelectionIndex(T item)
item
- the itempublic int getItemSelectionIndex(int position)
position
- 数据源中的位置索引public void resetSelections()