Skip to content

Commit e234718

Browse files
fix: clean up splash screen issues
1 parent 5d32cab commit e234718

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ dependencies {
5757
implementation("androidx.datastore:datastore:1.1.1")
5858
implementation("com.google.protobuf:protobuf-javalite:3.18.0")
5959
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
60+
implementation("androidx.core:core-splashscreen:1.0.1")
6061

6162
// Jetpack Compose
6263
// Adding the Bill of Materials synchronizes dependencies in the androidx.compose namespace

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<activity
1515
android:name="org.bitcoindevkit.devkitwallet.presentation.DevkitWalletActivity"
16-
android:theme="@style/Theme.BitcoindevkitSampleApp.Launcher"
16+
android:theme="@style/SplashScreen"
1717
android:exported="true">
1818
<intent-filter>
1919
<action android:name="android.intent.action.MAIN" />

app/src/main/java/org/bitcoindevkit/devkitwallet/presentation/DevkitWalletActivity.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import org.bitcoindevkit.devkitwallet.data.UserPreferencesSerializer
2323
import org.bitcoindevkit.devkitwallet.domain.DwLogger
2424
import org.bitcoindevkit.devkitwallet.domain.UserPreferencesRepository
2525
import org.bitcoindevkit.devkitwallet.domain.Wallet
26+
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
2627
import org.bitcoindevkit.devkitwallet.presentation.navigation.CreateWalletNavigation
2728
import org.bitcoindevkit.devkitwallet.presentation.navigation.HomeNavigation
2829
import org.bitcoindevkit.devkitwallet.presentation.theme.DevkitTheme
@@ -36,6 +37,8 @@ private val Context.userPreferencesStore: DataStore<UserPreferences> by dataStor
3637

3738
class DevkitWalletActivity : AppCompatActivity() {
3839
override fun onCreate(savedInstanceState: Bundle?) {
40+
installSplashScreen()
41+
3942
super.onCreate(savedInstanceState)
4043

4144
// Initialize Devkit Wallet Logger (used in the LogsScreen)

app/src/main/res/values/splash.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<style name="SplashScreen" parent="Theme.SplashScreen">
4+
<item name="windowSplashScreenBackground">@color/primary_dark</item>
5+
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_bdk_foreground</item>
6+
<item name="postSplashScreenTheme">@style/Theme.BitcoindevkitSampleApp</item>
7+
</style>
8+
</resources>

app/src/main/res/values/themes.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,4 @@
44
<!-- Status bar color -->
55
<item name="android:statusBarColor">@color/primary_dark</item>
66
</style>
7-
8-
<style name="Theme.BitcoindevkitSampleApp.Launcher">
9-
<item name="android:background">@drawable/launch_screen</item>
10-
</style>
117
</resources>

0 commit comments

Comments
 (0)