Commit 03794085 authored by 龚文硕's avatar 龚文硕

新的注册方式在onAttach时执行attachToView

parent ca265ff1
...@@ -606,6 +606,7 @@ public class XFlutterView extends FrameLayout { ...@@ -606,6 +606,7 @@ public class XFlutterView extends FrameLayout {
isFlutterUiDisplayed = flutterRenderer.isDisplayingFlutterUi(); isFlutterUiDisplayed = flutterRenderer.isDisplayingFlutterUi();
renderSurface.attachToRenderer(flutterRenderer); renderSurface.attachToRenderer(flutterRenderer);
flutterRenderer.addIsDisplayingFlutterUiListener(flutterUiDisplayListener); flutterRenderer.addIsDisplayingFlutterUiListener(flutterUiDisplayListener);
this.flutterEngine.getPlatformViewsController().attachToView(this);
...@@ -691,7 +692,7 @@ public class XFlutterView extends FrameLayout { ...@@ -691,7 +692,7 @@ public class XFlutterView extends FrameLayout {
// Disconnect the FlutterEngine's PlatformViewsController from the AccessibilityBridge. // Disconnect the FlutterEngine's PlatformViewsController from the AccessibilityBridge.
flutterEngine.getPlatformViewsController().detachAccessibiltyBridge(); flutterEngine.getPlatformViewsController().detachAccessibiltyBridge();
flutterEngine.getPlatformViewsController().detachFromView();
// Disconnect and clean up the AccessibilityBridge. // Disconnect and clean up the AccessibilityBridge.
accessibilityBridge.release(); accessibilityBridge.release();
accessibilityBridge = null; accessibilityBridge = null;
......
...@@ -182,7 +182,7 @@ public class FlutterSplashView extends FrameLayout { ...@@ -182,7 +182,7 @@ public class FlutterSplashView extends FrameLayout {
public void onAttach() { public void onAttach() {
Debuger.log("BoostFlutterView onAttach"); Debuger.log("BoostFlutterView onAttach");
mFlutterEngine.getPlatformViewsController().attachToView(flutterView);
flutterView.attachToFlutterEngine(mFlutterEngine); flutterView.attachToFlutterEngine(mFlutterEngine);
} }
...@@ -190,7 +190,7 @@ public class FlutterSplashView extends FrameLayout { ...@@ -190,7 +190,7 @@ public class FlutterSplashView extends FrameLayout {
public void onDetach() { public void onDetach() {
Debuger.log("BoostFlutterView onDetach"); Debuger.log("BoostFlutterView onDetach");
mFlutterEngine.getPlatformViewsController().detachFromView();
flutterView.detachFromFlutterEngine(); flutterView.detachFromFlutterEngine();
} }
......
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