From 028a43474b1425d285160aa2ff93e851c4d44756 Mon Sep 17 00:00:00 2001 From: Super12138 <70494801+Super12138@users.noreply.github.com> Date: Sun, 8 Sep 2024 11:47:59 +0800 Subject: [PATCH] Add splash screen --- app/build.gradle.kts | 1 + app/src/main/AndroidManifest.xml | 2 +- .../super12138/todo/views/activities/MainActivity.kt | 2 ++ app/src/main/res/drawable/splash_screen.xml | 7 +++++++ app/src/main/res/values/themes.xml | 10 ++++++++++ gradle/libs.versions.toml | 2 ++ 6 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/splash_screen.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4a02175..fa6a0b1 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -69,6 +69,7 @@ dependencies { // Android X implementation(libs.androidx.core) implementation(libs.androidx.core.ktx) + implementation(libs.androidx.core.core.splashscreen) implementation(libs.androidx.appcompat) implementation(libs.androidx.activity) implementation(libs.androidx.activity.ktx) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 682f73e..c5f4d17 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/Theme.ToDo" + android:theme="@style/Theme.ToDo.Starting" tools:targetApi="35"> () { override fun onCreate(savedInstanceState: Bundle?) { + installSplashScreen() super.onCreate(savedInstanceState) if (!GlobalValues.welcomePage) { diff --git a/app/src/main/res/drawable/splash_screen.xml b/app/src/main/res/drawable/splash_screen.xml new file mode 100644 index 0000000..c3c4443 --- /dev/null +++ b/app/src/main/res/drawable/splash_screen.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index e07c419..fce8a2e 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -61,6 +61,16 @@ ?attr/isLightTheme + + + diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7209c83..4317f92 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,6 +14,7 @@ recyclerview = "1.3.2" fragment = "1.8.3" fragmentKtx = "1.8.3" roomRuntime = "2.6.1" +splashScreen = "1.2.0-alpha02" # Material material = "1.13.0-alpha05" # Fast Scroll @@ -33,6 +34,7 @@ ksp = "2.0.20-1.0.25" # Android X androidx-core = { group = "androidx.core", name = "core", version.ref = "core" } androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +androidx-core-core-splashscreen = { group = "androidx.core", name = "core-splashscreen", version.ref = "splashScreen" } androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } androidx-activity-ktx = { group = "androidx.activity", name = "activity-ktx", version.ref = "activityKtx" }