Package io.flutter.embedding.android
Class AndroidTouchProcessor
- java.lang.Object
-
- io.flutter.embedding.android.AndroidTouchProcessor
-
public class AndroidTouchProcessor extends Object
Sends touch information from Android to Flutter in a format that Flutter understands.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AndroidTouchProcessor.PointerChange
static interface
AndroidTouchProcessor.PointerDeviceKind
static interface
AndroidTouchProcessor.PointerSignalKind
-
Constructor Summary
Constructors Constructor Description AndroidTouchProcessor(FlutterRenderer renderer, boolean trackMotionEvents)
Constructs anAndroidTouchProcessor
that will send touch event data to the Flutter execution context represented by the givenFlutterRenderer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
onGenericMotionEvent(MotionEvent event)
Sends the given genericMotionEvent
data to Flutter in a format that Flutter understands.boolean
onTouchEvent(MotionEvent event)
boolean
onTouchEvent(MotionEvent event, Matrix transformMatrix)
Sends the givenMotionEvent
data to Flutter in a format that Flutter understands.
-
-
-
Constructor Detail
-
AndroidTouchProcessor
public AndroidTouchProcessor(@NonNull FlutterRenderer renderer, boolean trackMotionEvents)
Constructs anAndroidTouchProcessor
that 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 Detail
-
onTouchEvent
public boolean onTouchEvent(@NonNull MotionEvent event)
-
onTouchEvent
public boolean onTouchEvent(@NonNull MotionEvent event, @NonNull Matrix transformMatrix)
Sends the givenMotionEvent
data 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
public boolean onGenericMotionEvent(@NonNull MotionEvent event)
Sends the given genericMotionEvent
data 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.- Returns:
- True if the event was handled.
-
-