android.app.Activity.startActionMode()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(278)

本文整理了Java中android.app.Activity.startActionMode()方法的一些代码示例,展示了Activity.startActionMode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.startActionMode()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:startActionMode

Activity.startActionMode介绍

暂无

代码示例

代码示例来源:origin: com.albedinsky.android/fragments

/**
 */
@Override
ActionMode startActionMode(ActionMode.Callback callback) {
  return mActivity.startActionMode(callback);
}

代码示例来源:origin: com.uphyca/android-junit4-robolectric

/**
 * @param callback
 * @return
 * @see android.app.Activity#startActionMode(android.view.ActionMode.Callback)
 */
public ActionMode startActionMode(Callback callback) {
  return mActivity.startActionMode(callback);
}

代码示例来源:origin: openmrs/openmrs-contrib-android-client

public void startActionMode() {
  actionMode = mContext.startActionMode(mActionModeCallback);
  isLongClicked = true;
}

代码示例来源:origin: com.willowtreeapps/oak-demos

@Override
public ActionMode startActionMode(com.actionbarsherlock.view.ActionMode.Callback callback) {
  if (DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback);
  if (mActionMode != null) {
    mActionMode.finish();
  }
  ActionModeCallbackWrapper wrapped = null;
  if (callback != null) {
    wrapped = new ActionModeCallbackWrapper(callback);
  }
  //Calling this will trigger the callback wrapper's onCreate which
  //is where we will set the new instance to mActionMode since we need
  //to pass it through to the sherlock callbacks and the call below
  //will not have returned yet to store its value.
  mActivity.startActionMode(wrapped);
  return mActionMode;
}

代码示例来源:origin: YeDaxia/Android-YRichEditor

@Override
 public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
  EditorActionModeCallback next=chains.get(item.getItemId());
  if (next != null) {
   next.setSelection(new Selection(editor));
   editor.setCurrentActionMode(host.startActionMode((EditorActionModeCallback.Native)next));
   mode.finish();
   return(true);
  }
  //
  // mode.finish();
  //
  return(listener.doAction(item.getItemId()));
 }
}

代码示例来源:origin: grzegorznittner/chanu

public ActionMode startActionMode() {
  Activity a = (Activity) mActivity;
  final ActionMode actionMode = a.startActionMode(this);
  CustomMenu customMenu = new CustomMenu(a);
  View customView = LayoutInflater.from(a).inflate(
      R.layout.action_mode, null);
  actionMode.setCustomView(customView);
  mSelectionMenu = customMenu.addDropDownMenu(
      (Button) customView.findViewById(R.id.selection_menu),
      R.menu.selection);
  updateSelectionMenu();
  customMenu.setOnMenuItemClickListener(new OnMenuItemClickListener() {
    public boolean onMenuItemClick(MenuItem item) {
      return onActionItemClicked(actionMode, item);
    }
  });
  return actionMode;
}

代码示例来源:origin: com.actionbarsherlock/actionbarsherlock

@Override
public ActionMode startActionMode(com.actionbarsherlock.view.ActionMode.Callback callback) {
  if (ActionBarSherlock.DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback);
  if (mActionMode != null) {
    mActionMode.finish();
  }
  ActionModeCallbackWrapper wrapped = null;
  if (callback != null) {
    wrapped = new ActionModeCallbackWrapper(callback);
  }
  //Calling this will trigger the callback wrapper's onCreate which
  //is where we will set the new instance to mActionMode since we need
  //to pass it through to the sherlock callbacks and the call below
  //will not have returned yet to store its value.
  if (mActivity.startActionMode(wrapped) == null) {
    mActionMode = null;
  }
  if (mActivity instanceof OnActionModeStartedListener && mActionMode != null) {
    ((OnActionModeStartedListener)mActivity).onActionModeStarted(mActionMode);
  }
  return mActionMode;
}

代码示例来源:origin: sorz/TinyKeePass

@Override
protected boolean onEntryLongClick(View view, Entry entry) {
  if (getActivity() == null)
    return false;
  if (actionMode != null) {
    if (actionMode.getTag() == entryLongClickActionModeCallback) {
      actionMode.invalidate();
      return true;
    } else {
      // Finish show password mode
      actionMode.finish();
    }
  }
  actionMode = getActivity().startActionMode(entryLongClickActionModeCallback);
  if (actionMode != null) {
    actionMode.setTag(entryLongClickActionModeCallback);
    return true;
  }
  return false;
}

代码示例来源:origin: sorz/TinyKeePass

/**
 * Display password.
 * @param entry to show
 */
private void showPassword(Entry entry) {
  if (getActivity() == null)
    return;
  if (actionMode != null) {
    actionMode.finish();
  }
  actionMode = getActivity().startActionMode(entryShowPasswordActionModeCallback);
  if (actionMode != null) {
    actionMode.setTag(entryShowPasswordActionModeCallback);
    actionMode.setTitle(getString(R.string.title_show_password));
    getEntryAdapter().showPassword(entry);
  }
}

相关文章

Activity类方法