Skip to content

Commit

Permalink
Implement splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
omer358 committed Aug 21, 2024
1 parent 8fa1e0b commit 8133ec8
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 17 deletions.
6 changes: 2 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/SplashScreenTheme"
android:theme="@style/Theme.App.SplashScreen"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/SplashScreenTheme">
android:theme="@style/Theme.App.SplashScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/values-night-v31/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen.IconBackground">
<item name="windowSplashScreenBackground">#9FD3A8</item>
<item name="android:windowSplashScreenIconBackgroundColor">@color/ic_launcher_background</item>
<item name="postSplashScreenTheme">@style/Theme.RememberMe</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<!--<item name="android:windowSplashScreenBrandingImage">@drawable/ic_launcher_foreground</item>-->
</style>
</resources>
11 changes: 11 additions & 0 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.RememberMe" parent="android:Theme.Material.Light.NoActionBar" />

<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">#9FD3A8</item>
<item name="postSplashScreenTheme">@style/Theme.RememberMe</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
</style>
</resources>
11 changes: 11 additions & 0 deletions app/src/main/res/values-v31/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources >

<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen.IconBackground">
<item name="windowSplashScreenBackground">#396846</item>
<item name="android:windowSplashScreenIconBackgroundColor">#9FD3A8</item>
<item name="postSplashScreenTheme">@style/Theme.RememberMe</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
<!--<item name="android:windowSplashScreenBrandingImage">@drawable/ic_launcher_foreground</item>-->
</style>
</resources>
17 changes: 5 additions & 12 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base theme that combines NoActionBar and SplashScreen attributes -->
<style name="Base.Theme.RememberMe" parent="android:Theme.Material.Light.NoActionBar">
<!-- Splash screen attributes -->
<item name="windowSplashScreenBackground">@android:color/holo_blue_dark</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_avatar_1</item>
</style>

<!-- Custom theme extending the combined base theme -->
<style name="Theme.RememberMe" parent="Base.Theme.RememberMe">
<!-- Additional customizations for RememberMe theme -->
</style>
<style name="Theme.RememberMe" parent="android:Theme.Material.Light.NoActionBar"/>

<!-- Splash screen theme extending the combined base theme -->
<style name="SplashScreenTheme" parent="Base.Theme.RememberMe">
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">#396846</item>
<item name="android:windowActionBar">false</item>
<item name="postSplashScreenTheme">@style/Theme.RememberMe</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
agp = "8.4.2"
animation = "1.7.0-beta06"
coreSplashscreen = "1.0.1"
coreSplashscreen = "1.2.0-alpha01"
coreTesting = "2.2.0"
coreTestingVersion = "1.1.1"
datastorePreferences = "1.1.1"
Expand Down

0 comments on commit 8133ec8

Please sign in to comment.