Skip to content

Commit

Permalink
Merge pull request #23 from wizbii/feature/android-splashscreen
Browse files Browse the repository at this point in the history
Implement Android SplashScreen
  • Loading branch information
Ribesg authored Apr 19, 2024
2 parents 87d0e47 + 6636b81 commit cf7dcfa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ android-sdk-target = "34"
# Libraries
androidx-activity-compose = "1.9.0"
androidx-datastore = "1.1.0"
androidx-splashscreen = "1.0.1"
coil = "3.0.0-alpha06"
decompose = "3.0.0-beta01"
essenty = "2.0.0-beta02"
Expand Down Expand Up @@ -90,6 +91,7 @@ common-test = [

android-main = [
"androidx-activity-compose",
"androidx-splashscreen",
"ktor-client-okhttp",
"slf4j-android",
"sqldelight-android",
Expand All @@ -116,6 +118,7 @@ desktop-test = [

androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
androidx-datastore = { module = "androidx.datastore:datastore-preferences-core", version.ref = "androidx-datastore" }
androidx-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidx-splashscreen" }

coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
Expand Down
2 changes: 1 addition & 1 deletion src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:label="Cinematic Journey"
android:name=".MainApplication"
android:supportsRtl="true"
android:theme="@style/Theme.AppTheme"
android:theme="@style/Theme.SplashTheme"
tools:ignore="UnusedAttribute">

<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.arkivanov.decompose.defaultComponentContext
import com.wizbii.cinematic.journey.presentation.screen.root.DefaultRootComponent
import com.wizbii.cinematic.journey.presentation.screen.root.Root
Expand All @@ -12,6 +13,7 @@ import org.koin.core.component.KoinComponent
class MainActivity : ComponentActivity(), KoinComponent {

override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
enableEdgeToEdge()

super.onCreate(savedInstanceState)
Expand Down
6 changes: 6 additions & 0 deletions src/androidMain/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@
<item name="android:windowBackground">@android:color/black</item>
</style>

<style name="Theme.SplashTheme" parent="Theme.SplashScreen">
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
<item name="windowSplashScreenBackground">@android:color/black</item>
<item name="postSplashScreenTheme">@style/Theme.AppTheme</item>
</style>

</resources>

0 comments on commit cf7dcfa

Please sign in to comment.