Class FlutterRenderer

    • Constructor Detail

      • FlutterRenderer

        public FlutterRenderer​(@NonNull
                               FlutterJNI flutterJNI)
    • Method Detail

      • isDisplayingFlutterUi

        public boolean isDisplayingFlutterUi()
        Returns true if this FlutterRenderer is painting pixels to an Android View hierarchy, false otherwise.
      • addIsDisplayingFlutterUiListener

        public void addIsDisplayingFlutterUiListener​(@NonNull
                                                     FlutterUiDisplayListener listener)
        Adds a listener that is invoked whenever this FlutterRenderer starts and stops painting pixels to an Android View hierarchy.
      • startRenderingToSurface

        public void startRenderingToSurface​(@NonNull
                                            Surface surface,
                                            boolean keepCurrentSurface)
        Notifies Flutter that the given surface was created and is available for Flutter rendering.

        If called more than once, the current native resources are released. This can be undesired if the Engine expects to reuse this surface later. For example, this is true when platform views are displayed in a frame, and then removed in the next frame.

        To avoid releasing the current surface resources, set keepCurrentSurface to true.

        See SurfaceHolder.Callback and TextureView.SurfaceTextureListener

        Parameters:
        surface - The render surface.
        keepCurrentSurface - True if the current active surface should not be released.
      • setViewportMetrics

        public void setViewportMetrics​(@NonNull
                                       FlutterRenderer.ViewportMetrics viewportMetrics)
        Notifies Flutter that the viewport metrics, e.g. window height and width, have changed.

        If the width, height, or devicePixelRatio are less than or equal to 0, this update is ignored.

        Parameters:
        viewportMetrics - The metrics to send to the Dart application.
      • getBitmap

        public Bitmap getBitmap()
      • dispatchPointerDataPacket

        public void dispatchPointerDataPacket​(@NonNull
                                              ByteBuffer buffer,
                                              int position)
      • isSoftwareRenderingEnabled

        public boolean isSoftwareRenderingEnabled()
      • setAccessibilityFeatures

        public void setAccessibilityFeatures​(int flags)
      • setSemanticsEnabled

        public void setSemanticsEnabled​(boolean enabled)
      • dispatchSemanticsAction

        public void dispatchSemanticsAction​(int id,
                                            int action,
                                            @Nullable
                                            ByteBuffer args,
                                            int argsPosition)