当前位置: 首页>>代码示例>>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;未经允许,请勿转载。