Skip to content

Commit 1571d57

Browse files
optimised splashscreen on both ios and android (CCExtractor#236)
1 parent bf70c1d commit 1571d57

Some content is hidden

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

52 files changed

+515
-363
lines changed
Loading
Loading
Loading
Loading
Loading
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
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
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
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:colorBackground" />
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>
129
</layer-list>
Loading
Loading
Loading
69 Bytes
Loading
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
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>
129
</layer-list>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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.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+
</style>
10+
<!-- Theme applied to the Android Window as soon as the process has started.
11+
This theme determines the color of the Android Window while your
12+
Flutter UI initializes, as well as behind your Flutter UI while its
13+
running.
14+
15+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
16+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
17+
<item name="android:windowBackground">?android:colorBackground</item>
18+
</style>
19+
</resources>

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

+4
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
</style>
10+
<!-- Theme applied to the Android Window as soon as the process has started.
11+
This theme determines the color of the Android Window while your
12+
Flutter UI initializes, as well as behind your Flutter UI while its
13+
running.
14+
15+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
16+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
17+
<item name="android:windowBackground">?android:colorBackground</item>
18+
</style>
19+
</resources>

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

+4
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

assets/images/splashscreen.png

167 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "background.png",
5+
"idiom" : "universal"
6+
},
7+
{
8+
"appearances" : [
9+
{
10+
"appearance" : "luminosity",
11+
"value" : "dark"
12+
}
13+
],
14+
"filename" : "darkbackground.png",
15+
"idiom" : "universal"
16+
}
17+
],
18+
"info" : {
19+
"author" : "xcode",
20+
"version" : 1
21+
}
22+
}
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,56 @@
11
{
22
"images" : [
33
{
4-
"idiom" : "universal",
54
"filename" : "LaunchImage.png",
5+
"idiom" : "universal",
66
"scale" : "1x"
77
},
88
{
9+
"appearances" : [
10+
{
11+
"appearance" : "luminosity",
12+
"value" : "dark"
13+
}
14+
],
15+
"filename" : "LaunchImageDark.png",
916
"idiom" : "universal",
17+
"scale" : "1x"
18+
},
19+
{
1020
"filename" : "LaunchImage@2x.png",
21+
"idiom" : "universal",
1122
"scale" : "2x"
1223
},
1324
{
25+
"appearances" : [
26+
{
27+
"appearance" : "luminosity",
28+
"value" : "dark"
29+
}
30+
],
31+
"filename" : "LaunchImageDark@2x.png",
1432
"idiom" : "universal",
33+
"scale" : "2x"
34+
},
35+
{
1536
"filename" : "LaunchImage@3x.png",
37+
"idiom" : "universal",
38+
"scale" : "3x"
39+
},
40+
{
41+
"appearances" : [
42+
{
43+
"appearance" : "luminosity",
44+
"value" : "dark"
45+
}
46+
],
47+
"filename" : "LaunchImageDark@3x.png",
48+
"idiom" : "universal",
1649
"scale" : "3x"
1750
}
1851
],
1952
"info" : {
20-
"version" : 1,
21-
"author" : "xcode"
53+
"author" : "xcode",
54+
"version" : 1
2255
}
2356
}
Loading
Loading
Loading
Loading
Loading
Loading

ios/Runner/Base.lproj/LaunchScreen.storyboard

+12-5
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@
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>
2121
</subviews>
2222
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2323
<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"/>
24+
<constraint firstItem="YRO-k0-Ey4" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="3T2-ad-Qdv"/>
25+
<constraint firstItem="tWc-Dq-wcI" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="RPx-PI-7Xg"/>
26+
<constraint firstItem="tWc-Dq-wcI" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="SdS-ul-q2q"/>
27+
<constraint firstAttribute="trailing" secondItem="tWc-Dq-wcI" secondAttribute="trailing" id="Swv-Gf-Rwn"/>
28+
<constraint firstAttribute="trailing" secondItem="YRO-k0-Ey4" secondAttribute="trailing" id="TQA-XW-tRk"/>
29+
<constraint firstItem="YRO-k0-Ey4" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="duK-uY-Gun"/>
30+
<constraint firstItem="tWc-Dq-wcI" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="kV7-tw-vXt"/>
31+
<constraint firstItem="YRO-k0-Ey4" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="xPn-NY-SIU"/>
2632
</constraints>
2733
</view>
2834
</viewController>
@@ -32,6 +38,7 @@
3238
</scene>
3339
</scenes>
3440
<resources>
35-
<image name="LaunchImage" width="168" height="185"/>
41+
<image name="LaunchImage" width="1152" height="1152"/>
42+
<image name="LaunchBackground" width="1" height="1"/>
3643
</resources>
3744
</document>

ios/Runner/Info.plist

