Class BasicSelectionActionDelegate

Object
org.mozilla.geckoview.BasicSelectionActionDelegate
All Implemented Interfaces:
ActionMode.Callback, GeckoSession.SelectionActionDelegate

@UiThread public class BasicSelectionActionDelegate extends Object implements ActionMode.Callback, GeckoSession.SelectionActionDelegate
Class that implements a basic SelectionActionDelegate. This class is used by GeckoView by default if the consumer does not explicitly set a SelectionActionDelegate.

To provide custom actions, extend this class and override the following methods,

1) Override getAllActions() to include custom action IDs in the returned array. This array must include all actions, available or not, and must not change over the class lifetime.

2) Override isActionAvailable(java.lang.String) to return whether a custom action is currently available.

3) Override prepareAction(java.lang.String, android.view.MenuItem) to set custom title and/or icon for a custom action.

4) Override performAction(java.lang.String, android.view.MenuItem) to perform a custom action when used.

  • Field Details

    • ACTION_PROCESS_TEXT

      protected static final String ACTION_PROCESS_TEXT
      See Also:
    • mActivity

      @NonNull protected final Activity mActivity
    • mUseFloatingToolbar

      protected final boolean mUseFloatingToolbar
    • mTempMatrix

      @NonNull protected final Matrix mTempMatrix
    • mTempRect

      @NonNull protected final RectF mTempRect
    • mActionMode

      @Nullable protected ActionMode mActionMode
    • mSession

      @Nullable protected GeckoSession mSession
    • mSelection

      @Nullable protected GeckoSession.SelectionActionDelegate.Selection mSelection
    • mRepopulatedMenu

      protected boolean mRepopulatedMenu
  • Constructor Details

    • BasicSelectionActionDelegate

      public BasicSelectionActionDelegate(@NonNull Activity activity)
    • BasicSelectionActionDelegate

      public BasicSelectionActionDelegate(@NonNull Activity activity, boolean useFloatingToolbar)
  • Method Details