feat(android): Implement native splash screen#267
Conversation
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.
WalkthroughThis pull request implements an Android splash screen by updating the application theme in the manifest, adding a custom splash theme configuration, and creating associated drawable and color resources for the splash screen's visual appearance. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
composeApp/src/androidMain/res/values/colors.xml (1)
3-3: Consider using a dedicated color resource for the splash background.Reusing
ic_launcher_backgroundfor the splash screen couples the launcher icon background with the splash screen background. If these need to diverge in the future (e.g., different branding requirements), you'd need to update references in multiple places. Consider defining a separatesplash_backgroundcolor for clarity and flexibility.That said, if the intent is to keep both synchronized, this approach is acceptable.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@composeApp/src/androidMain/res/values/colors.xml` at line 3, The splash screen currently reuses the ic_launcher_background color resource which couples launcher icon styling with splash branding; create a new color resource named splash_background and set it to the desired hex value (copy current `#101010` or a new value), then update any splash layout or theme references to use splash_background instead of ic_launcher_background so the two can diverge independently (look for usages of ic_launcher_background in splash/theme XML and replace them with splash_background).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@composeApp/src/androidMain/res/values/colors.xml`:
- Line 3: The splash screen currently reuses the ic_launcher_background color
resource which couples launcher icon styling with splash branding; create a new
color resource named splash_background and set it to the desired hex value (copy
current `#101010` or a new value), then update any splash layout or theme
references to use splash_background instead of ic_launcher_background so the two
can diverge independently (look for usages of ic_launcher_background in
splash/theme XML and replace them with splash_background).
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
composeApp/src/androidMain/AndroidManifest.xmlcomposeApp/src/androidMain/res/drawable/ic_splash.xmlcomposeApp/src/androidMain/res/values/colors.xmlcomposeApp/src/androidMain/res/values/splash.xml
This commit introduces a native splash screen on Android using the
SplashScreenAPI. It replaces the default blank window with a themed splash screen that displays the app logo.splash.xmlto define theTheme.GitHubStore.Splashtheme, which sets the splash screen icon and background color.ic_splash.xmldrawable to display the app logo with appropriate insets on the splash screen.ic_launcher_backgroundcolor to#101010incolors.xml.AndroidManifest.xmlto apply the newTheme.GitHubStore.Splashas the application's theme.Summary by CodeRabbit