From c711d3c67644a22080c16514076a15028267716b Mon Sep 17 00:00:00 2001 From: Maciej Stosio Date: Wed, 2 Oct 2024 15:55:55 +0200 Subject: [PATCH] refactor!: remove deprecated ios stack animation (#2361) ## Description Removes stackAnimation "ios" option in v4 after making it deprecated in 3.x. ## Checklist - [ ] Included code example that can be used to test this change - [x] Updated TS types - [x] Updated documentation: - [x] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [x] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [x] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [x] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes --- android/src/main/java/com/swmansion/rnscreens/Screen.kt | 1 - android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt | 3 --- .../src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt | 1 - apps/src/screens/Animations.tsx | 1 - apps/src/screens/Events.tsx | 1 - guides/GUIDE_FOR_LIBRARY_AUTHORS.md | 1 - ios/RNSConvert.mm | 1 - ios/RNSScreen.mm | 1 - native-stack/README.md | 1 - src/fabric/ScreenNativeComponent.ts | 1 - src/native-stack/types.tsx | 1 - src/types.tsx | 2 -- windows/RNScreens/Screen.h | 1 - 13 files changed, 16 deletions(-) diff --git a/android/src/main/java/com/swmansion/rnscreens/Screen.kt b/android/src/main/java/com/swmansion/rnscreens/Screen.kt index a6cb8c7501..0f91f963fd 100644 --- a/android/src/main/java/com/swmansion/rnscreens/Screen.kt +++ b/android/src/main/java/com/swmansion/rnscreens/Screen.kt @@ -435,7 +435,6 @@ class Screen( SLIDE_FROM_RIGHT, SLIDE_FROM_LEFT, FADE_FROM_BOTTOM, - IOS, IOS_FROM_RIGHT, IOS_FROM_LEFT, } diff --git a/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt b/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt index b700bffffd..a4e6fea83e 100644 --- a/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +++ b/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt @@ -182,7 +182,6 @@ class ScreenStack( R.anim.rns_no_animation_medium, ) StackAnimation.FADE_FROM_BOTTOM -> it.setCustomAnimations(R.anim.rns_fade_from_bottom, R.anim.rns_no_animation_350) - StackAnimation.IOS -> it.setCustomAnimations(R.anim.rns_ios_from_right_foreground_open, R.anim.rns_ios_from_right_background_open) StackAnimation.IOS_FROM_RIGHT -> it.setCustomAnimations(R.anim.rns_ios_from_right_foreground_open, R.anim.rns_ios_from_right_background_open) StackAnimation.IOS_FROM_LEFT -> it.setCustomAnimations(R.anim.rns_ios_from_left_foreground_open, R.anim.rns_ios_from_left_background_open) } @@ -222,7 +221,6 @@ class ScreenStack( R.anim.rns_slide_out_to_bottom, ) StackAnimation.FADE_FROM_BOTTOM -> it.setCustomAnimations(R.anim.rns_no_animation_250, R.anim.rns_fade_to_bottom) - StackAnimation.IOS -> it.setCustomAnimations(R.anim.rns_ios_from_right_foreground_close, R.anim.rns_ios_from_right_background_close) StackAnimation.IOS_FROM_RIGHT -> it.setCustomAnimations(R.anim.rns_ios_from_right_background_close, R.anim.rns_ios_from_right_foreground_close) StackAnimation.IOS_FROM_LEFT -> it.setCustomAnimations(R.anim.rns_ios_from_left_background_close, R.anim.rns_ios_from_left_foreground_close) } @@ -417,7 +415,6 @@ class ScreenStack( Build.VERSION.SDK_INT >= 33 || fragmentWrapper.screen.stackAnimation === StackAnimation.SLIDE_FROM_BOTTOM || fragmentWrapper.screen.stackAnimation === StackAnimation.FADE_FROM_BOTTOM || - fragmentWrapper.screen.stackAnimation === StackAnimation.IOS || fragmentWrapper.screen.stackAnimation === StackAnimation.IOS_FROM_RIGHT || fragmentWrapper.screen.stackAnimation === StackAnimation.IOS_FROM_LEFT } diff --git a/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt b/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt index de5be092b5..2b752266b9 100644 --- a/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +++ b/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt @@ -142,7 +142,6 @@ open class ScreenViewManager : "slide_from_left" -> Screen.StackAnimation.SLIDE_FROM_LEFT "slide_from_bottom" -> Screen.StackAnimation.SLIDE_FROM_BOTTOM "fade_from_bottom" -> Screen.StackAnimation.FADE_FROM_BOTTOM - "ios" -> Screen.StackAnimation.IOS "ios_from_right" -> Screen.StackAnimation.IOS_FROM_RIGHT "ios_from_left" -> Screen.StackAnimation.IOS_FROM_LEFT else -> throw JSApplicationIllegalArgumentException("Unknown animation type $animation") diff --git a/apps/src/screens/Animations.tsx b/apps/src/screens/Animations.tsx index 10097a5d23..608e939746 100644 --- a/apps/src/screens/Animations.tsx +++ b/apps/src/screens/Animations.tsx @@ -52,7 +52,6 @@ const MainScreen = ({ 'slide_from_bottom', 'slide_from_right', 'slide_from_left', - 'ios', 'ios_from_right', 'ios_from_left', 'none', diff --git a/apps/src/screens/Events.tsx b/apps/src/screens/Events.tsx index 9996d9e979..03ddace791 100644 --- a/apps/src/screens/Events.tsx +++ b/apps/src/screens/Events.tsx @@ -83,7 +83,6 @@ const MainScreen = ({ 'slide_from_bottom', 'slide_from_right', 'slide_from_left', - 'ios', 'ios_from_right', 'ios_from_left', 'none', diff --git a/guides/GUIDE_FOR_LIBRARY_AUTHORS.md b/guides/GUIDE_FOR_LIBRARY_AUTHORS.md index 2ed6bcf9ef..d86bd10c9a 100644 --- a/guides/GUIDE_FOR_LIBRARY_AUTHORS.md +++ b/guides/GUIDE_FOR_LIBRARY_AUTHORS.md @@ -221,7 +221,6 @@ Allows for the customization of how the given screen should appear/disappear whe - `"slide_from_bottom"` - slide in the new screen from bottom to top - `"slide_from_right"` - slide in the new screen from right to left (Android only, resolves to default transition on iOS) - `"slide_from_left"` - slide in the new screen from left to right -- `"ios"` - @deprecated iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS) (will be removed in v4.0.0 in favor of `ios_from_right`) - `"ios_from_right"` - iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS) - `"ios_from_left"` - iOS like slide in animation. pushes in the new screen from left to right (Android only, resolves to default transition on iOS) - `"none"` – the screen appears/disappears without an animation diff --git a/ios/RNSConvert.mm b/ios/RNSConvert.mm index eb13f1fc70..67c6519b90 100644 --- a/ios/RNSConvert.mm +++ b/ios/RNSConvert.mm @@ -53,7 +53,6 @@ + (RNSScreenStackAnimation)RNSScreenStackAnimationFromCppEquivalent:(react::RNSS switch (stackAnimation) { // these four are intentionally grouped case react::RNSScreenStackAnimation::Slide_from_right: - case react::RNSScreenStackAnimation::Ios: case react::RNSScreenStackAnimation::Ios_from_right: case react::RNSScreenStackAnimation::Default: return RNSScreenStackAnimationDefault; diff --git a/ios/RNSScreen.mm b/ios/RNSScreen.mm index dba3b4fef7..9b1cc543a0 100644 --- a/ios/RNSScreen.mm +++ b/ios/RNSScreen.mm @@ -1961,7 +1961,6 @@ @implementation RCTConvert (RNSScreen) @"slide_from_bottom" : @(RNSScreenStackAnimationSlideFromBottom), @"slide_from_right" : @(RNSScreenStackAnimationDefault), @"slide_from_left" : @(RNSScreenStackAnimationSlideFromLeft), - @"ios" : @(RNSScreenStackAnimationDefault), @"ios_from_right" : @(RNSScreenStackAnimationDefault), @"ios_from_left" : @(RNSScreenStackAnimationSlideFromLeft), }), diff --git a/native-stack/README.md b/native-stack/README.md index 20f8734077..3b619e130b 100644 --- a/native-stack/README.md +++ b/native-stack/README.md @@ -328,7 +328,6 @@ How the given screen should appear/disappear when pushed or popped at the top of - `slide_from_bottom` – performs a slide from bottom animation - `slide_from_right` - slide in the new screen from right to left (Android only, resolves to default transition on iOS) - `slide_from_left` - slide in the new screen from left to right -- `"ios"` - @deprecated iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS) (will be removed in v4.0.0 in favor of `ios_from_right`) - `"ios_from_right"` - iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS) - `"ios_from_left"` - iOS like slide in animation. pushes in the new screen from left to right (Android only, resolves to default transition on iOS) - `none` - the screen appears/disappears without an animation. diff --git a/src/fabric/ScreenNativeComponent.ts b/src/fabric/ScreenNativeComponent.ts index bf7242cfd5..1eb9071ac3 100644 --- a/src/fabric/ScreenNativeComponent.ts +++ b/src/fabric/ScreenNativeComponent.ts @@ -58,7 +58,6 @@ type StackAnimation = | 'slide_from_left' | 'slide_from_bottom' | 'fade_from_bottom' - | 'ios' | 'ios_from_right' | 'ios_from_left'; diff --git a/src/native-stack/types.tsx b/src/native-stack/types.tsx index 4c3f342625..d9f9f10290 100644 --- a/src/native-stack/types.tsx +++ b/src/native-stack/types.tsx @@ -448,7 +448,6 @@ export type NativeStackNavigationOptions = { * - "slide_from_bottom" – performs a slide from bottom animation * - "slide_from_right" - slide in the new screen from right to left (Android only, resolves to default transition on iOS) * - "slide_from_left" - slide in the new screen from left to right - * - "ios" - @deprecated iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS) (will be removed in v4.0.0 in favor of `ios_from_right`) * - "ios_from_right" - iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS) * - "ios_from_left" - iOS like slide in animation. pushes in the new screen from left to right (Android only, resolves to default transition on iOS) * - "none" – the screen appears/dissapears without an animation diff --git a/src/types.tsx b/src/types.tsx index 5c11e9556b..684a21b0c3 100644 --- a/src/types.tsx +++ b/src/types.tsx @@ -39,7 +39,6 @@ export type StackAnimationTypes = | 'slide_from_bottom' | 'slide_from_right' | 'slide_from_left' - | 'ios' | 'ios_from_right' | 'ios_from_left'; export type BlurEffectTypes = @@ -386,7 +385,6 @@ export interface ScreenProps extends ViewProps { * - `slide_from_bottom` – performs a slide from bottom animation * - "slide_from_right" - slide in the new screen from right to left (Android only, resolves to default transition on iOS) * - "slide_from_left" - slide in the new screen from left to right - * - "ios" - @deprecated iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS) (will be removed in v4.0.0 in favor of `ios_from_right`) * - "ios_from_right" - iOS like slide in animation. pushes in the new screen from right to left (Android only, resolves to default transition on iOS) * - "ios_from_left" - iOS like slide in animation. pushes in the new screen from left to right (Android only, resolves to default transition on iOS) * - "none" – the screen appears/dissapears without an animation diff --git a/windows/RNScreens/Screen.h b/windows/RNScreens/Screen.h index 564b173f5b..7abf42672c 100644 --- a/windows/RNScreens/Screen.h +++ b/windows/RNScreens/Screen.h @@ -11,7 +11,6 @@ enum class StackAnimation { SIMPLE_FROM_BOTTOM, SLIDE_FROM_RIGHT, SLIDE_FROM_LEFT, - IOS, IOS_FROM_RIGHT, IOS_FROM_LEFT };