ActionMode.Callback2
public static abstract class ActionMode.Callback2
extends Object
implements ActionMode.Callback
扩展ActionMode.Callback
以提供内容矩形信息。 对于动态定位(如类型为TYPE_FLOATING的ActionModes)来说,这是必需的,以确保定位不会TYPE_FLOATING
应用内容。 如果应用程序未能提供此类的子类,则将使用默认实现。
Summary
Public constructors
ActionMode.Callback2
ActionMode.Callback2 ()
Public methods
onGetContentRect
void onGetContentRect (ActionMode mode,
View view,
Rect outRect)
当ActionMode需要在屏幕上定位时调用,可能会遮挡视图内容。 注意这可能会在每帧的基础上调用。
Parameters |
mode |
ActionMode : The ActionMode that requires positioning. |
view |
View : The View that originated the ActionMode, in whose coordinates the Rect should be provided. |
outRect |
Rect : The Rect to be populated with the content position. Use this to specify where the content in your app lives within the given view. This will be used to avoid occluding the given content Rect with the created ActionMode. |