Commit d8137e24 authored by yangwu.jia's avatar yangwu.jia

Merge branch 'feature/base_flutter_1.12_upgrade' into...

Merge branch 'feature/base_flutter_1.12_upgrade' into feature/base_flutter_1.12_upgrade_for_androidx
parents 9537ef83 3d304739
...@@ -200,7 +200,6 @@ public class FlutterBoost { ...@@ -200,7 +200,6 @@ public class FlutterBoost {
private BoostLifecycleListener lifecycleListener; private BoostLifecycleListener lifecycleListener;
private BoostPluginsRegister boostPluginsRegister;
...@@ -235,15 +234,11 @@ public class FlutterBoost { ...@@ -235,15 +234,11 @@ public class FlutterBoost {
} }
public ConfigBuilder lifecycleListener(BoostLifecycleListener lifecycleListener) { public ConfigBuilder lifecycleListener(BoostLifecycleListener lifecycleListener) {
this.lifecycleListener = lifecycleListener; this.lifecycleListener = lifecycleListener;
return this; return this;
} }
public ConfigBuilder pluginsRegister(BoostPluginsRegister boostPluginsRegister) {
this.boostPluginsRegister = boostPluginsRegister;
return this;
}
public Platform build() { public Platform build() {
Platform platform = new Platform() { Platform platform = new Platform() {
...@@ -278,7 +273,6 @@ public class FlutterBoost { ...@@ -278,7 +273,6 @@ public class FlutterBoost {
}; };
platform.lifecycleListener = this.lifecycleListener; platform.lifecycleListener = this.lifecycleListener;
platform.pluginsRegister=this.boostPluginsRegister;
return platform; return platform;
} }
......
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
android:theme="@style/Theme.AppCompat" android:theme="@style/Theme.AppCompat"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:windowSoftInputMode="adjustResize"/> android:windowSoftInputMode="adjustResize"/>
<meta-data android:name="flutterEmbedding"
android:value="2">
</meta-data>
</application> </application>
</manifest> </manifest>
...@@ -30,21 +30,40 @@ public class MyApplication extends Application { ...@@ -30,21 +30,40 @@ public class MyApplication extends Application {
}; };
FlutterBoost.BoostPluginsRegister pluginsRegister= new FlutterBoost.BoostPluginsRegister(){ FlutterBoost.BoostLifecycleListener boostLifecycleListener= new FlutterBoost.BoostLifecycleListener(){
@Override @Override
public void registerPlugins(PluginRegistry mRegistry) { public void onEngineCreated() {
GeneratedPluginRegistrant.registerWith(mRegistry);
TextPlatformViewPlugin.register(mRegistry.registrarFor("TextPlatformViewPlugin")); }
@Override
public void onPluginsRegistered() {
} }
@Override
public void onEngineDestroy() {
}
}; };
//
// AndroidManifest.xml 中必须要添加 flutterEmbedding 版本设置
//
// <meta-data android:name="flutterEmbedding"
// android:value="2">
// </meta-data>
// GeneratedPluginRegistrant 会自动生成 新的插件方式 
//
//
Platform platform= new FlutterBoost Platform platform= new FlutterBoost
.ConfigBuilder(this,router) .ConfigBuilder(this,router)
.isDebug(true) .isDebug(true)
.whenEngineStart(FlutterBoost.ConfigBuilder.ANY_ACTIVITY_CREATED) .whenEngineStart(FlutterBoost.ConfigBuilder.ANY_ACTIVITY_CREATED)
.renderMode(FlutterView.RenderMode.texture) .renderMode(FlutterView.RenderMode.texture)
.pluginsRegister(pluginsRegister) .lifecycleListener(boostLifecycleListener)
.build(); .build();
FlutterBoost.instance().init(platform); FlutterBoost.instance().init(platform);
......
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