当前位置: 首页>>代码示例>>Java>>正文


Java ActionMode.setTitle方法代码示例

本文整理汇总了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;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:19,代码来源:ConversationListFragment.java

示例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;
}
 
开发者ID:GlobusLTD,项目名称:recyclerview-android,代码行数:20,代码来源:MultipleModalChoiceModeExampleActivity.java

示例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;
}
 
开发者ID:GlobusLTD,项目名称:recyclerview-android,代码行数:20,代码来源:SingleModalChoiceModeExampleActivity.java

示例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();
		}
	});
}
 
开发者ID:universum-studios,项目名称:android_ui,代码行数:14,代码来源:MetricsAndKeyLinesFragment.java

示例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;
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:14,代码来源:QueryFragment.java

示例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;
}
 
开发者ID:privacyidea,项目名称:privacyidea-authenticator,代码行数:8,代码来源:MainActivity.java

示例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));
}
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:11,代码来源:SettingsFragment.java

示例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;
}
 
开发者ID:jam01,项目名称:LittleLight,代码行数:8,代码来源:InventoryFragment.java

示例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
}
 
开发者ID:ChessCom,项目名称:android-chessclock,代码行数:6,代码来源:SettingsFragment.java


注:本文中的android.support.v7.view.ActionMode.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。