public class FloatingActionMode extends ActionMode
ActionMode.Callback, ActionMode.Callback2
DEFAULT_HIDE_DURATION, TYPE_FLOATING, TYPE_PRIMARY
Constructor and Description |
---|
FloatingActionMode(Context context,
ActionMode.Callback2 callback,
View originatingView) |
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.
|
CharSequence |
getTitle()
Returns the current title of this action mode.
|
void |
hide(long duration)
Hide the action mode view from obstructing the content below for a short duration.
|
void |
invalidate()
Invalidate the action mode and refresh menu content.
|
void |
invalidateContentRect()
Invalidate the content rect associated to this ActionMode.
|
void |
onWindowFocusChanged(boolean hasWindowFocus)
Called when the window containing the view that started this action mode gains or loses
focus.
|
void |
setCustomView(View view)
Set a custom view for this action mode.
|
void |
setFloatingToolbar(FloatingToolbar floatingToolbar) |
void |
setSubtitle(CharSequence subtitle)
Set the subtitle of the action mode.
|
void |
setSubtitle(int resId)
Set the subtitle of the action mode.
|
void |
setTitle(CharSequence title)
Set the title of the action mode.
|
void |
setTitle(int resId)
Set the title of the action mode.
|
void |
updateViewLocationInWindow() |
getTag, getTitleOptionalHint, getType, isTitleOptional, isUiFocusable, setTag, setTitleOptionalHint, setType
public FloatingActionMode(Context context, ActionMode.Callback2 callback, View originatingView)
public void setFloatingToolbar(FloatingToolbar floatingToolbar)
public void setTitle(CharSequence title)
ActionMode
setTitle
in class ActionMode
title
- Title string to setActionMode.setTitle(int)
,
ActionMode.setCustomView(View)
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 void setSubtitle(CharSequence subtitle)
ActionMode
setSubtitle
in class ActionMode
subtitle
- Subtitle string to setActionMode.setSubtitle(int)
,
ActionMode.setCustomView(View)
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 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 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 invalidateContentRect()
ActionMode
invalidateContentRect
in class ActionMode
.
public void updateViewLocationInWindow()
public void hide(long duration)
ActionMode
hide
in class ActionMode
duration
- The number of milliseconds to hide for.ActionMode.DEFAULT_HIDE_DURATION
public void onWindowFocusChanged(boolean hasWindowFocus)
ActionMode
onWindowFocusChanged
in class ActionMode
hasWindowFocus
- True if the window containing the view that started this action mode
now has focus, false otherwise.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 CharSequence getSubtitle()
ActionMode
getSubtitle
in class ActionMode
public View getCustomView()
ActionMode
getCustomView
in class ActionMode
public MenuInflater getMenuInflater()
ActionMode
MenuInflater
with the ActionMode's context.getMenuInflater
in class ActionMode