+53-51
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,57 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>NSCameraUsageDescription</key>
6-
<string>This app needs camera access to scan QR codes</string>
7-
<key>NSPhotoLibraryUsageDescription</key>
8-
<string>This app needs photos access to get QR code from photo library</string>
9-
<key>CFBundleDevelopmentRegion</key>
10-
<string>$(DEVELOPMENT_LANGUAGE)</string>
11-
<key>CFBundleDisplayName</key>
12-
<string>Ultimate Alarm Clock</string>
13-
<key>CFBundleExecutable</key>
14-
<string>$(EXECUTABLE_NAME)</string>
15-
<key>CFBundleIdentifier</key>
16-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
17-
<key>CFBundleInfoDictionaryVersion</key>
18-
<string>6.0</string>
19-
<key>CFBundleName</key>
20-
<string>Ultimate Alarm Clock</string>
21-
<key>CFBundlePackageType</key>
22-
<string>APPL</string>
23-
<key>CFBundleShortVersionString</key>
24-
<string>$(FLUTTER_BUILD_NAME)</string>
25-
<key>CFBundleSignature</key>
26-
<string>????</string>
27-
<key>CFBundleVersion</key>
28-
<string>$(FLUTTER_BUILD_NUMBER)</string>
29-
<key>LSRequiresIPhoneOS</key>
30-
<true/>
31-
<key>UILaunchStoryboardName</key>
32-
<string>LaunchScreen</string>
33-
<key>UIMainStoryboardFile</key>
34-
<string>Main</string>
35-
<key>UISupportedInterfaceOrientations</key>
36-
<array>
37-
<string>UIInterfaceOrientationPortrait</string>
38-
<string>UIInterfaceOrientationLandscapeLeft</string>
39-
<string>UIInterfaceOrientationLandscapeRight</string>
40-
</array>
41-
<key>UISupportedInterfaceOrientations~ipad</key>
42-
<array>
43-
<string>UIInterfaceOrientationPortrait</string>
44-
<string>UIInterfaceOrientationPortraitUpsideDown</string>
45-
<string>UIInterfaceOrientationLandscapeLeft</string>
46-
<string>UIInterfaceOrientationLandscapeRight</string>
47-
</array>
48-
<key>UIViewControllerBasedStatusBarAppearance</key>
49-
<false/>
50-
<key>CADisableMinimumFrameDurationOnPhone</key>
51-
<true/>
52-
<key>UIApplicationSupportsIndirectInputEvents</key>
53-
<true/>
54-
</dict>
4+
<dict>
5+
<key>NSCameraUsageDescription</key>
6+
<string>This app needs camera access to scan QR codes</string>
7+
<key>NSPhotoLibraryUsageDescription</key>
8+
<string>This app needs photos access to get QR code from photo library</string>
9+
<key>CFBundleDevelopmentRegion</key>
10+
<string>$(DEVELOPMENT_LANGUAGE)</string>
11+
<key>CFBundleDisplayName</key>
12+
<string>Ultimate Alarm Clock</string>
13+
<key>CFBundleExecutable</key>
14+
<string>$(EXECUTABLE_NAME)</string>
15+
<key>CFBundleIdentifier</key>
16+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
17+
<key>CFBundleInfoDictionaryVersion</key>
18+
<string>6.0</string>
19+
<key>CFBundleName</key>
20+
<string>Ultimate Alarm Clock</string>
21+
<key>CFBundlePackageType</key>
22+
<string>APPL</string>
23+
<key>CFBundleShortVersionString</key>
24+
<string>$(FLUTTER_BUILD_NAME)</string>
25+
<key>CFBundleSignature</key>
26+
<string>????</string>
27+
<key>CFBundleVersion</key>
28+
<string>$(FLUTTER_BUILD_NUMBER)</string>
29+
<key>LSRequiresIPhoneOS</key>
30+
<true/>
31+
<key>UILaunchStoryboardName</key>
32+
<string>LaunchScreen</string>
33+
<key>UIMainStoryboardFile</key>
34+
<string>Main</string>
35+
<key>UISupportedInterfaceOrientations</key>
36+
<array>
37+
<string>UIInterfaceOrientationPortrait</string>
38+
<string>UIInterfaceOrientationLandscapeLeft</string>
39+
<string>UIInterfaceOrientationLandscapeRight</string>
40+
</array>
41+
<key>UISupportedInterfaceOrientations~ipad</key>
42+
<array>
43+
<string>UIInterfaceOrientationPortrait</string>
44+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
45+
<string>UIInterfaceOrientationLandscapeLeft</string>
46+
<string>UIInterfaceOrientationLandscapeRight</string>
47+
</array>
48+
<key>UIViewControllerBasedStatusBarAppearance</key>
49+
<false/>
50+
<key>CADisableMinimumFrameDurationOnPhone</key>
51+
<true/>
52+
<key>UIApplicationSupportsIndirectInputEvents</key>
53+
<true/>
54+
<key>UIStatusBarHidden</key>
55+
<false/>
56+
</dict>
5557
</plist>

lib/app/modules/splashScreen/controllers/splash_screen_controller.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class SplashScreenController extends GetxController {
144144
}
145145
});
146146
// Necessary when hot restarting
147-
Future.delayed(const Duration(seconds: 2), () {
147+
Future.delayed(const Duration(seconds: 0), () {
148148
if (shouldNavigate == true) {
149149
Get.offNamed('/home');
150150
}

lib/app/modules/splashScreen/views/splash_screen_view.dart

+1-19
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,11 @@ class SplashScreenView extends GetView<SplashScreenController> {
99
@override
1010
Widget build(BuildContext context) {
1111
var width = Get.width;
12-
return Scaffold(
12+
return const Scaffold(
1313
body: SafeArea(
1414
child: Center(
1515
child: Column(
1616
mainAxisAlignment: MainAxisAlignment.center,
17-
children: [
18-
Padding(
19-
padding: const EdgeInsets.fromLTRB(20, 10, 0, 10),
20-
child: Image.asset(
21-
'assets/images/ic_launcher-playstore-nobg.png',
22-
fit: BoxFit.cover,
23-
width: width / 2,
24-
height: width / 2,
25-
),
26-
),
27-
Text(
28-
'Ultimate Alarm Clock',
29-
style: Theme.of(context)
30-
.textTheme
31-
.displayMedium!
32-
.copyWith(color: kprimaryColor),
33-
),
34-
],
3517
),
3618
),
3719
),

0 commit comments

Comments
 (0)