From 8cdfa9559eebb2ca178aee7e03949ef68efa2a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?avery=20=E2=9C=BF?= Date: Mon, 12 Feb 2024 14:09:18 -0800 Subject: [PATCH] fix: android screen stack animation https://github.com/software-mansion/react-native-screens/pull/2019 --- .../src/main/java/com/swmansion/rnscreens/ScreenStack.kt | 6 ++++-- android/src/main/res/v33/anim-v33/rns_default_enter_in.xml | 1 - android/src/main/res/v33/anim-v33/rns_default_enter_out.xml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt b/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt index eff7680d76..5d4735b2f7 100644 --- a/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +++ b/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt @@ -2,6 +2,7 @@ package com.swmansion.rnscreens import android.content.Context import android.graphics.Canvas +import android.os.Build import android.view.View import com.facebook.react.bridge.ReactContext import com.facebook.react.uimanager.UIManagerHelper @@ -335,8 +336,9 @@ class ScreenStack(context: Context?) : ScreenContainer(context) { fragmentWrapper.screen.stackPresentation === Screen.StackPresentation.TRANSPARENT_MODAL private fun needsDrawReordering(fragmentWrapper: ScreenFragmentWrapper): Boolean = - fragmentWrapper.screen.stackAnimation === StackAnimation.SLIDE_FROM_BOTTOM || + Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU || + fragmentWrapper.screen.stackAnimation === StackAnimation.SLIDE_FROM_BOTTOM || fragmentWrapper.screen.stackAnimation === StackAnimation.FADE_FROM_BOTTOM || - fragmentWrapper.screen.stackAnimation === StackAnimation.IOS + fragmentWrapper.screen.stackAnimation === StackAnimation.IOS } } diff --git a/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml b/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml index 654c80bfbe..1767203511 100644 --- a/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml +++ b/android/src/main/res/v33/anim-v33/rns_default_enter_in.xml @@ -19,7 +19,6 @@ android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true" - android:startOffset="0" android:interpolator="@android:interpolator/fast_out_extra_slow_in" android:duration="450" /> diff --git a/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml b/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml index c3ff70f810..e7dd72bba5 100644 --- a/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml +++ b/android/src/main/res/v33/anim-v33/rns_default_enter_out.xml @@ -5,13 +5,13 @@ + android:duration="450" />