Add animated Splash Screen#7
Conversation
| implementation(libs.kotlinx.coroutines.android) | ||
|
|
||
| //Splash Screen | ||
| implementation("androidx.core:core-splashscreen:1.0.1") |
There was a problem hiding this comment.
Style / Project Conventions
Hardcoded dependency string instead of version catalog
PR adds:
implementation("androidx.core:core-splashscreen:1.0.1")Should be — add to libs.versions.toml first:
implementation(libs.androidx.core.splashscreen)Every other dependency in build.gradle.kts uses libs.*, so this should follow the same convention for consistency.
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| val splashScreen = installSplashScreen() | ||
| super.onCreate(savedInstanceState) | ||
| mainViewModel = ViewModelProvider(this)[MainViewModel::class.java] |
There was a problem hiding this comment.
Duplicate ViewModel initialization in MainActivity.kt
The PR correctly moves mainViewModel and settingsViewModel initialization earlier
(to use them in setKeepOnScreenCondition), but the original initialization
lines further down in onCreate were not removed.
As a result, both ViewModels are being constructed twice on every cold start.
Fix:
Remove the duplicate initialization lines (the ones in the original position):
mainViewModel = ViewModelProvider(this)[MainViewModel::class.java]
settingsViewModel = ViewModelProvider(this)[SettingsViewModel::class.java]| @@ -0,0 +1,53 @@ | |||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | |||
SuggestionWhenever there is a UI change, it is recommended to include a video reference of the updated behavior. This helps reviewers better understand the changes and verify UI/UX improvements more effectively. |
|
Hey, I know its been a while. I was caught up with something else but am ready to resume on this if you don't mind. Apologies. |
|
Hey, I've updated the PR to address your feedback:
|


📝 Description
Hey! Saw this issue was open and decided to take a crack at it. This PR adds the modern AndroidX splash screen API to stop the blank white flash on cold boots.
I also went ahead and hit the bonus points mentioned in the issue:
KeepOnScreenConditiondirectly toMainViewModel's loading state so it transitions right when the data is ready.🔗 Related Issue
Closes #6
🧪 Type of Change
📸 Screenshots / Videos
✅ Checklist
./gradlew lintpasses./gradlew assembleDebugsucceeds🧠 Additional Context
Just a heads up, I left the "tested on a physical device" unchecked because I built and tested this primarily on an API 36 emulator. It handles the
floatTypeAVD animations flawlessly there. Let me know if anything needs tweaking!