Skip to content

Commit

Permalink
Merge "Do not overwrite activity theme after receive splash screen vi…
Browse files Browse the repository at this point in the history
…ew." into androidx-main
  • Loading branch information
Wei Sheng Shih authored and Gerrit Code Review committed Apr 3, 2024
2 parents bbe759c + 68b6d8d commit a74bc2e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,11 @@ class SplashScreen private constructor(activity: Activity) {

override fun install() {
setPostSplashScreenTheme(activity.theme, TypedValue())
(activity.window.decorView as ViewGroup).setOnHierarchyChangeListener(
hierarchyListener
)
if (SDK_INT < 33) {
(activity.window.decorView as ViewGroup).setOnHierarchyChangeListener(
hierarchyListener
)
}
}

override fun setKeepOnScreenCondition(keepOnScreenCondition: KeepOnScreenCondition) {
Expand All @@ -454,7 +456,9 @@ class SplashScreen private constructor(activity: Activity) {
exitAnimationListener: OnExitAnimationListener
) {
activity.splashScreen.setOnExitAnimationListener { splashScreenView ->
applyAppSystemUiTheme()
if (SDK_INT < 33) {
applyAppSystemUiTheme()
}
val splashScreenViewProvider = SplashScreenViewProvider(splashScreenView, activity)
exitAnimationListener.onSplashScreenExit(splashScreenViewProvider)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ public class SplashScreenViewProvider internal constructor(ctx: Activity) {

override fun remove() {
platformView.remove()
ThemeUtils.Api31.applyThemesSystemBarAppearance(
activity.theme,
activity.window.decorView
)
if (Build.VERSION.SDK_INT < 33) {
ThemeUtils.Api31.applyThemesSystemBarAppearance(
activity.theme,
activity.window.decorView
)
}
}
}
}

0 comments on commit a74bc2e

Please sign in to comment.