Tusky
Tusky copied to clipboard
Update splash screen to properly use the Androidx SplashScreen library
The Androidx SplashScreen library is added as a dependency to the project but isn't properly enabled in the current code. This pull request configures the splash screen properly.
- Remove
SplashScreenActivitywhich is not needed and useMainActivityas main entry point to the application.MainActivityinherits fromBaseActivitywhich already detects if no account is configured and redirects toLoginActivityif needed, just likeSplashScreenActivity. - Initialize the SplashScreen library in
MainActivity.onCreate(). - Instead of letting the SplashScreen library set the final theme from the
postSplashScreenThemeattribute in SplashTheme, letBaseActivityset it according to the user settings. - When no account is available in
MainActivity.onCreate(), keep the splash screen shown untilLoginActivityappears. - Disable the slide-in animation when launching
LoginActivitywhen no account is available because the detection happens inonCreate()and an Activity that finishes itself inonCreate()will not be drawn, so the slide-in animation will not be visible either and onlyLoginActivitywill appear.