Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rainxchzed
Copy link
Contributor

🎯 Goal

This PR implements the Android 12+ SplashScreen API to provide a consistent branded launch experience that matches the red background theme of the original XML-based Pokédex app. The compose version now has the same visual branding and smooth launch experience as the XML version, ensuring brand consistency across both implementations.

Key objectives:

  • Match the iconic red background from the XML Pokédex version
  • Provide smooth app launch experience with proper splash screen
  • Maintain Pokemon/Pokédex branding during app startup
  • Implement modern Android 12+ splash screen standards

🛠 Implementation details

  • Added SplashScreen API dependency to core:designsystem module for theme access
  • Created custom Pokemon-themed splash screen with red background in styles.xml
  • Added Pokemon logo/icon for splash screen branding
  • Updated AndroidManifest.xml to use the new splash theme
  • Implemented splash screen handling in MainActivity.kt with proper transition
  • Maintained backward compatibility with pre-Android 12 devices

Architecture decisions:

  • Splash dependency in core:designsystem to keep all themes centralized
  • Used api configuration to expose splash functionality to app module
  • Followed multi-module best practices for theme organization

✍️ Explain examples

Files modified/added:

1. Dependency addition:

// core/designsystem/build.gradle.kts
dependencies {
    api(libs.androidx.core.splashscreen) // Added for theme access
    // ... existing dependencies
}

2. Splash theme creation:

<!-- core/designsystem/src/main/res/values/styles.xml -->
<style name="Theme.Pokedex.SplashScreen" parent="Theme.SplashScreen">
    <item name="windowSplashScreenBackground">@color/pokemon_red</item>
    <item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash</item>
    <item name="windowSplashScreenIconBackground">@color/white</item>
</style>

3. MainActivity implementation:

// app/src/main/kotlin/.../MainActivity.kt
override fun onCreate(savedInstanceState: Bundle?) {
    val splashScreen = installSplashScreen()
    super.onCreate(savedInstanceState)
    
    // Splash screen will automatically transition to main content
    setContent {
        PokedexTheme {
            // Main app content
        }
    }
}

4. Manifest configuration:

<!-- app/src/main/AndroidManifest.xml -->
<activity
    android:name=".MainActivity"
    android:theme="@style/Theme.Pokedex.SplashScreen"
    android:exported="true">

Visual result:

  • Launch: Users see red background with Pokemon branding (matching XML version)
  • Transition: Smooth animation to main Pokédex interface
  • Consistency: Both XML and Compose versions now have matching launch experience
  • Modern: Follows Android 12+ design guidelines while maintaining brand identity

This implementation ensures that users get the same iconic red Pokédex launch experience whether they're using the XML or Compose version of the app, while leveraging modern Android splash screen capabilities.

- Add SplashScreen API implementation to match XML version's red background
- Create custom splash theme in core:designsystem module
- Add Pokemon-themed splash icon and red background
- Ensure smooth transition from splash to main content
- Maintain brand consistency between XML and Compose versions
@rainxchzed rainxchzed requested a review from skydoves as a code owner August 25, 2025 09:57
Copy link
Owner

@skydoves skydoves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool. Thank you for your contribution!

@skydoves skydoves merged commit 4f463a3 into skydoves:main Aug 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants