Package io.flutter.embedding.android
Class AndroidTouchProcessor
java.lang.Object
io.flutter.embedding.android.AndroidTouchProcessor
Sends touch information from Android to Flutter in a format that Flutter understands.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfacestatic @interfacestatic @interface -
Constructor Summary
ConstructorsConstructorDescriptionAndroidTouchProcessor(FlutterRenderer renderer, boolean trackMotionEvents) Constructs anAndroidTouchProcessorthat will send touch event data to the Flutter execution context represented by the givenFlutterRenderer. -
Method Summary
Modifier and TypeMethodDescriptionbooleanonGenericMotionEvent(MotionEvent event, Context context) Sends the given genericMotionEventdata to Flutter in a format that Flutter understands.booleanonTouchEvent(MotionEvent event) booleanonTouchEvent(MotionEvent event, Matrix transformMatrix) Sends the givenMotionEventdata to Flutter in a format that Flutter understands.
-
Constructor Details
-
AndroidTouchProcessor
Constructs anAndroidTouchProcessorthat will send touch event data to the Flutter execution context represented by the givenFlutterRenderer.- Parameters:
renderer- The object that manages textures for rendering.trackMotionEvents- This is used to query motion events when platform views are rendered.
-
-
Method Details
-
onTouchEvent
-
onTouchEvent
Sends the givenMotionEventdata to Flutter in a format that Flutter understands.- Parameters:
event- The motion event from the view.transformMatrix- Applies to the view that originated the event. It's used to transform the gesture pointers into screen coordinates.- Returns:
- True if the event was handled.
-
onGenericMotionEvent
Sends the given genericMotionEventdata to Flutter in a format that Flutter understands.Generic motion events include joystick movement, mouse hover, track pad touches, scroll wheel movements, etc.
- Parameters:
event- The generic motion event being processed.context- For use by ViewConfiguration.get(context) to scale input.- Returns:
- True if the event was handled.
-