public class SupportActionModeWrapper extends ActionMode
ActionMode
as a framework
ActionMode
.Modifier and Type | Class and Description |
---|---|
static class |
SupportActionModeWrapper.CallbackWrapper |
ActionMode.Callback, ActionMode.Callback2
DEFAULT_HIDE_DURATION, TYPE_FLOATING, TYPE_PRIMARY
Constructor and Description |
---|
SupportActionModeWrapper(Context context,
ActionMode supportActionMode) |
Modifier and Type | Method and Description |
---|---|
void |
finish()
Finish and close this action mode.
|
View |
getCustomView()
Returns the current custom view for this action mode.
|
Menu |
getMenu()
Returns the menu of actions that this action mode presents.
|
MenuInflater |
getMenuInflater()
Returns a
MenuInflater with the ActionMode's context. |
CharSequence |
getSubtitle()
Returns the current subtitle of this action mode.
|
Object |
getTag()
Retrieve the tag object associated with this ActionMode.
|
CharSequence |
getTitle()
Returns the current title of this action mode.
|
boolean |
getTitleOptionalHint() |
void |
invalidate()
Invalidate the action mode and refresh menu content.
|
boolean |
isTitleOptional() |
void |
setCustomView(View view)
Set a custom view for this action mode.
|
void |
setSubtitle(CharSequence subtitle)
Set the subtitle of the action mode.
|
void |
setSubtitle(int resId)
Set the subtitle of the action mode.
|
void |
setTag(Object tag)
Set a tag object associated with this ActionMode.
|
void |
setTitle(CharSequence title)
Set the title of the action mode.
|
void |
setTitle(int resId)
Set the title of the action mode.
|
void |
setTitleOptionalHint(boolean titleOptional)
Set whether or not the title/subtitle display for this action mode
is optional.
|
getType, hide, invalidateContentRect, isUiFocusable, onWindowFocusChanged, setType
public SupportActionModeWrapper(Context context, ActionMode supportActionMode)
public Object getTag()
ActionMode
Like the tag available to views, this allows applications to associate arbitrary data with an ActionMode for later reference.
getTag
in class ActionMode
ActionMode.setTag(Object)
public void setTag(Object tag)
ActionMode
Like the tag available to views, this allows applications to associate arbitrary data with an ActionMode for later reference.
setTag
in class ActionMode
tag
- Tag to associate with this ActionModeActionMode.getTag()
public void setTitle(CharSequence title)
ActionMode
setTitle
in class ActionMode
title
- Title string to setActionMode.setTitle(int)
,
ActionMode.setCustomView(View)
public void setSubtitle(CharSequence subtitle)
ActionMode
setSubtitle
in class ActionMode
subtitle
- Subtitle string to setActionMode.setSubtitle(int)
,
ActionMode.setCustomView(View)
public void invalidate()
ActionMode
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.invalidate
in class ActionMode
public void finish()
ActionMode
ActionMode.Callback
will
have its ActionMode.Callback.onDestroyActionMode(ActionMode)
method called.finish
in class ActionMode
public Menu getMenu()
ActionMode
getMenu
in class ActionMode
public CharSequence getTitle()
ActionMode
getTitle
in class ActionMode
public void setTitle(int resId)
ActionMode
setTitle
in class ActionMode
resId
- Resource ID of a string to set as the titleActionMode.setTitle(CharSequence)
,
ActionMode.setCustomView(View)
public CharSequence getSubtitle()
ActionMode
getSubtitle
in class ActionMode
public void setSubtitle(int resId)
ActionMode
setSubtitle
in class ActionMode
resId
- Resource ID of a string to set as the subtitleActionMode.setSubtitle(CharSequence)
,
ActionMode.setCustomView(View)
public View getCustomView()
ActionMode
getCustomView
in class ActionMode
public void setCustomView(View view)
ActionMode
setCustomView
in class ActionMode
view
- Custom view to use in place of the title/subtitle.ActionMode.setTitle(CharSequence)
,
ActionMode.setSubtitle(CharSequence)
public MenuInflater getMenuInflater()
ActionMode
MenuInflater
with the ActionMode's context.getMenuInflater
in class ActionMode
public boolean getTitleOptionalHint()
getTitleOptionalHint
in class ActionMode
ActionMode.setTitleOptionalHint(boolean)
,
ActionMode.isTitleOptional()
public void setTitleOptionalHint(boolean titleOptional)
ActionMode
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.
setTitleOptionalHint
in class ActionMode
titleOptional
- true if the title only presents optional information.public boolean isTitleOptional()
isTitleOptional
in class ActionMode