Skip to content

Commit 2887339

Browse files
committed
move to new android embedding system
1 parent 317dcf3 commit 2887339

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,33 @@
99
additional functionality it is fine to subclass or reimplement
1010
FlutterApplication and put your custom class here. -->
1111
<application
12-
android:name="io.flutter.app.FlutterApplication"
1312
android:label="flutter_weather"
14-
android:icon="@mipmap/ic_launcher">
13+
android:icon="@mipmap/ic_launcher"
14+
android:usesCleartextTraffic="true">
1515
<activity
1616
android:name=".MainActivity"
1717
android:launchMode="singleTop"
1818
android:theme="@style/LaunchTheme"
1919
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
2020
android:hardwareAccelerated="true"
2121
android:windowSoftInputMode="adjustResize">
22-
<!-- This keeps the window background of the activity showing
23-
until Flutter renders its first frame. It can be removed if
24-
there is no splash screen (such as the default splash screen
25-
defined in @style/LaunchTheme). -->
26-
<meta-data
27-
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
28-
android:value="true" />
2922
<intent-filter>
3023
<action android:name="android.intent.action.MAIN"/>
3124
<category android:name="android.intent.category.LAUNCHER"/>
3225
</intent-filter>
26+
27+
<meta-data
28+
android:name="io.flutter.embedding.android.SplashScreenDrawable"
29+
android:resource="@drawable/launch_background"
30+
/>
31+
32+
<meta-data
33+
android:name="io.flutter.embedding.android.NormalTheme"
34+
android:resource="@style/NormalTheme"
35+
/>
3336
</activity>
37+
<meta-data
38+
android:name="flutterEmbedding"
39+
android:value="2" />
3440
</application>
3541
</manifest>
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
package com.ananthu.flutter_weather;
22

3-
import android.os.Bundle;
4-
import io.flutter.app.FlutterActivity;
5-
import io.flutter.plugins.GeneratedPluginRegistrant;
3+
import io.flutter.embedding.android.FlutterActivity;
64

75
public class MainActivity extends FlutterActivity {
8-
@Override
9-
protected void onCreate(Bundle savedInstanceState) {
10-
super.onCreate(savedInstanceState);
11-
GeneratedPluginRegistrant.registerWith(this);
12-
}
136
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
4-
<!-- Show a splash screen on the activity. Automatically removed when
5-
Flutter draws its first frame -->
4+
<item name="android:windowBackground">@drawable/launch_background</item>
5+
</style>
6+
7+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
68
<item name="android:windowBackground">@drawable/launch_background</item>
79
</style>
810
</resources>

android/settings_aar.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ':app'

0 commit comments

Comments
 (0)