diff --git a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt index a750a9b555c31..1e24dd7322ec7 100644 --- a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt +++ b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt @@ -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) { @@ -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) } diff --git a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt index 782051816c51a..1ce8a15b44bd5 100644 --- a/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt +++ b/core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt @@ -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 + ) + } } } }