-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update splash screen to properly use the Androidx SplashScreen library #4413
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… MainActivity. The final theme is set manually in BaseActivity.onCreate() so no need to specify it in SplashTheme.
…e-in animation which will never be visible if the activity is finished in onCreate().
# Conflicts: # app/src/main/java/com/keylesspalace/tusky/BaseActivity.java # app/src/main/java/com/keylesspalace/tusky/SplashActivity.kt # app/src/main/java/com/keylesspalace/tusky/di/ActivitiesModule.kt
… corruption in Android 31+
Looks like a bug in the SplashScreen library that was fixed recently:
I upgraded to the latest alpha which contains the fix. |
# Conflicts: # app/src/main/java/com/keylesspalace/tusky/MainActivity.kt
connyduck
approved these changes
May 12, 2024
connyduck
pushed a commit
that referenced
this pull request
May 31, 2024
The pull request to integrate the SplashScreen library (#4413) required overriding the theme before setting the layout in `MainActivity.onCreate()`, in order to switch from `SplashTheme` to `TuskyTheme`. Since the parent `BaseActivity` already contained code to override the theme in case the user selects the "black" theme, that logic was added at the same spot in `BaseActivity`. However, since other Activities inherit from `BaseActivity` and sometimes declare a different default theme than `TuskyTheme` in the Manifest, the wrong theme was set for those Activities when not in Black theme mode. This pull request ensures that the theme will only be overridden to `TuskyTheme` in `MainActivity`, the only Activity that uses a splash screen.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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
.MainActivity.onCreate()
.postSplashScreenTheme
attribute in SplashTheme, letBaseActivity
set it according to the user settings.MainActivity.onCreate()
, keep the splash screen shown untilLoginActivity
appears.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.core-splashscreen
to 1.2.0-alpha01 which contains a fix for corrupted app theme on API 31+.