Unverified Commit c863c018 authored by Jia Hao's avatar Jia Hao Committed by GitHub

Use FLUTTER_VIEW_ID to find the Flutter view (#87324)

parent a69b3ca5
...@@ -10,7 +10,6 @@ import android.os.Build; ...@@ -10,7 +10,6 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import java.util.HashMap; import java.util.HashMap;
...@@ -32,9 +31,7 @@ public class MainActivity extends FlutterActivity implements MethodChannel.Metho ...@@ -32,9 +31,7 @@ public class MainActivity extends FlutterActivity implements MethodChannel.Metho
private MethodChannel.Result permissionResult; private MethodChannel.Result permissionResult;
private View getFlutterView() { private View getFlutterView() {
// TODO(egarciad): Set an unique ID in FlutterView, so it's easier to look it up. return findViewById(FLUTTER_VIEW_ID);
ViewGroup root = (ViewGroup)findViewById(android.R.id.content);
return ((ViewGroup)root.getChildAt(0)).getChildAt(0);
} }
@Override @Override
......
...@@ -36,9 +36,7 @@ public class MainActivity extends FlutterActivity implements MethodChannel.Metho ...@@ -36,9 +36,7 @@ public class MainActivity extends FlutterActivity implements MethodChannel.Metho
private MethodChannel.Result permissionResult; private MethodChannel.Result permissionResult;
private View getFlutterView() { private View getFlutterView() {
// TODO(egarciad): Set an unique ID in FlutterView, so it's easier to look it up. return findViewById(FLUTTER_VIEW_ID);
ViewGroup root = (ViewGroup)findViewById(android.R.id.content);
return ((ViewGroup)root.getChildAt(0)).getChildAt(0);
} }
private String getViewName(View view) { private String getViewName(View view) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment