Improve splash screen

This commit is contained in:
stonegate 2020-05-12 09:54:17 +08:00
parent a1a4604f6e
commit a62eda51c9
10 changed files with 39 additions and 36 deletions

View File

@ -82,4 +82,7 @@ dependencies {
testImplementation 'junit:junit:4.13' testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
def appcompat_version = "1.1.0"
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.appcompat:appcompat-resources:$appcompat_version"
} }

View File

@ -11,7 +11,7 @@
<application android:name="io.flutter.app.FlutterApplication" android:label="Tsacdop" android:icon="@mipmap/ic_launcher_icon" android:roundIcon="@mipmap/ic_launcher_round" android:networkSecurityConfig="@xml/network_security_config"> <application android:name="io.flutter.app.FlutterApplication" android:label="Tsacdop" android:icon="@mipmap/ic_launcher_icon" android:roundIcon="@mipmap/ic_launcher_round" android:networkSecurityConfig="@xml/network_security_config">
<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/LaunchTheme" /> <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/LaunchTheme" />
<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background" /> <meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/normal_background" />
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/blackGrey" />
<!-- You can insert your own image assets here -->
<item android:bottom="100dp">
<bitmap android:gravity="bottom" android:src="@mipmap/text_light" />
</item>-->
</layer-list>

View File

@ -4,16 +4,9 @@
<item android:drawable="@android:color/white" /> <item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here --> <!-- You can insert your own image assets here -->
<item> <item>
<bitmap <bitmap android:gravity="center" android:tileMode="disabled" android:src="@mipmap/ic_splash" />
android:gravity="center" </item>
android:tileMode="disabled" <item android:bottom="100dp">
android:src="@mipmap/ic_splash" /> <bitmap android:gravity="bottom" android:src="@mipmap/text" />
</item>
<item android:bottom="100dp">
<bitmap
android:gravity="bottom"
android:src="@mipmap/text" />
</item> </item>
<!-- <item name="android:navigationBarColor">@android:color/white</item>
<item name="android:windowLightNavigationBar">true</item> -->
</layer-list> </layer-list>

View File

@ -4,14 +4,9 @@
<item android:drawable="@color/blackGrey" /> <item android:drawable="@color/blackGrey" />
<!-- You can insert your own image assets here --> <!-- You can insert your own image assets here -->
<item> <item>
<bitmap <bitmap android:gravity="center" android:tileMode="disabled" android:src="@mipmap/ic_splash" />
android:gravity="center" </item>
android:tileMode="disabled"
android:src="@mipmap/ic_splash" />
</item>
<item android:bottom="100dp"> <item android:bottom="100dp">
<bitmap <bitmap android:gravity="bottom" android:src="@mipmap/text_light" />
android:gravity="bottom"
android:src="@mipmap/text_light" />
</item> </item>
</layer-list> </layer-list>

View File

@ -4,8 +4,6 @@
<item android:drawable="@android:color/white" /> <item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here --> <!-- You can insert your own image assets here -->
<item android:bottom="100dp"> <item android:bottom="100dp">
<bitmap <bitmap android:gravity="bottom" android:src="@mipmap/text_light" />
android:gravity="bottom"
android:src="@mipmap/text_light" />
</item> </item>
</layer-list> </layer-list>

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> <style name="LaunchTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/launch_background_night</item> <item name="android:windowBackground">@drawable/launch_background_night</item>
</style> <item name="android:navigationBarColor">@color/blackGrey</item>
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> <item name="android:statusBarColor">@color/blackGrey</item>
<item name="android:windowBackground">@drawable/normal_background_night</item> <item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar">true</item>
</style> </style>
</resources> </resources>

View File

@ -2,6 +2,9 @@
<resources> <resources>
<color name = "blackGrey"> <color name = "blackGrey">
#121212 #121212
</color>
<color name = "white">
#ffffff
</color> </color>
<color name="ic_launcher_background"> <color name="ic_launcher_background">
#ffffff #ffffff

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar"> <style name="LaunchTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Show a splash screen on the activity. Automatically removed when <!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame --> Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item> <item name="android:windowBackground">@drawable/launch_background</item>
</style> <item name="android:statusBarColor">@color/white</item>
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar"> <item name="android:navigationBarColor">@color/white</item>
<item name="android:windowBackground">@drawable/normal_background</item> <item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar">false</item>
</style> </style>
</resources> </resources>

View File

@ -23,10 +23,9 @@ dev_dependencies:
path_provider: ^1.6.7 path_provider: ^1.6.7
color_thief_flutter: ^1.0.2 color_thief_flutter: ^1.0.2
provider: ^4.1.0 provider: ^4.1.0
google_fonts: ^1.0.0 google_fonts: ^1.1.0
dio: ^3.0.9 dio: ^3.0.9
file_picker: ^1.6.3+1 file_picker: ^1.9.0+1
xml: ^3.6.1
marquee: ^1.3.1 marquee: ^1.3.1
flutter_downloader: ^1.4.4 flutter_downloader: ^1.4.4
permission_handler: ^5.0.0+hotfix.3 permission_handler: ^5.0.0+hotfix.3
@ -42,7 +41,7 @@ dev_dependencies:
fl_chart: ^0.9.3 fl_chart: ^0.9.3
audio_service: ^0.8.0 audio_service: ^0.8.0
flutter_file_dialog: ^0.0.5 flutter_file_dialog: ^0.0.5
flutter_linkify: ^3.1.2 flutter_linkify: ^3.1.3
extended_nested_scroll_view: ^0.4.0 extended_nested_scroll_view: ^0.4.0
connectivity: ^0.4.8+2 connectivity: ^0.4.8+2
flare_flutter: ^2.0.3 flare_flutter: ^2.0.3
@ -55,7 +54,8 @@ dev_dependencies:
git: git:
url: https://github.com/galonsos/line_icons.git url: https://github.com/galonsos/line_icons.git
dependency_overrides: dependency_overrides:
flutter_isolate: '1.0.0+11' flutter_isolate: '1.0.0+13'
xml: '4.1.0'
flutter: flutter:
assets: assets: