當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。