本文整理匯總了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);
}