Interface PlatformViewsChannel.PlatformViewsHandler
-
- Enclosing class:
- PlatformViewsChannel
public static interface PlatformViewsChannel.PlatformViewsHandler
Handler that receives platform view messages sent from Flutter to Android through a givenPlatformViewsChannel
.To register a
PlatformViewsHandler
with aPlatformViewsChannel
, seePlatformViewsChannel.setPlatformViewsHandler(PlatformViewsHandler)
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearFocus(int viewId)
Clears the focus from the platform view with a give id if it is currently focused.void
createAndroidViewForPlatformView(PlatformViewsChannel.PlatformViewCreationRequest request)
The Flutter application would like to display a new AndroidView
, i.e., platform view.long
createVirtualDisplayForPlatformView(PlatformViewsChannel.PlatformViewCreationRequest request)
The Flutter application would like to display a new AndroidView
.void
disposeAndroidViewForPlatformView(int viewId)
The Flutter application would like to dispose of an existing AndroidView
rendered in the view hierarchy.void
disposeVirtualDisplayForPlatformView(int viewId)
The Flutter application would like to dispose of an existing AndroidView
rendered in a virtual display.void
onTouch(PlatformViewsChannel.PlatformViewTouch touch)
The user touched a platform view within Flutter.void
resizePlatformView(PlatformViewsChannel.PlatformViewResizeRequest request, Runnable onComplete)
The Flutter application would like to resize an existing AndroidView
, i.e., platform view.void
setDirection(int viewId, int direction)
The Flutter application would like to change the layout direction of an existing AndroidView
, i.e., platform view.void
synchronizeToNativeViewHierarchy(boolean yes)
Whether the render surface ofFlutterView
should be converted to aFlutterImageView
when aPlatformView
is added.
-
-
-
Method Detail
-
createAndroidViewForPlatformView
void createAndroidViewForPlatformView(@NonNull PlatformViewsChannel.PlatformViewCreationRequest request)
The Flutter application would like to display a new AndroidView
, i.e., platform view.The Android
View
is added to the view hierarchy.
-
disposeAndroidViewForPlatformView
void disposeAndroidViewForPlatformView(int viewId)
The Flutter application would like to dispose of an existing AndroidView
rendered in the view hierarchy.
-
createVirtualDisplayForPlatformView
long createVirtualDisplayForPlatformView(@NonNull PlatformViewsChannel.PlatformViewCreationRequest request)
The Flutter application would like to display a new AndroidView
.View
is added to aVirtualDisplay
. The framework uses id returned by this method to lookup the texture in the engine.
-
disposeVirtualDisplayForPlatformView
void disposeVirtualDisplayForPlatformView(int viewId)
The Flutter application would like to dispose of an existing AndroidView
rendered in a virtual display.
-
resizePlatformView
void resizePlatformView(@NonNull PlatformViewsChannel.PlatformViewResizeRequest request, @NonNull Runnable onComplete)
The Flutter application would like to resize an existing AndroidView
, i.e., platform view.
-
onTouch
void onTouch(@NonNull PlatformViewsChannel.PlatformViewTouch touch)
The user touched a platform view within Flutter.Touch data is reported in
touch
.
-
setDirection
void setDirection(int viewId, int direction)
The Flutter application would like to change the layout direction of an existing AndroidView
, i.e., platform view.
-
clearFocus
void clearFocus(int viewId)
Clears the focus from the platform view with a give id if it is currently focused.
-
synchronizeToNativeViewHierarchy
void synchronizeToNativeViewHierarchy(boolean yes)
Whether the render surface ofFlutterView
should be converted to aFlutterImageView
when aPlatformView
is added.This is done to syncronize the rendering of the PlatformView and the FlutterView. Defaults to true.
-
-