Java Code Examples for android.view.ActionMode#Callback

The following examples show how to use android.view.ActionMode#Callback . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomWebView.java    From browser with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ActionMode startActionMode(ActionMode.Callback callback) {
	ViewParent parent = getParent();
	if (parent == null) {
		return null;
	}
	if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
		String name = callback.getClass().toString();
		if (name.contains("SelectActionModeCallback")) {
			mSelectActionModeCallback = callback;
			mDetector = new GestureDetector(context,
					new CustomGestureListener());
		}
	}
	CustomActionModeCallback mActionModeCallback = new CustomActionModeCallback();
	return parent.startActionModeForChild(this, mActionModeCallback);
}
 
Example 2
Source File: ExtendedWebView.java    From ForPDA with GNU General Public License v3.0 5 votes vote down vote up
private ActionMode myActionMode(ActionMode.Callback callback, int type) {
    ViewParent parent = getParent();
    if (parent == null) {
        return null;
    }
    ActionMode actionMode;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        actionMode = super.startActionMode(callback, type);
    } else {
        actionMode = super.startActionMode(callback);
    }
    if (actionModeListener != null)
        actionModeListener.OnStart(actionMode, callback, type);
    return actionMode;
}
 
Example 3
Source File: EditText.java    From MDPreference with Apache License 2.0 5 votes vote down vote up
/**
    * Retrieves the value set in {@link #setCustomSelectionActionModeCallback}. Default is null.
    *
    * @return The current custom selection callback.
    */
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public ActionMode.Callback getCustomSelectionActionModeCallback (){
	if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
		return mInputView.getCustomSelectionActionModeCallback();

	return null;
}
 
Example 4
Source File: Dialog.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public ActionMode onWindowStartingActionMode(ActionMode.Callback callback) {
    if (mActionBar != null && mActionModeTypeStarting == ActionMode.TYPE_PRIMARY) {
        return mActionBar.startActionMode(callback);
    }
    return null;
}
 
Example 5
Source File: BlockEditText.java    From BlockEditText with Apache License 2.0 5 votes vote down vote up
public void setCustomInsertionActionModeCallback(ActionMode.Callback callback) {
    this.callback = callback;
    for (int i = 0; i < editTexts.size(); i++) {
        AEditText editText = editTexts.get(i);
        setCustomInsertionActionModeCallback(editText, callback);
    }
}
 
Example 6
Source File: EditText.java    From material with Apache License 2.0 5 votes vote down vote up
/**
    * Retrieves the value set in {@link #setCustomSelectionActionModeCallback}. Default is null.
    *
    * @return The current custom selection callback.
    */
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public ActionMode.Callback getCustomSelectionActionModeCallback (){
	if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
		return mInputView.getCustomSelectionActionModeCallback();

	return null;
}
 
Example 7
Source File: MyWindowCallback.java    From MaterialChipsInput with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public ActionMode onWindowStartingActionMode(ActionMode.Callback callback) {
    return mLocalCallback.onWindowStartingActionMode(callback);
}
 
Example 8
Source File: ObservableWebView.java    From fangzhuishushenqi with Apache License 2.0 4 votes vote down vote up
@Override
public ActionMode startActionMode(ActionMode.Callback callback) {
    return this.dummyActionMode();
}
 
Example 9
Source File: CustomActionWebView.java    From CustomActionWebView with MIT License 4 votes vote down vote up
@Override
public ActionMode startActionMode(ActionMode.Callback callback) {
    ActionMode actionMode = super.startActionMode(callback);
    return resolveActionMode(actionMode);
}
 
Example 10
Source File: EditTextCaption.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ActionMode startActionMode(final ActionMode.Callback callback, int type) {
    return super.startActionMode(overrideCallback(callback), type);
}
 
Example 11
Source File: EditTextCaption.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ActionMode startActionMode(final ActionMode.Callback callback, int type) {
    return super.startActionMode(overrideCallback(callback), type);
}
 
Example 12
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void customSelectionActionModeCallback(ActionMode.Callback arg) {
  return BaseDSL.attr("customSelectionActionModeCallback", arg);
}
 
Example 13
Source File: TEditText.java    From timecat with Apache License 2.0 4 votes vote down vote up
@Override
public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) {
    super.setCustomSelectionActionModeCallback(actionModeCallback);
}
 
Example 14
Source File: MonitorActivityLifecycleCallbacks.java    From BehaviorCollect with GNU General Public License v3.0 4 votes vote down vote up
@Nullable
@TargetApi(23)
@Override
public ActionMode onWindowStartingActionMode(ActionMode.Callback callback, int type) {
    return this.callback.onWindowStartingActionMode(callback,type);
}
 
Example 15
Source File: MonitorActivityLifecycleCallbacks.java    From BehaviorCollect with GNU General Public License v3.0 4 votes vote down vote up
@Nullable
@Override
public ActionMode onWindowStartingActionMode(ActionMode.Callback callback) {
    return this.callback.onWindowStartingActionMode(callback);
}
 
Example 16
Source File: CustomActionWebView.java    From CustomActionWebView with MIT License 4 votes vote down vote up
@Override
public ActionMode startActionMode(ActionMode.Callback callback, int type) {
    ActionMode actionMode = super.startActionMode(callback, type);
    return resolveActionMode(actionMode);
}
 
Example 17
Source File: EditTextCaption.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ActionMode startActionMode(final ActionMode.Callback callback, int type) {
    return super.startActionMode(overrideCallback(callback), type);
}
 
Example 18
Source File: ObservableWebView.java    From BookReader with Apache License 2.0 4 votes vote down vote up
@Override
public ActionMode startActionMode(ActionMode.Callback callback, int type) {
    return this.dummyActionMode();
}
 
Example 19
Source File: FindToolbarManager.java    From 365browser with Apache License 2.0 2 votes vote down vote up
/**
 * Creates an instance of a {@link FindToolbarManager}.
 * @param activity The ChromeActivity that contains the {@link FindToolbar}.
 * @param callback The ActionMode.Callback that will be used when selection occurs on the
 *         {@link FindToolbar}.
 */
public FindToolbarManager(ChromeActivity activity, ActionMode.Callback callback) {
    mActivity = activity;
    mCallback = callback;
    mObservers = new ObserverList<FindToolbarObserver>();
}
 
Example 20
Source File: IMainActivityListener.java    From Expense-Tracker-App with MIT License votes vote down vote up
ActionMode setActionMode(ActionMode.Callback actionModeCallback);