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 {
private BoostLifecycleListener lifecycleListener;
private BoostPluginsRegister boostPluginsRegister;
......@@ -235,15 +234,11 @@ public class FlutterBoost {
}
public ConfigBuilder lifecycleListener(BoostLifecycleListener lifecycleListener) {
this.lifecycleListener = lifecycleListener;
return this;
}
public ConfigBuilder pluginsRegister(BoostPluginsRegister boostPluginsRegister) {
this.boostPluginsRegister = boostPluginsRegister;
return this;
}
public Platform build() {
Platform platform = new Platform() {
......@@ -278,7 +273,6 @@ public class FlutterBoost {
};
platform.lifecycleListener = this.lifecycleListener;
platform.pluginsRegister=this.boostPluginsRegister;
return platform;
}
......
......@@ -60,6 +60,8 @@
android:theme="@style/Theme.AppCompat"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:windowSoftInputMode="adjustResize"/>
<meta-data android:name="flutterEmbedding"
android:value="2">
</meta-data>
</application>
</manifest>
......@@ -30,21 +30,40 @@ public class MyApplication extends Application {
};
FlutterBoost.BoostPluginsRegister pluginsRegister= new FlutterBoost.BoostPluginsRegister(){
FlutterBoost.BoostLifecycleListener boostLifecycleListener= new FlutterBoost.BoostLifecycleListener(){
@Override
public void registerPlugins(PluginRegistry mRegistry) {
GeneratedPluginRegistrant.registerWith(mRegistry);
TextPlatformViewPlugin.register(mRegistry.registrarFor("TextPlatformViewPlugin"));
public void onEngineCreated() {
}
@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
.ConfigBuilder(this,router)
.isDebug(true)
.whenEngineStart(FlutterBoost.ConfigBuilder.ANY_ACTIVITY_CREATED)
.renderMode(FlutterView.RenderMode.texture)
.pluginsRegister(pluginsRegister)
.lifecycleListener(boostLifecycleListener)
.build();
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