/** */ @Override ActionMode startActionMode(ActionMode.Callback callback) { return mActivity.startActionMode(callback); }
/** * @param callback * @return * @see android.app.Activity#startActionMode(android.view.ActionMode.Callback) */ public ActionMode startActionMode(Callback callback) { return mActivity.startActionMode(callback); }
public void startActionMode() { actionMode = mContext.startActionMode(mActionModeCallback); isLongClicked = true; }
@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; }
@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())); } }
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; }
@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; }
@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; }
/** * 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); } }