public class

WindowDecorActionBar.ActionModeImpl

extends ActionMode

implements MenuBuilder.Callback

 java.lang.Object

androidx.appcompat.view.ActionMode

↳androidx.appcompat.app.WindowDecorActionBar.ActionModeImpl

Summary

Constructors
publicActionModeImpl(Context context, ActionMode.Callback callback)

Methods
public booleandispatchOnCreate()

public abstract voidfinish()

Finish and close this action mode.

public abstract ViewgetCustomView()

Returns the current custom view for this action mode.

public abstract MenugetMenu()

Returns the menu of actions that this action mode presents.

public abstract MenuInflatergetMenuInflater()

Returns a with the ActionMode's context.

public abstract java.lang.CharSequencegetSubtitle()

Returns the current subtitle of this action mode.

public abstract java.lang.CharSequencegetTitle()

Returns the current title of this action mode.

public abstract voidinvalidate()

Invalidate the action mode and refresh menu content.

public booleanisTitleOptional()

public voidonCloseMenu(MenuBuilder menu, boolean allMenusAreClosing)

public voidonCloseSubMenu(SubMenuBuilder menu)

public booleanonMenuItemSelected(MenuBuilder menu, MenuItem item)

public voidonMenuModeChange(MenuBuilder menu)

public booleanonSubMenuSelected(SubMenuBuilder subMenu)

public abstract voidsetCustomView(View view)

Set a custom view for this action mode.

public abstract voidsetSubtitle(java.lang.CharSequence subtitle)

Set the subtitle of the action mode.

public abstract voidsetSubtitle(int resId)

Set the subtitle of the action mode.

public abstract voidsetTitle(java.lang.CharSequence title)

Set the title of the action mode.

public abstract voidsetTitle(int resId)

Set the title of the action mode.

public voidsetTitleOptionalHint(boolean titleOptional)

Set whether or not the title/subtitle display for this action mode is optional.

from ActionModegetTag, getTitleOptionalHint, isUiFocusable, setTag
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public ActionModeImpl(Context context, ActionMode.Callback callback)

Methods

public abstract MenuInflater getMenuInflater()

Returns a with the ActionMode's context.

public abstract Menu getMenu()

Returns the menu of actions that this action mode presents.

Returns:

The action mode's menu.

public abstract void finish()

Finish and close this action mode. The action mode's ActionMode.Callback will have its ActionMode.Callback.onDestroyActionMode(ActionMode) method called.

public abstract void invalidate()

Invalidate the action mode and refresh menu content. The mode's ActionMode.Callback will have its ActionMode.Callback.onPrepareActionMode(ActionMode, Menu) method called. If it returns true the menu will be scanned for updated content and any relevant changes will be reflected to the user.

public boolean dispatchOnCreate()

public abstract void setCustomView(View view)

Set a custom view for this action mode. The custom view will take the place of the title and subtitle. Useful for things like search boxes.

Parameters:

view: Custom view to use in place of the title/subtitle.

See also: ActionMode.setTitle(CharSequence), ActionMode.setSubtitle(CharSequence)

public abstract void setSubtitle(java.lang.CharSequence subtitle)

Set the subtitle of the action mode. This method will have no visible effect if a custom view has been set.

Parameters:

subtitle: Subtitle string to set

See also: ActionMode.setSubtitle(int), ActionMode.setCustomView(View)

public abstract void setTitle(java.lang.CharSequence title)

Set the title of the action mode. This method will have no visible effect if a custom view has been set.

Parameters:

title: Title string to set

See also: ActionMode.setTitle(int), ActionMode.setCustomView(View)

public abstract void setTitle(int resId)

Set the title of the action mode. This method will have no visible effect if a custom view has been set.

Parameters:

resId: Resource ID of a string to set as the title

See also: ActionMode.setTitle(CharSequence), ActionMode.setCustomView(View)

public abstract void setSubtitle(int resId)

Set the subtitle of the action mode. This method will have no visible effect if a custom view has been set.

Parameters:

resId: Resource ID of a string to set as the subtitle

See also: ActionMode.setSubtitle(CharSequence), ActionMode.setCustomView(View)

public abstract java.lang.CharSequence getTitle()

Returns the current title of this action mode.

Returns:

Title text

public abstract java.lang.CharSequence getSubtitle()

Returns the current subtitle of this action mode.

Returns:

Subtitle text

public void setTitleOptionalHint(boolean titleOptional)

Set whether or not the title/subtitle display for this action mode is optional.

In many cases the supplied title for an action mode is merely meant to add context and is not strictly required for the action mode to be useful. If the title is optional, the system may choose to hide the title entirely rather than truncate it due to a lack of available space.

Note that this is merely a hint; the underlying implementation may choose to ignore this setting under some circumstances.

Parameters:

titleOptional: true if the title only presents optional information.

public boolean isTitleOptional()

Returns:

true if this action mode considers the title and subtitle fields as optional. Optional titles may not be displayed to the user.

public abstract View getCustomView()

Returns the current custom view for this action mode.

Returns:

The current custom view

public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item)

public void onCloseMenu(MenuBuilder menu, boolean allMenusAreClosing)

public boolean onSubMenuSelected(SubMenuBuilder subMenu)

public void onCloseSubMenu(SubMenuBuilder menu)

public void onMenuModeChange(MenuBuilder menu)