本文整理汇总了Java中android.support.v7.view.ActionMode.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java ActionMode.setTitle方法的具体用法?Java ActionMode.setTitle怎么用?Java ActionMode.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.view.ActionMode
的用法示例。
在下文中一共展示了ActionMode.setTitle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
MenuInflater inflater = getActivity().getMenuInflater();
if (archive) inflater.inflate(R.menu.conversation_list_batch_unarchive, menu);
else inflater.inflate(R.menu.conversation_list_batch_archive, menu);
inflater.inflate(R.menu.conversation_list_batch, menu);
mode.setTitle(R.string.conversation_fragment_cab__batch_selection_mode);
mode.setSubtitle(getString(R.string.conversation_fragment_cab__batch_selection_amount, 1));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getActivity().getWindow().setStatusBarColor(getResources().getColor(R.color.action_mode_status_bar));
}
return true;
}
示例2: onPrepareActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public boolean onPrepareActionMode(final ActionMode mode, final Menu menu) {
final int checkedCount = mChoiceMode.getCheckedItemCount();
// Show / hide menu items or menu groups based on number of checked items
final MenuItem item = menu.findItem(R.id.action_delete);
item.setVisible(checkedCount > 0);
// Update action mode title
if (checkedCount > 0) {
final Resources resources = getResources();
mode.setTitle(resources.getQuantityString(R.plurals.action_mode_x_items_selected,
checkedCount, checkedCount));
} else {
mode.setTitle(R.string.action_mode_no_items_selected);
}
return true;
}
示例3: onPrepareActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public boolean onPrepareActionMode(final ActionMode mode, final Menu menu) {
final int checkedCount = mChoiceMode.getCheckedItemCount();
// Show / hide menu items or menu groups based on number of checked items
final MenuItem item = menu.findItem(R.id.action_delete);
item.setVisible(checkedCount > 0);
// Update action mode title
if (checkedCount > 0) {
final Resources resources = getResources();
mode.setTitle(resources.getQuantityString(R.plurals.action_mode_x_items_selected,
checkedCount, checkedCount));
} else {
mode.setTitle(R.string.action_mode_no_items_selected);
}
return true;
}
示例4: onActionModeStarted
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
protected void onActionModeStarted(@NonNull ActionMode actionMode) {
super.onActionModeStarted(actionMode);
actionMode.setTitle("Action Mode");
ActionTextButton.setText(actionMode.getMenu(), R.id.menu_action_confirm, "Confirm");
ActionTextButton.setOnClickListener(actionMode.getMenu(), R.id.menu_action_confirm, new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getActivity(), "Clicked", Toast.LENGTH_SHORT).show();
}
});
}
示例5: onPrepareActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
/**
* Called each time the action mode is shown. Always called after onCreateActionMode,
* but may be called multiple times if the mode is invalidated.
*/
@Override
public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, actionMode, menu);
/* Update action mode with number of selected items. */
actionMode.setTitle(String.valueOf(mSelection.getCount()));
return true;
}
示例6: onPrepareActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
tokenlistadapter.setCurrentSelection(nextSelection);
tokenlistadapter.notifyDataSetChanged();
mode.setTitle(getString(R.string.actionmode_title));
return true;
}
示例7: onItemCheckedStateChanged
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public void onItemCheckedStateChanged(ActionMode mode, int position, boolean checked) {
if (checked) {
mTotalItemChecked++;
} else {
mTotalItemChecked--;
}
mode.setTitle(mTotalItemChecked + " " + getActivity().getString(R.string.settings_cab_title_time_controls_selected));
}
示例8: onCreateActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
mode.getMenuInflater().inflate(R.menu.menu_inventory_overlay, menu);
mode.setTitle("Send ");
actionMode = mode;
return true;
}
示例9: onPrepareActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
actionMode.setTitle(mTotalItemChecked + " " + getActivity().getString(R.string.settings_cab_title_time_controls_selected));
return false; // Return false if nothing is done
}