Skip to content

Commit d48f6ee

Browse files
committed
feat(android): Implement native splash screen
This commit introduces a native splash screen on Android using the `SplashScreen` API. It replaces the default blank window with a themed splash screen that displays the app logo. - **feat(android)**: Added `splash.xml` to define the `Theme.GitHubStore.Splash` theme, which sets the splash screen icon and background color. - **feat(android)**: Created `ic_splash.xml` drawable to display the app logo with appropriate insets on the splash screen. - **style(android)**: Updated the `ic_launcher_background` color to `#101010` in `colors.xml`. - **refactor(android)**: Updated `AndroidManifest.xml` to apply the new `Theme.GitHubStore.Splash` as the application's theme.
1 parent e40f2bc commit d48f6ee

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

composeApp/src/androidMain/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
android:networkSecurityConfig="@xml/network_security_config"
2525
android:roundIcon="@mipmap/ic_launcher_round"
2626
android:supportsRtl="true"
27-
android:theme="@android:style/Theme.Material.Light.NoActionBar"
27+
android:theme="@style/Theme.GitHubStore.Splash"
2828
android:usesCleartextTraffic="false"
2929
tools:targetApi="29">
3030

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<inset xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:drawable="@drawable/ic_logo"
4+
android:inset="48dp"
5+
/>

composeApp/src/androidMain/res/values/ic_launcher_background.xml renamed to composeApp/src/androidMain/res/values/colors.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<color name="ic_launcher_background">#FFFFFF</color>
3+
<color name="ic_launcher_background">#101010</color>
44
</resources>
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+
<resources>
3+
4+
<style name="Theme.GitHubStore.Splash" parent="Theme.SplashScreen">
5+
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash</item>
6+
<item name="windowSplashScreenBackground">@color/ic_launcher_background</item>
7+
<item name="postSplashScreenTheme">@style/Theme.AppCompat.DayNight.NoActionBar</item>
8+
</style>
9+
</resources>

0 commit comments

Comments
 (0)