Class PlatformViewGestureTracker
java.lang.Object
io.flutter.plugin.platform.PlatformViewGestureTracker
Tracks gesture state for platform views and requests unbuffered motion event dispatch when
Flutter wins the gesture arena for an active gesture.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallback interface for requesting unbuffered dispatch on a targetView. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongbooleanbooleanvoidonFlutterWonGesture(long gestureId) Informs the tracker that Flutter has won the gesture arena for the active touch sequence.voidonTouchEvent(MotionEvent event, PlatformViewGestureTracker.UnbufferedRequester requester) Updates tracking state for the givenMotionEventusing a customPlatformViewGestureTracker.UnbufferedRequester.
-
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_MOVEevents 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 givenMotionEventusing a customPlatformViewGestureTracker.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()
-