Class PlatformViewGestureTracker

java.lang.Object
io.flutter.plugin.platform.PlatformViewGestureTracker

public class PlatformViewGestureTracker extends Object
Tracks gesture state for platform views and requests unbuffered motion event dispatch when Flutter wins the gesture arena for an active gesture.
  • Constructor Details

    • PlatformViewGestureTracker

      public PlatformViewGestureTracker()
  • Method Details

    • onFlutterWonGesture

      public void onFlutterWonGesture(long gestureId)
      Informs the tracker that Flutter has won the gesture arena for the active touch sequence.

      Subsequent MotionEvent.ACTION_MOVE events will request unbuffered dispatch on the target view to minimize latency and prevent stutter for Flutter-driven gestures (e.g., scrolling).

      Parameters:
      gestureId - The identifier (downTime) of the gesture that Flutter won. Unbuffered dispatch is only enabled if this matches the currently active gesture's downTime.
    • onTouchEvent

      public void onTouchEvent(@NonNull MotionEvent event, @NonNull PlatformViewGestureTracker.UnbufferedRequester requester)
      Updates tracking state for the given MotionEvent using a custom PlatformViewGestureTracker.UnbufferedRequester.
      Parameters:
      event - The motion event being processed.
      requester - The callback invoked to request unbuffered dispatch.
    • getFlutterWonGesture

      @VisibleForTesting public boolean getFlutterWonGesture()
    • isGestureActive

      @VisibleForTesting public boolean isGestureActive()
    • getCurrentDownTime

      @VisibleForTesting public long getCurrentDownTime()