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
SplashScreenActivity
which is not needed and useMainActivity
as main entry point to the application.MainActivity
inherits fromBaseActivity
which already detects if no account is configured and redirects toLoginActivity
if needed, just likeSplashScreenActivity
. - Initialize the SplashScreen library in
MainActivity.onCreate()
. - Instead of letting the SplashScreen library set the final theme from the
postSplashScreenTheme
attribute in SplashTheme, letBaseActivity
set it according to the user settings. - When no account is available in
MainActivity.onCreate()
, keep the splash screen shown untilLoginActivity
appears. - Disable the slide-in animation when launching
LoginActivity
when 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 onlyLoginActivity
will appear.