Skip to content

Commit 14cb64c

Browse files
authored
Flutter native splash (#288)
Added flutter native splash screen
1 parent 29c7510 commit 14cb64c

File tree

53 files changed

+460
-258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+460
-258
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item>
4+
<bitmap android:gravity="fill" android:src="@drawable/background"/>
5+
</item>
6+
<item>
7+
<bitmap android:gravity="center" android:src="@drawable/splash"/>
8+
</item>
9+
<item android:bottom="24dp">
10+
<bitmap android:gravity="bottom" android:src="@drawable/branding"/>
11+
</item>
12+
</layer-list>
69 Bytes
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- Modify this file to customize your launch splash screen -->
32
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4-
<item android:drawable="@android:color/white" />
5-
6-
<!-- You can insert your own image assets here -->
7-
<!-- <item>
8-
<bitmap
9-
android:gravity="center"
10-
android:src="@mipmap/launch_image" />
11-
</item> -->
3+
<item>
4+
<bitmap android:gravity="fill" android:src="@drawable/background"/>
5+
</item>
6+
<item>
7+
<bitmap android:gravity="center" android:src="@drawable/splash"/>
8+
</item>
9+
<item android:bottom="24dp">
10+
<bitmap android:gravity="bottom" android:src="@drawable/branding"/>
11+
</item>
1212
</layer-list>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5+
<item name="android:forceDarkAllowed">false</item>
6+
<item name="android:windowFullscreen">true</item>
7+
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
8+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
9+
<item name="android:windowSplashScreenBackground">#ffffff</item>
10+
<item name="android:windowSplashScreenBrandingImage">@drawable/android12branding</item>
11+
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
12+
<item name="android:windowSplashScreenIconBackgroundColor">#ffffff</item>
13+
</style>
14+
<!-- Theme applied to the Android Window as soon as the process has started.
15+
This theme determines the color of the Android Window while your
16+
Flutter UI initializes, as well as behind your Flutter UI while its
17+
running.
18+
19+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
20+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
21+
<item name="android:windowBackground">?android:colorBackground</item>
22+
</style>
23+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5+
<!-- Show a splash screen on the activity. Automatically removed when
6+
the Flutter engine draws its first frame -->
7+
<item name="android:windowBackground">@drawable/launch_background</item>
8+
<item name="android:forceDarkAllowed">false</item>
9+
<item name="android:windowFullscreen">true</item>
10+
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
11+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
12+
</style>
13+
<!-- Theme applied to the Android Window as soon as the process has started.
14+
This theme determines the color of the Android Window while your
15+
Flutter UI initializes, as well as behind your Flutter UI while its
16+
running.
17+
18+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
19+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
20+
<item name="android:windowBackground">?android:colorBackground</item>
21+
</style>
22+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
5+
<item name="android:forceDarkAllowed">false</item>
6+
<item name="android:windowFullscreen">true</item>
7+
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
8+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
9+
<item name="android:windowSplashScreenBackground">#ffffff</item>
10+
<item name="android:windowSplashScreenBrandingImage">@drawable/android12branding</item>
11+
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
12+
<item name="android:windowSplashScreenIconBackgroundColor">#ffffff</item>
13+
</style>
14+
<!-- Theme applied to the Android Window as soon as the process has started.
15+
This theme determines the color of the Android Window while your
16+
Flutter UI initializes, as well as behind your Flutter UI while its
17+
running.
18+
19+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
20+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
21+
<item name="android:windowBackground">?android:colorBackground</item>
22+
</style>
23+
</resources>

assets/img/mosquito_alert_splash.png

45.1 KB
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "BrandingImage.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "BrandingImage@2x.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"filename" : "BrandingImage@3x.png",
15+
"idiom" : "universal",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"author" : "xcode",
21+
"version" : 1
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "background.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
22
"images" : [
33
{
4-
"idiom" : "universal",
54
"filename" : "LaunchImage.png",
5+
"idiom" : "universal",
66
"scale" : "1x"
77
},
88
{
9-
"idiom" : "universal",
109
"filename" : "LaunchImage@2x.png",
10+
"idiom" : "universal",
1111
"scale" : "2x"
1212
},
1313
{
14-
"idiom" : "universal",
1514
"filename" : "LaunchImage@3x.png",
15+
"idiom" : "universal",
1616
"scale" : "3x"
1717
}
1818
],
1919
"info" : {
20-
"version" : 1,
21-
"author" : "xcode"
20+
"author" : "xcode",
21+
"version" : 1
2222
}
2323
}

ios/Runner/Base.lproj/LaunchScreen.storyboard

+16-5
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,22 @@
1616
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
1717
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1818
<subviews>
19-
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
20-
</imageView>
19+
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="LaunchBackground" translatesAutoresizingMaskIntoConstraints="NO" id="tWc-Dq-wcI"/>
20+
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"></imageView>
21+
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" image="BrandingImage" translatesAutoresizingMaskIntoConstraints="NO" id="Uyq-Kz-ftE"/>
2122
</subviews>
2223
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2324
<constraints>
24-
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
25-
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
25+
<constraint firstAttribute="bottom" secondItem="Uyq-Kz-ftE" secondAttribute="bottom" constant="24" id="8Yb-q4-8bl"/>
26+
<constraint firstItem="Uyq-Kz-ftE" firstAttribute="centerX" secondItem="YRO-k0-Ey4" secondAttribute="centerX" id="3kg-TC-cPP"/>
27+
<constraint firstItem="YRO-k0-Ey4" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="3T2-ad-Qdv"/>
28+
<constraint firstItem="tWc-Dq-wcI" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="RPx-PI-7Xg"/>
29+
<constraint firstItem="tWc-Dq-wcI" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="SdS-ul-q2q"/>
30+
<constraint firstAttribute="trailing" secondItem="tWc-Dq-wcI" secondAttribute="trailing" id="Swv-Gf-Rwn"/>
31+
<constraint firstAttribute="trailing" secondItem="YRO-k0-Ey4" secondAttribute="trailing" id="TQA-XW-tRk"/>
32+
<constraint firstItem="YRO-k0-Ey4" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="duK-uY-Gun"/>
33+
<constraint firstItem="tWc-Dq-wcI" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="kV7-tw-vXt"/>
34+
<constraint firstItem="YRO-k0-Ey4" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="xPn-NY-SIU"/>
2635
</constraints>
2736
</view>
2837
</viewController>
@@ -32,6 +41,8 @@
3241
</scene>
3342
</scenes>
3443
<resources>
35-
<image name="LaunchImage" width="168" height="185"/>
44+
<image name="LaunchImage" width="960" height="960"/>
45+
<image name="LaunchBackground" width="1" height="1"/>
46+
<image name="BrandingImage" width="1" height="1"/>
3647
</resources>
3748
</document>

0 commit comments

Comments
 (0)