本文整理汇总了Java中eu.davidea.flexibleadapter.helpers.ActionModeHelper类的典型用法代码示例。如果您正苦于以下问题:Java ActionModeHelper类的具体用法?Java ActionModeHelper怎么用?Java ActionModeHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActionModeHelper类属于eu.davidea.flexibleadapter.helpers包,在下文中一共展示了ActionModeHelper类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeActionModeHelper
import eu.davidea.flexibleadapter.helpers.ActionModeHelper; //导入依赖的package包/类
private void initializeActionModeHelper() {
//this = ActionMode.Callback instance
mActionModeHelper = new ActionModeHelper(mAdapter, R.menu.menu_action_header, this) {
// Override to customize the title
@Override
public void updateContextTitle(int count) {
// You can use the internal mActionMode instance
if (mActionMode != null) {
int position = mAdapter.getSelectedPositions().get(0);
AbstractFlexibleItem item = mAdapter.getItem(position);
mActionMode.setTitle(fontifyString(getActivity(), getString(R.string.action_edit_category, item)));
}
}
}.withDefaultMode(SelectableAdapter.Mode.SINGLE);
mActionModeHelper.withDefaultMode(SelectableAdapter.Mode.SINGLE);
mAdapter.setMode(SelectableAdapter.Mode.SINGLE);
}
示例2: initializeActionModeHelper
import eu.davidea.flexibleadapter.helpers.ActionModeHelper; //导入依赖的package包/类
private void initializeActionModeHelper(int mode) {
mActionModeHelper = new ActionModeHelper(mAdapter, mFragment.getContextMenuResId(), this) {
@Override
public void updateContextTitle(int count) {
if (mActionMode != null) {//You can use the internal ActionMode instance
mActionMode.setTitle(count == 1 ?
getString(R.string.action_selected_one, Integer.toString(count)) :
getString(R.string.action_selected_many, Integer.toString(count)));
}
}
}.withDefaultMode(mode);
}
示例3: initializeActionModeHelper
import eu.davidea.flexibleadapter.helpers.ActionModeHelper; //导入依赖的package包/类
private void initializeActionModeHelper(@Mode int mode) {
mActionModeHelper = new ActionModeHelper(mAdapter, mFragment.getContextMenuResId(), this) {
@Override
public void updateContextTitle(int count) {
if (mActionMode != null) {//You can use the internal ActionMode instance
mActionMode.setTitle(count == 1 ?
getString(R.string.action_selected_one, Integer.toString(count)) :
getString(R.string.action_selected_many, Integer.toString(count)));
}
}
}.withDefaultMode(mode)
.disableDragOnActionMode(true)
.disableSwipeOnActionMode(true);
}