當前位置: 首頁>>代碼示例>>Java>>正文


Java ActionMode.setTitle方法代碼示例

本文整理匯總了Java中android.view.ActionMode.setTitle方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionMode.setTitle方法的具體用法?Java ActionMode.setTitle怎麽用?Java ActionMode.setTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.ActionMode的用法示例。


在下文中一共展示了ActionMode.setTitle方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onItemCheckedStateChanged

import android.view.ActionMode; //導入方法依賴的package包/類
@Override
public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
	if (checked) {
		// Directories and footer items cannot be checked
		boolean valid = false;

		final Cursor cursor = mAdapter.getItem(position);
		if (cursor != null) {
			final String docMimeType = getCursorString(cursor, Document.COLUMN_MIME_TYPE);
			final int docFlags = getCursorInt(cursor, Document.COLUMN_FLAGS);
			// if (!Document.MIME_TYPE_DIR.equals(docMimeType)) {
			valid = isDocumentEnabled(docMimeType, docFlags);
			// }
		}

		if (!valid) {
			mCurrentView.setItemChecked(position, false);
		}
	}

	int count = mCurrentView.getCheckedItemCount();
	mode.setTitle(getResources().getString(R.string.mode_selected_count, count));
	if (count == 1 || count == 2) {
		mode.invalidate();
	}
}
 
開發者ID:kranthi0987,項目名稱:easyfilemanager,代碼行數:27,代碼來源:DirectoryFragment.java

示例2: onCreateActionMode

import android.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
    MenuInflater inflater = actionMode.getMenuInflater();
    inflater.inflate(getMenuRes(loaderId), menu);

    // Show checkboxes
    if(mAdapter instanceof HistoryAdapter){
        ((HistoryAdapter) mAdapter).setShowCheckbox(true);
    } else if (mAdapter instanceof MainCursorAdapter){
        ((MainCursorAdapter) mAdapter).setShowCheckbox(true);
    }

    actionMode.setTitle(selectedIds.size() + " selected");
    mActionMode = actionMode;
    return true;
}
 
開發者ID:danlls,項目名稱:Todule-android,代碼行數:17,代碼來源:ToduleListFragment.java

示例3: onPrepareActionMode

import android.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 mode, Menu menu) {
    int childCount = mWallpapersView.getChildCount();
    int numCheckedItems = 0;
    for (int i = 0; i < childCount; i++) {
        CheckableFrameLayout c = (CheckableFrameLayout) mWallpapersView.getChildAt(i);
        if (c.isChecked()) {
            numCheckedItems++;
        }
    }

    if (numCheckedItems == 0) {
        mode.finish();
        return true;
    } else {
        mode.setTitle(getResources().getQuantityString(
                R.plurals.number_of_items_selected, numCheckedItems, numCheckedItems));
        return true;
    }
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:25,代碼來源:WallpaperPickerActivity.java

示例4: updateActionModeTitle

import android.view.ActionMode; //導入方法依賴的package包/類
public static void updateActionModeTitle(ActionMode mode, Context context, int selectedNum)
 {
if (mode != null)
{
  mode.setTitle(context.getString(R.string.app_id, selectedNum));
  if (selectedNum == 0)
  {
	mode.finish();
  }
}
 }
 
開發者ID:stytooldex,項目名稱:stynico,代碼行數:12,代碼來源:Util.java

示例5: setSubtitle

import android.view.ActionMode; //導入方法依賴的package包/類
private void setSubtitle(ActionMode mode, int selectedCount) {
    switch (selectedCount) {
        case 0:
            mode.setSubtitle(null);
            break;
        default:
            mode.setTitle(SimpleNotesApplication.getResourceStringNotesSelectedNumber() + String.valueOf(selectedCount));
            break;
    }
}
 
開發者ID:coffeeplanter,項目名稱:SimpleNotes,代碼行數:11,代碼來源:MultiChoiceImplementation.java

示例6: onCreateActionMode

import android.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    MenuInflater inflater = mode.getMenuInflater();
    inflater.inflate(R.menu.filesystem__context_menu, menu);
    mode.setTitle(getResources().getString(R.string.select_elements));
    return true;
}
 
開發者ID:gsantner,項目名稱:markor,代碼行數:8,代碼來源:FilesystemListFragment.java

示例7: onItemCheckedStateChanged

import android.view.ActionMode; //導入方法依賴的package包/類
@Override
public void onItemCheckedStateChanged(ActionMode actionMode, int i, long l, boolean b) {
    if(b){
        selectedIds.put(l, b);
    } else {
        selectedIds.remove(l);
    }
    actionMode.setTitle(selectedIds.size() + " selected");
}
 
開發者ID:danlls,項目名稱:Todule-android,代碼行數:10,代碼來源:ToduleLabelFragment.java

示例8: onCreateActionMode

import android.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
    MenuInflater inflater = actionMode.getMenuInflater();
    inflater.inflate(R.menu.menu_action_mode_label, menu);

    lAdapter.setShowCheckbox(true);
    actionMode.setTitle(selectedIds.size() + " selected");
    return true;
}
 
開發者ID:danlls,項目名稱:Todule-android,代碼行數:10,代碼來源:ToduleLabelFragment.java

示例9: onActionModeStarted

import android.view.ActionMode; //導入方法依賴的package包/類
@Override
public void onActionModeStarted(ActionMode mode) {
    if (mActionMode == null) {
        mActionMode = mode;
        Menu menu = mode.getMenu();

        menu.clear();

        if (!shouldDisplayFloatingSelectionMenu()) {
            MenuInflater inflater = new MenuInflater(this);

            inflater.inflate(R.menu.text_selection_context_menu, menu);
            mode.setTitle(null);

            menu.findItem(R.id.action_copy_text).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
            menu.findItem(R.id.action_select_all_text).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
            menu.findItem(R.id.action_add_comment).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
            menu.findItem(R.id.action_share_text).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
            menu.findItem(R.id.action_add_highlight).setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);

            if (mHighlightClickedFlag) {
                menu.findItem(R.id.action_add_comment).setVisible(true);
                menu.findItem(R.id.highlight_remove).setVisible(true);
            }
        }
    }

    super.onActionModeStarted(mode);
    for (ActionModeChangeListener actionModeChangeListener : mActionModeChangeListener) {
        actionModeChangeListener.actionModeStarted();
    }
}
 
開發者ID:fekracomputers,項目名稱:IslamicLibraryAndroid,代碼行數:33,代碼來源:ReadingActivity.java

示例10: onCreateActionMode

import android.view.ActionMode; //導入方法依賴的package包/類
public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
    actionMode.setTitle(R.string.photo_selection_cab_title);

    MenuInflater inflater = getActivity().getMenuInflater();
    inflater.inflate(R.menu.photo_context_menu, menu);
    return true;
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:8,代碼來源:ContentFragment.java

示例11: onCreateActionMode

import android.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
	editMode = root != null && root.isEditSupported();
	int menuId = R.menu.mode_simple_directory;
	if (null != root && root.isApp()) {
		menuId = R.menu.mode_apps;
	} else {
		menuId = R.menu.mode_directory;
	}

	mode.getMenuInflater().inflate(menuId, menu);
	int count = mCurrentView.getCheckedItemCount();
	mode.setTitle(count+"");
	return true;
}
 
開發者ID:gigabytedevelopers,項目名稱:FireFiles,代碼行數:16,代碼來源:DirectoryFragment.java


注:本文中的android.view.ActionMode.setTitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。