Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 262fce5

Browse files
committed
Add back the necessary changes for Android
1 parent 7b880a8 commit 262fce5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ public class AndroidTouchProcessor {
2121
PointerChange.HOVER,
2222
PointerChange.DOWN,
2323
PointerChange.MOVE,
24-
PointerChange.UP
24+
PointerChange.UP,
25+
PointerChange.PAN_ZOOM_START,
26+
PointerChange.PAN_ZOOM_UPDATE,
27+
PointerChange.PAN_ZOOM_END
2528
})
2629
private @interface PointerChange {
2730
int CANCEL = 0;
@@ -31,6 +34,9 @@ public class AndroidTouchProcessor {
3134
int DOWN = 4;
3235
int MOVE = 5;
3336
int UP = 6;
37+
int PAN_ZOOM_START = 7;
38+
int PAN_ZOOM_UPDATE = 8;
39+
int PAN_ZOOM_END = 9;
3440
}
3541

3642
// Must match the PointerDeviceKind enum in pointer.dart.
@@ -58,7 +64,7 @@ public class AndroidTouchProcessor {
5864
}
5965

6066
// Must match the unpacking code in hooks.dart.
61-
private static final int POINTER_DATA_FIELD_COUNT = 29;
67+
private static final int POINTER_DATA_FIELD_COUNT = 35;
6268
private static final int BYTES_PER_FIELD = 8;
6369

6470
// This value must match the value in framework's platform_view.dart.
@@ -308,6 +314,13 @@ private void addPointerForIndex(
308314
packet.putDouble(0.0); // scroll_delta_x
309315
packet.putDouble(0.0); // scroll_delta_x
310316
}
317+
318+
packet.putDouble(0.0); // pan_x
319+
packet.putDouble(0.0); // pan_y
320+
packet.putDouble(0.0); // pan_delta_x
321+
packet.putDouble(0.0); // pan_delta_y
322+
packet.putDouble(1.0); // scale
323+
packet.putDouble(0.0); // rotation
311324
}
312325

313326
@PointerChange

0 commit comments

Comments
 (0)