/** * deselects all selections */ public void deselect() { mFastAdapter.recursive(new AdapterPredicate<Item>() { @Override public boolean apply(@NonNull IAdapter<Item> lastParentAdapter, int lastParentPosition, Item item, int position) { deselect(item); return false; } }, false); mFastAdapter.notifyDataSetChanged(); }
/** * select all items * * @param considerSelectableFlag true if the select method should not select an item if its not selectable */ public void select(final boolean considerSelectableFlag) { mFastAdapter.recursive(new AdapterPredicate<Item>() { @Override public boolean apply(@NonNull IAdapter<Item> lastParentAdapter, int lastParentPosition, Item item, int position) { select(lastParentAdapter, item, -1, false, considerSelectableFlag); return false; } }, false); mFastAdapter.notifyDataSetChanged(); }
/** * wraps notifyDataSetChanged */ public void notifyAdapterDataSetChanged() { // handle our extensions for (IAdapterExtension<Item> ext : mExtensions.values()) { ext.notifyAdapterDataSetChanged(); } cacheSizes(); notifyDataSetChanged(); }
/** * deselects all selections */ public void deselect() { SelectExtension<Item> selectExtension = mFastAdapter.getExtension(SelectExtension.class); if (selectExtension == null) { return; } for (Item item : AdapterUtil.getAllItems(mFastAdapter)) { selectExtension.deselect(item); } mFastAdapter.notifyDataSetChanged(); }
/** * select all items * * @param considerSelectableFlag true if the select method should not select an item if its not selectable */ public void select(boolean considerSelectableFlag) { SelectExtension<Item> selectExtension = mFastAdapter.getExtension(SelectExtension.class); if (selectExtension == null) { return; } for (Item item : AdapterUtil.getAllItems(mFastAdapter)) { selectExtension.select(item, considerSelectableFlag); } mFastAdapter.notifyDataSetChanged(); }
fastAdapter.notifyDataSetChanged(); return true; case R.id.item_sort_asc: