Skip to content

Commit 06b7e0a

Browse files
authored
Merge pull request #371 from Eldar2021/el/fix-splash-screen
Fixed splash screen
2 parents 6d95965 + 8044642 commit 06b7e0a

File tree

49 files changed

+581
-431
lines changed

Some content is hidden

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

49 files changed

+581
-431
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
</layer-list>
Loading
Loading
Loading
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
</layer-list>
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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">false</item>
7+
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
8+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
9+
<item name="android:windowSplashScreenBackground">#1B2B34</item>
10+
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
11+
</style>
12+
<!-- Theme applied to the Android Window as soon as the process has started.
13+
This theme determines the color of the Android Window while your
14+
Flutter UI initializes, as well as behind your Flutter UI while its
15+
running.
16+
17+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
18+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
19+
<item name="android:windowBackground">?android:colorBackground</item>
20+
</style>
21+
</resources>

app/android/app/src/main/res/values-night/styles.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<!-- Show a splash screen on the activity. Automatically removed when
66
the Flutter engine draws its first frame -->
77
<item name="android:windowBackground">@drawable/launch_background</item>
8+
<item name="android:forceDarkAllowed">false</item>
9+
<item name="android:windowFullscreen">false</item>
10+
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
11+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
812
</style>
913
<!-- Theme applied to the Android Window as soon as the process has started.
1014
This theme determines the color of the Android Window while your
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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">false</item>
7+
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
8+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
9+
<item name="android:windowSplashScreenBackground">#EAE3D2</item>
10+
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
11+
</style>
12+
<!-- Theme applied to the Android Window as soon as the process has started.
13+
This theme determines the color of the Android Window while your
14+
Flutter UI initializes, as well as behind your Flutter UI while its
15+
running.
16+
17+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
18+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
19+
<item name="android:windowBackground">?android:colorBackground</item>
20+
</style>
21+
</resources>

app/android/app/src/main/res/values/styles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<item name="android:windowBackground">@drawable/launch_background</item>
88
<item name="android:forceDarkAllowed">false</item>
99
<item name="android:windowFullscreen">false</item>
10+
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
1011
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
1112
</style>
1213
<!-- Theme applied to the Android Window as soon as the process has started.

app/assets/app_splash_1152.png

142 KB
Loading

app/assets/app_splash_512.png

113 KB
Loading

app/flutter_native_splash.yaml

Lines changed: 59 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
1-
# flutter_native_splash:
1+
flutter_native_splash:
22
# This package generates native code to customize Flutter's default white native splash screen
33
# with background color and splash image.
44
# Customize the parameters below, and run the following command in the terminal:
5-
# flutter pub run flutter_native_splash:create
5+
# dart run flutter_native_splash:create
66
# To restore Flutter's default white splash screen, run the following command in the terminal:
7-
# flutter pub run flutter_native_splash:remove
7+
# dart run flutter_native_splash:remove
8+
9+
# IMPORTANT NOTE: These parameter do not affect the configuration of Android 12 and later, which
10+
# handle splash screens differently that prior versions of Android. Android 12 and later must be
11+
# configured specifically in the android_12 section below.
812

913
# color or background_image is the only required parameter. Use color to set the background
1014
# of your splash screen to a solid color. Use background_image to set the background of your
1115
# splash screen to a png image. This is useful for gradients. The image will be stretch to the
1216
# size of the app. Only one parameter can be used, color and background_image cannot both be set.
13-
# color: "#42a5f5"
14-
# background_image: "assets/background.png"
17+
color: "#EAE3D2"
18+
#background_image: "assets/background.png"
1519

1620
# Optional parameters are listed below. To enable a parameter, uncomment the line by removing
1721
# the leading # character.
1822

1923
# The image parameter allows you to specify an image used in the splash screen. It must be a
2024
# png file and should be sized for 4x pixel density.
21-
# image: assets/images/splash.png
25+
image: assets/app_splash_512.png
2226

2327
# The branding property allows you to specify an image used as branding in the splash screen.
2428
# It must be a png file. It is supported for Android, iOS and the Web. For Android 12,
@@ -29,49 +33,54 @@
2933
# and bottomLeft. The default values is bottom if not specified or specified something else.
3034
#branding_mode: bottom
3135

36+
# Set the branding padding from the bottom of the screen. The default value is 0
37+
# branding_bottom_padding: 24
38+
3239
# The color_dark, background_image_dark, image_dark, branding_dark are parameters that set the background
3340
# and image when the device is in dark mode. If they are not specified, the app will use the
34-
# parameters from above. If the image_dark parameter is specified, color_dark or
35-
# background_image_dark must be specified. color_dark and background_image_dark cannot both be
36-
# set.
37-
# color_dark: "#ffffff"
41+
# parameters from above. If there is no parameter above, the app will use the light mode values.
42+
# If the image_dark parameter is specified, color_dark or background_image_dark must be specified.
43+
# color_dark and background_image_dark cannot both be set.
44+
color_dark: "#1B2B34"
3845
#background_image_dark: "assets/dark-background.png"
3946
#image_dark: assets/splash-invert.png
4047
#branding_dark: assets/dart_dark.png
4148

42-
# Android 12 handles the splash screen differently than previous versions. Please visit
43-
# https://developer.android.com/guide/topics/ui/splash-screen
44-
# Following are Android 12 specific parameter.
45-
# android_12:
46-
# The image parameter sets the splash screen icon image. If this parameter is not specified,
47-
# the app's launcher icon will be used instead.
48-
# Please note that the splash screen will be clipped to a circle on the center of the screen.
49-
# App icon with an icon background: This should be 960×960 pixels, and fit within a circle
50-
# 640 pixels in diameter.
51-
# App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
52-
# 768 pixels in diameter.
53-
# image: assets/images/splash.png
54-
55-
# Splash screen background color.
56-
#color: "#42a5f5"
57-
58-
# App icon background color.
59-
#icon_background_color: "#111111"
60-
61-
# The branding property allows you to specify an image used as branding in the splash screen.
62-
#branding: assets/dart.png
63-
64-
# The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that
65-
# apply when the device is in dark mode. If they are not specified, the app will use the
66-
# parameters from above.
67-
# image_dark: assets/images/splash.png
68-
# color_dark: "#ffffff"
69-
# icon_background_color_dark: "#ffffff"
49+
# From Android 12 onwards, the splash screen is handled differently than in previous versions.
50+
# Please visit https://developer.android.com/guide/topics/ui/splash-screen
51+
# Following are specific parameters for Android 12+.
52+
android_12:
53+
# The image parameter sets the splash screen icon image. If this parameter is not specified,
54+
# the app's launcher icon will be used instead.
55+
# Please note that the splash screen will be clipped to a circle on the center of the screen.
56+
# App icon with an icon background: This should be 960×960 pixels, and fit within a circle
57+
# 640 pixels in diameter.
58+
# App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
59+
# 768 pixels in diameter. To fit a 1152x1152 image within a circle with a 768 diameter, simply
60+
# ensure that the most important design elements of your image are placed within a circular area
61+
# with a 768 diameter at the center of the 1152x1152 canvas.
62+
image: assets/app_splash_1152.png
63+
64+
# Splash screen background color.
65+
color: "#EAE3D2"
66+
67+
# App icon background color.
68+
#icon_background_color: "#111111"
69+
70+
# The branding property allows you to specify an image used as branding in the splash screen.
71+
#branding: assets/dart.png
72+
73+
# The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that
74+
# apply when the device is in dark mode. If they are not specified, the app will use the
75+
# parameters from above. If there is no parameter above, the app will use the light mode values.
76+
#image_dark: assets/android12splash-invert.png
77+
color_dark: "#1B2B34"
78+
#icon_background_color_dark: "#eeeeee"
7079

7180
# The android, ios and web parameters can be used to disable generating a splash screen on a given
7281
# platform.
73-
# android: true
74-
# ios: true
82+
android: true
83+
ios: true
7584
#web: false
7685

7786
# Platform specific images can be specified with the following parameters, which will override
@@ -86,18 +95,22 @@
8695
#image_dark_android: assets/splash-invert-android.png
8796
#image_ios: assets/splash-ios.png
8897
#image_dark_ios: assets/splash-invert-ios.png
89-
#image_web: assets/splash-web.png
90-
#image_dark_web: assets/splash-invert-web.png
98+
#image_web: assets/splash-web.gif
99+
#image_dark_web: assets/splash-invert-web.gif
91100
#background_image_android: "assets/background-android.png"
92101
#background_image_dark_android: "assets/dark-background-android.png"
93102
#background_image_ios: "assets/background-ios.png"
94103
#background_image_dark_ios: "assets/dark-background-ios.png"
95104
#background_image_web: "assets/background-web.png"
96105
#background_image_dark_web: "assets/dark-background-web.png"
97106
#branding_android: assets/brand-android.png
107+
#branding_bottom_padding_android: 24
98108
#branding_dark_android: assets/dart_dark-android.png
99109
#branding_ios: assets/brand-ios.png
110+
#branding_bottom_padding_ios: 24
100111
#branding_dark_ios: assets/dart_dark-ios.png
112+
#branding_web: assets/brand-web.gif
113+
#branding_dark_web: assets/dart_dark-web.gif
101114

102115
# The position of the splash image can be set with android_gravity, ios_content_mode, and
103116
# web_image_mode parameters. All default to center.
@@ -112,7 +125,7 @@
112125
# https://developer.apple.com/documentation/uikit/uiview/contentmode): scaleToFill,
113126
# scaleAspectFit, scaleAspectFill, center, top, bottom, left, right, topLeft, topRight,
114127
# bottomLeft, or bottomRight.
115-
# ios_content_mode: center
128+
#ios_content_mode: center
116129
#
117130
# web_image_mode can be one of the following modes: center, contain, stretch, and cover.
118131
#web_image_mode: center
@@ -127,8 +140,8 @@
127140
# NOTE: Unlike Android, iOS will not automatically show the notification bar when the app loads.
128141
# To show the notification bar, add the following code to your Flutter app:
129142
# WidgetsFlutterBinding.ensureInitialized();
130-
# SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]);
131-
# fullscreen: true
143+
# SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top], );
144+
#fullscreen: true
132145

133146
# If you have changed the name(s) of your info.plist file(s), you can specify the filename(s)
134147
# with the info_plist_files parameter. Remove only the # characters in the three lines below,
@@ -137,9 +150,4 @@
137150
# - 'ios/Runner/Info-Debug.plist'
138151
# - 'ios/Runner/Info-Release.plist'
139152

140-
flutter_native_splash:
141-
color: "#ffffff"
142-
image: assets/images/splash.png
143-
android: true
144-
ios: true
145-
# flutter pub run flutter_native_splash:create
153+
# flutter pub run flutter_native_splash:create

0 commit comments

Comments
 (0)