Skip to content

Commit a74bc2e

Browse files
Wei Sheng ShihGerrit Code Review
Wei Sheng Shih
authored and
Gerrit Code Review
committed
Merge "Do not overwrite activity theme after receive splash screen view." into androidx-main
2 parents bbe759c + 68b6d8d commit a74bc2e

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Diff for: core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt

+8-4
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,11 @@ class SplashScreen private constructor(activity: Activity) {
425425

426426
override fun install() {
427427
setPostSplashScreenTheme(activity.theme, TypedValue())
428-
(activity.window.decorView as ViewGroup).setOnHierarchyChangeListener(
429-
hierarchyListener
430-
)
428+
if (SDK_INT < 33) {
429+
(activity.window.decorView as ViewGroup).setOnHierarchyChangeListener(
430+
hierarchyListener
431+
)
432+
}
431433
}
432434

433435
override fun setKeepOnScreenCondition(keepOnScreenCondition: KeepOnScreenCondition) {
@@ -454,7 +456,9 @@ class SplashScreen private constructor(activity: Activity) {
454456
exitAnimationListener: OnExitAnimationListener
455457
) {
456458
activity.splashScreen.setOnExitAnimationListener { splashScreenView ->
457-
applyAppSystemUiTheme()
459+
if (SDK_INT < 33) {
460+
applyAppSystemUiTheme()
461+
}
458462
val splashScreenViewProvider = SplashScreenViewProvider(splashScreenView, activity)
459463
exitAnimationListener.onSplashScreenExit(splashScreenViewProvider)
460464
}

Diff for: core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt

+6-4
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ public class SplashScreenViewProvider internal constructor(ctx: Activity) {
133133

134134
override fun remove() {
135135
platformView.remove()
136-
ThemeUtils.Api31.applyThemesSystemBarAppearance(
137-
activity.theme,
138-
activity.window.decorView
139-
)
136+
if (Build.VERSION.SDK_INT < 33) {
137+
ThemeUtils.Api31.applyThemesSystemBarAppearance(
138+
activity.theme,
139+
activity.window.decorView
140+
)
141+
}
140142
}
141143
}
142144
}

0 commit comments

Comments
 (0)