Skip to content

Commit 4ee22ed

Browse files
author
Emmanuel Garcia
authored
Roll Engine from 4463cf40fed9 to 5f0271a38988 + Fix test (#98479)
1 parent a1a305c commit 4ee22ed

4 files changed

Lines changed: 9 additions & 22 deletions

File tree

bin/internal/engine.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4463cf40fed98686c1b0020d537f4b80b25b4281
1+
5f0271a38988732c48f55c1244717430816391d3

dev/integration_tests/android_views/android/app/src/main/java/io/flutter/integration/androidviews/MainActivity.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public class MainActivity extends FlutterActivity implements MethodChannel.Metho
2424
final static int STORAGE_PERMISSION_CODE = 1;
2525

2626
MethodChannel mMethodChannel;
27-
TouchPipe mFlutterViewTouchPipe;
2827

2928
// The method result to complete with the Android permission request result.
3029
// This is null when not waiting for the Android permission request;
@@ -34,12 +33,6 @@ private View getFlutterView() {
3433
return findViewById(FLUTTER_VIEW_ID);
3534
}
3635

37-
@Override
38-
protected void onCreate(Bundle savedInstanceState) {
39-
super.onCreate(savedInstanceState);
40-
mFlutterViewTouchPipe = new TouchPipe(mMethodChannel, getFlutterView());
41-
}
42-
4336
@Override
4437
public void configureFlutterEngine(FlutterEngine flutterEngine) {
4538
DartExecutor executor = flutterEngine.getDartExecutor();
@@ -56,11 +49,9 @@ public void configureFlutterEngine(FlutterEngine flutterEngine) {
5649
public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
5750
switch(methodCall.method) {
5851
case "pipeFlutterViewEvents":
59-
mFlutterViewTouchPipe.enable();
6052
result.success(null);
6153
return;
6254
case "stopFlutterViewEvents":
63-
mFlutterViewTouchPipe.disable();
6455
result.success(null);
6556
return;
6657
case "getStoragePermission":
@@ -82,6 +73,8 @@ public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
8273
public void synthesizeEvent(MethodCall methodCall, MethodChannel.Result result) {
8374
MotionEvent event = MotionEventCodec.decode((HashMap<String, Object>) methodCall.arguments());
8475
getFlutterView().dispatchTouchEvent(event);
76+
// TODO(egarciad): Remove invokeMethod since it is not necessary.
77+
mMethodChannel.invokeMethod("onTouch", MotionEventCodec.encode(event));
8578
result.success(null);
8679
}
8780

dev/integration_tests/android_views/android/app/src/main/java/io/flutter/integration/androidviews/SimplePlatformView.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,29 @@
1313
import android.view.View;
1414
import android.view.WindowManager;
1515
import android.widget.Button;
16+
import android.widget.FrameLayout;
1617
import android.widget.TextView;
1718

1819
import io.flutter.plugin.common.MethodCall;
1920
import io.flutter.plugin.common.MethodChannel;
2021
import io.flutter.plugin.platform.PlatformView;
2122

2223
public class SimplePlatformView implements PlatformView, MethodChannel.MethodCallHandler {
23-
private final TextView view;
24+
private final FrameLayout view;
2425
private final MethodChannel methodChannel;
25-
private final io.flutter.integration.platformviews.TouchPipe touchPipe;
26+
private final TouchPipe touchPipe;
2627

2728
SimplePlatformView(Context context, MethodChannel methodChannel) {
2829
this.methodChannel = methodChannel;
29-
view = new TextView(context) {
30+
view = new FrameLayout(context) {
3031
@Override
3132
public boolean onTouchEvent(MotionEvent event) {
3233
return true;
3334
}
3435
};
35-
view.setTextSize(72);
3636
view.setBackgroundColor(0xff0000ff);
37-
view.setText("Hello from Android view");
3837
this.methodChannel.setMethodCallHandler(this);
39-
touchPipe = new io.flutter.integration.platformviews.TouchPipe(this.methodChannel, view);
38+
touchPipe = new TouchPipe(this.methodChannel, view);
4039
}
4140

4241
@Override

dev/integration_tests/hybrid_android_views/android/app/src/main/java/io/flutter/integration/androidviews/MainActivity.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ private String getSerializedViewHierarchy() {
9696
return builder.toString();
9797
}
9898

99-
@Override
100-
protected void onCreate(Bundle savedInstanceState) {
101-
super.onCreate(savedInstanceState);
102-
}
103-
10499
@Override
105100
public void configureFlutterEngine(FlutterEngine flutterEngine) {
106101
DartExecutor executor = flutterEngine.getDartExecutor();
@@ -140,7 +135,7 @@ public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
140135
public void synthesizeEvent(MethodCall methodCall) {
141136
MotionEvent event = MotionEventCodec.decode((HashMap<String, Object>) methodCall.arguments());
142137
getFlutterView().dispatchTouchEvent(event);
143-
// TODO(egarciad): This can be cleaned up.
138+
// TODO(egarciad): Remove invokeMethod since it is not necessary.
144139
mMethodChannel.invokeMethod("onTouch", MotionEventCodec.encode(event));
145140
}
146141

0 commit comments

Comments
 (0)