Skip to content

Commit

Permalink
refactor!: remove deprecated ios stack animation (#2361)
Browse files Browse the repository at this point in the history
## 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: <!-- For adding new props to native-stack
-->
- [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
  • Loading branch information
maciekstosio authored Oct 2, 2024
1 parent 606cd4b commit c711d3c
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 16 deletions.
1 change: 0 additions & 1 deletion android/src/main/java/com/swmansion/rnscreens/Screen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ class Screen(
SLIDE_FROM_RIGHT,
SLIDE_FROM_LEFT,
FADE_FROM_BOTTOM,
IOS,
IOS_FROM_RIGHT,
IOS_FROM_LEFT,
}
Expand Down
3 changes: 0 additions & 3 deletions android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion apps/src/screens/Animations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const MainScreen = ({
'slide_from_bottom',
'slide_from_right',
'slide_from_left',
'ios',
'ios_from_right',
'ios_from_left',
'none',
Expand Down
1 change: 0 additions & 1 deletion apps/src/screens/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const MainScreen = ({
'slide_from_bottom',
'slide_from_right',
'slide_from_left',
'ios',
'ios_from_right',
'ios_from_left',
'none',
Expand Down
1 change: 0 additions & 1 deletion guides/GUIDE_FOR_LIBRARY_AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion ios/RNSConvert.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion ios/RNSScreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}),
Expand Down
1 change: 0 additions & 1 deletion native-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/fabric/ScreenNativeComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ type StackAnimation =
| 'slide_from_left'
| 'slide_from_bottom'
| 'fade_from_bottom'
| 'ios'
| 'ios_from_right'
| 'ios_from_left';

Expand Down
1 change: 0 additions & 1 deletion src/native-stack/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion windows/RNScreens/Screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ enum class StackAnimation {
SIMPLE_FROM_BOTTOM,
SLIDE_FROM_RIGHT,
SLIDE_FROM_LEFT,
IOS,
IOS_FROM_RIGHT,
IOS_FROM_LEFT
};
Expand Down

0 comments on commit c711d3c

Please sign in to comment.