Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: android screen stack animation #2019

Merged
merged 3 commits into from
Mar 22, 2024

Conversation

janicduplessis
Copy link
Contributor

@janicduplessis janicduplessis commented Jan 24, 2024

Description

There was some issues with android animation, the root cause is the drawing order, not the actual animations. This reverts the changes to the animations so it matches stock android ones and always reverse drawing order for android api 33+.

Changes

Revert the animation changes in 00543fb and 05f4dd7.

Return true from needsDrawReordering when api 33+.

Screenshots / GIFs

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

Before

Api 33

Screen.Recording.2024-01-24.at.12.28.26.mov

The mitigations for wrong drawing order makes it kind of hard to see the issue, but going frame by frame we can see the animation is weird initially

image

After

Api 31

Screen.Recording.2024-01-24.at.12.19.03.mov

Api 33

Screen.Recording.2024-01-24.at.12.25.04.mov

We can now see that the new screen is actually drawn on top of the old one so it looks better during the initial fade.

image

Test code and steps to reproduce

Tested in example app

Checklist

@janicduplessis
Copy link
Contributor Author

cc @kkafar

@janicduplessis
Copy link
Contributor Author

Looks like CI failures are unrelated?

@kkafar
Copy link
Member

kkafar commented Jan 24, 2024

Yeah, they most likely are aren't. Once I check out the behaviour we will proceed with merging.
Thanks for contribution 🙌🏻

@tboba
Copy link
Member

tboba commented Jan 24, 2024

Hi @janicduplessis, @kkafar - the issue with CI is not related to this PR. Looks like changes made in #1913 have broke our CI (I've already discovered that on screens without goBackGesture, back button on Android always acts like pressing and holding while tapping it). So I wouldn't worry about the CI, I've already reported to @piaskowyk about this problem and waiting for his response 👀

yayvery added a commit to yayvery/react-native-screens that referenced this pull request Feb 12, 2024
@tboba
Copy link
Member

tboba commented Feb 13, 2024

@janicduplessis That looks soooo damn way better! 🤩
I think the biggest advantage of this change is that white remaining white fields are no more (pictured below).

Screen.Recording.2024-02-13.at.13.54.28.mov

I've also fixed API 28 and it works fine. Thanks!

Copy link
Member

@tboba tboba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment from me. Also, could you merge changes from main, so that the CI build will be fixed?

@@ -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 ||
Copy link
Member

@tboba tboba Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment here why we're comparing Android version? (just for a context, that since API 33 the default animation has changed and because of the "sliding" we need to draw reordering 👍)

@janicduplessis
Copy link
Contributor Author

@tboba Done!

@tboba
Copy link
Member

tboba commented Feb 13, 2024

Love it, thanks @janicduplessis!
If we're not in a hurry, I'll confirm from the other commenters from this PR that the issues with the animation are not the case from them. Is that alright?

@janicduplessis
Copy link
Contributor Author

Sounds good.

@efstathiosntonas
Copy link

@janicduplessis thank you for this, can you please run some tests in foldable devices like the one in the screenshot?

I see some weird jumpiness on my end

Screenshot 2024-02-14 at 17 06 32

yayvery added a commit to yayvery/react-native-screens that referenced this pull request Feb 24, 2024
yayvery added a commit to yayvery/react-native-screens that referenced this pull request Mar 13, 2024
@tboba
Copy link
Member

tboba commented Mar 22, 2024

Hi @efstathiosntonas, I've just tested this animation with provided emulator configuration and I can't see any jumpiness there 🤔 Maybe you've got some other emulator enabled that stutters your foldable device?
For now I'll merge this PR, but we need to observe if there's any issues, related to the animation there.

Copy link
Member

@tboba tboba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀

@tboba tboba merged commit 6eb587a into software-mansion:main Mar 22, 2024
4 checks passed
tboba pushed a commit that referenced this pull request Mar 25, 2024
## Description

There was some issues with android animation, the root cause is the
drawing order, not the actual animations. This reverts the changes to
the animations so it matches stock android ones and always reverse
drawing order for android api 33+.

## Changes

Revert the animation changes in
00543fb
and
05f4dd7.

Return true from needsDrawReordering when api 33+.

## Screenshots / GIFs

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

### Before

Api 33


https://github.com/software-mansion/react-native-screens/assets/2677334/8777838c-a2bb-4e43-bcc2-a9a51926eeb9

The mitigations for wrong drawing order makes it kind of hard to see the
issue, but going frame by frame we can see the animation is weird
initially

<img width="286" alt="image"
src="https://github.com/software-mansion/react-native-screens/assets/2677334/90b09c7c-4a56-44fb-b84e-7a6162c75a2c">

### After

Api 31


https://github.com/software-mansion/react-native-screens/assets/2677334/2df2eaaa-92ef-4bc0-9ef5-e64e241a38d3

Api 33


https://github.com/software-mansion/react-native-screens/assets/2677334/2588241b-9536-4726-aacc-dca7facb32ad

We can now see that the new screen is actually drawn on top of the old
one so it looks better during the initial fade.

<img width="298" alt="image"
src="https://github.com/software-mansion/react-native-screens/assets/2677334/2a6c1fd5-0079-4f21-aa4e-1ddff4569296">

## Test code and steps to reproduce

Tested in example app

## Checklist

- [x] 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
- [x] Ensured that CI passes
github-merge-queue bot referenced this pull request in valora-inc/wallet Apr 13, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[react-native-screens](https://togithub.com/software-mansion/react-native-screens)
| [`^3.29.0` ->
`^3.30.1`](https://renovatebot.com/diffs/npm/react-native-screens/3.29.0/3.30.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-screens/3.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-screens/3.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-screens/3.29.0/3.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-screens/3.29.0/3.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>software-mansion/react-native-screens
(react-native-screens)</summary>

###
[`v3.30.1`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.30.1)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.30.0...3.30.1)

Patch release addressing an issue with building a package due to the
missing submodule from `postinstall` command.

#### 🔢 Miscellaneous

- Remove postinstall step from package.json by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2081](https://togithub.com/software-mansion/react-native-screens/pull/2081)

**Full Changelog**:
software-mansion/react-native-screens@3.30.0...3.30.1

###
[`v3.30.0`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.30.0)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.29.0...3.30.0)

Minor release including custom screen transitions, adding support for
VisionOS, supporting `slide_from_left` animation on iOS and fixing other
aspects (including wrong targets for touchable components on Fabric).
Thanks for following along! 💙

**Note**: Please note that support for React Native versions lower than
0.68 have been **dropped**. Older versions may still continue to work
with this and newer releases of react-native-screens, but bugs from
deprecated versions will not be considered for repair.

#### What's Changed

#### 👍 Improvements

- **Custom screen transitions** - In 3.30.0, we've introduced a support
for custom transition animations while making a "go back" gesture. Made
by [@&#8203;piaskowyk](https://togithub.com/piaskowyk) and
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/1913](https://togithub.com/software-mansion/react-native-screens/pull/1913)

- **Support for VisionOS is here!** - From now, react-native-screens
offers bundled support for VisionOS platform. Made by
[@&#8203;okwasniewski](https://togithub.com/okwasniewski) in
[https://github.com/software-mansion/react-native-screens/pull/2025](https://togithub.com/software-mansion/react-native-screens/pull/2025)

- **`slide_from_left` transition on iOS** - You can use
`slide_from_left` animation that will be used for pushing or popping a
new screen. Made by
[@&#8203;kirillzyusko](https://togithub.com/kirillzyusko) in
[https://github.com/software-mansion/react-native-screens/pull/2057](https://togithub.com/software-mansion/react-native-screens/pull/2057)

- Add `cancelSearch` command on SearchBar by
[@&#8203;Jasonzj](https://togithub.com/Jasonzj) in
[https://github.com/software-mansion/react-native-screens/pull/1987](https://togithub.com/software-mansion/react-native-screens/pull/1987)

- Fixed Android screen stack animation by
[@&#8203;janicduplessis](https://togithub.com/janicduplessis) in
[https://github.com/software-mansion/react-native-screens/pull/2019](https://togithub.com/software-mansion/react-native-screens/pull/2019)

#### 🐛 Bug fixes

- Not working hitslop for headerRight/Left views by
[@&#8203;kkafar](https://togithub.com/kkafar) in
[https://github.com/software-mansion/react-native-screens/pull/1995](https://togithub.com/software-mansion/react-native-screens/pull/1995)
- App freeze when navigating back from any modal nested in contained
modal by [@&#8203;kkafar](https://togithub.com/kkafar) in
[https://github.com/software-mansion/react-native-screens/pull/1996](https://togithub.com/software-mansion/react-native-screens/pull/1996)
- Incorrect safe area on transparent modals using landscape orientation
by [@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2008](https://togithub.com/software-mansion/react-native-screens/pull/2008)
- Invalid orientation of contained modals by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2011](https://togithub.com/software-mansion/react-native-screens/pull/2011)
- Modify the decorFitsSystemWindow parameter in setNavigationBarHidden
by [@&#8203;jiyong1](https://togithub.com/jiyong1) in
[https://github.com/software-mansion/react-native-screens/pull/1988](https://togithub.com/software-mansion/react-native-screens/pull/1988)
- Avoid race condition related to state on the new arch by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-screens/pull/2024](https://togithub.com/software-mansion/react-native-screens/pull/2024)
- Check for multiple screens while changing screen orientation by
[@&#8203;uzegonemad](https://togithub.com/uzegonemad) in
[https://github.com/software-mansion/react-native-screens/pull/2035](https://togithub.com/software-mansion/react-native-screens/pull/2035)
- Fix setting incorrect measure with native header by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) and
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2028](https://togithub.com/software-mansion/react-native-screens/pull/2028)
- Add notifying for header height change, fix header height values by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2075](https://togithub.com/software-mansion/react-native-screens/pull/2075)
- Change context while running `runOnUiQueueThread` on 0.73 with
Bridgeless by [@&#8203;cortinico](https://togithub.com/cortinico) in
[https://github.com/software-mansion/react-native-screens/pull/2022](https://togithub.com/software-mansion/react-native-screens/pull/2022)
- Use reactApplicationContext in onScreenChanged by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2046](https://togithub.com/software-mansion/react-native-screens/pull/2046)
- Remove calculating status bar height in useAnimatedHeaderHeight when
header is not shown by [@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2033](https://togithub.com/software-mansion/react-native-screens/pull/2033)
- Handle setting `display` for `_viewConfig` attribute by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) and
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2071](https://togithub.com/software-mansion/react-native-screens/pull/2071)
- Fix crash with searchResultsController in RNSSearchBar by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2004](https://togithub.com/software-mansion/react-native-screens/pull/2004)
- Add constraints for velocity in `goBackGesture` screen transition by
[@&#8203;piaskowyk](https://togithub.com/piaskowyk) in
[https://github.com/software-mansion/react-native-screens/pull/2061](https://togithub.com/software-mansion/react-native-screens/pull/2061)
- Add view check for getting StackView in `goBackGesture` by
[@&#8203;piaskowyk](https://togithub.com/piaskowyk) in
[https://github.com/software-mansion/react-native-screens/pull/2060](https://togithub.com/software-mansion/react-native-screens/pull/2060)
- Change default value of context of ScreenGestureDetector, add warning
for goBackGesture by [@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2013](https://togithub.com/software-mansion/react-native-screens/pull/2013)
- Move GHContext from gesture-handler to native-stack by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2017](https://togithub.com/software-mansion/react-native-screens/pull/2017)
- Change default gesture from Tap to Fling, fix failing CI by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2023](https://togithub.com/software-mansion/react-native-screens/pull/2023)

#### 🔢 Miscellaneous

- **Drop React Native 0.64 - 0.67 since 3.30.0** by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2036](https://togithub.com/software-mansion/react-native-screens/pull/2036)
- Remove mixed CJS/ESM, refactorize index.native.tsx by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/1982](https://togithub.com/software-mansion/react-native-screens/pull/1982)
- Add react-navigation as submodule & use it in test applications by
[@&#8203;kkafar](https://togithub.com/kkafar) and
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/1993](https://togithub.com/software-mansion/react-native-screens/pull/1993)
- Unify member-field naming convention in Kotlin by
[@&#8203;kkafar](https://togithub.com/kkafar) in
[https://github.com/software-mansion/react-native-screens/pull/1999](https://togithub.com/software-mansion/react-native-screens/pull/1999)
- Update compatibility table with supported RN versions with Fabric by
[@&#8203;kkafar](https://togithub.com/kkafar) in
[https://github.com/software-mansion/react-native-screens/pull/2001](https://togithub.com/software-mansion/react-native-screens/pull/2001)
- Change name of `headerBackButtonClicked` event by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2015](https://togithub.com/software-mansion/react-native-screens/pull/2015)
- Stabilize Android E2E tests by
[@&#8203;kirillzyusko](https://togithub.com/kirillzyusko) in
[https://github.com/software-mansion/react-native-screens/pull/2062](https://togithub.com/software-mansion/react-native-screens/pull/2062)
- Update Podfiles in Example projects, update RN in FabricExample to
0.73 by [@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/1989](https://togithub.com/software-mansion/react-native-screens/pull/1989)
- Update React Native to 0.73.4, change Cocoapods version by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2032](https://togithub.com/software-mansion/react-native-screens/pull/2032)
- Configure yarn version in package.json by
[@&#8203;bakkerjoeri](https://togithub.com/bakkerjoeri) in
[https://github.com/software-mansion/react-native-screens/pull/2077](https://togithub.com/software-mansion/react-native-screens/pull/2077)
- Bump ip from 1.1.8 to 1.1.9 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/software-mansion/react-native-screens/pull/2038](https://togithub.com/software-mansion/react-native-screens/pull/2038)
- Bump ip from 1.1.8 to 1.1.9 in example apps by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2044](https://togithub.com/software-mansion/react-native-screens/pull/2044)

#### New Contributors

- [@&#8203;jiyong1](https://togithub.com/jiyong1) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/1988](https://togithub.com/software-mansion/react-native-screens/pull/1988)
- [@&#8203;Jasonzj](https://togithub.com/Jasonzj) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/1987](https://togithub.com/software-mansion/react-native-screens/pull/1987)
- [@&#8203;j-piasecki](https://togithub.com/j-piasecki) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/2024](https://togithub.com/software-mansion/react-native-screens/pull/2024)
- [@&#8203;cortinico](https://togithub.com/cortinico) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/2022](https://togithub.com/software-mansion/react-native-screens/pull/2022)
- [@&#8203;okwasniewski](https://togithub.com/okwasniewski) made their
first contribution in
[https://github.com/software-mansion/react-native-screens/pull/2025](https://togithub.com/software-mansion/react-native-screens/pull/2025)
- [@&#8203;uzegonemad](https://togithub.com/uzegonemad) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/2035](https://togithub.com/software-mansion/react-native-screens/pull/2035)
- [@&#8203;bakkerjoeri](https://togithub.com/bakkerjoeri) made their
first contribution in
[https://github.com/software-mansion/react-native-screens/pull/2077](https://togithub.com/software-mansion/react-native-screens/pull/2077)

#### 🙌 Thank you for your contributions!

**Full Changelog**:
software-mansion/react-native-screens@3.29.0...3.30.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: valora-bot <valorabot@valoraapp.com>
shottah referenced this pull request in zed-io/kolektivo May 15, 2024
…inc#5239)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[react-native-screens](https://togithub.com/software-mansion/react-native-screens)
| [`^3.29.0` ->
`^3.30.1`](https://renovatebot.com/diffs/npm/react-native-screens/3.29.0/3.30.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-screens/3.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-screens/3.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-screens/3.29.0/3.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-screens/3.29.0/3.30.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>software-mansion/react-native-screens
(react-native-screens)</summary>

###
[`v3.30.1`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.30.1)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.30.0...3.30.1)

Patch release addressing an issue with building a package due to the
missing submodule from `postinstall` command.

#### 🔢 Miscellaneous

- Remove postinstall step from package.json by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2081](https://togithub.com/software-mansion/react-native-screens/pull/2081)

**Full Changelog**:
software-mansion/react-native-screens@3.30.0...3.30.1

###
[`v3.30.0`](https://togithub.com/software-mansion/react-native-screens/releases/tag/3.30.0)

[Compare
Source](https://togithub.com/software-mansion/react-native-screens/compare/3.29.0...3.30.0)

Minor release including custom screen transitions, adding support for
VisionOS, supporting `slide_from_left` animation on iOS and fixing other
aspects (including wrong targets for touchable components on Fabric).
Thanks for following along! 💙

**Note**: Please note that support for React Native versions lower than
0.68 have been **dropped**. Older versions may still continue to work
with this and newer releases of react-native-screens, but bugs from
deprecated versions will not be considered for repair.

#### What's Changed

#### 👍 Improvements

- **Custom screen transitions** - In 3.30.0, we've introduced a support
for custom transition animations while making a "go back" gesture. Made
by [@&#8203;piaskowyk](https://togithub.com/piaskowyk) and
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/1913](https://togithub.com/software-mansion/react-native-screens/pull/1913)

- **Support for VisionOS is here!** - From now, react-native-screens
offers bundled support for VisionOS platform. Made by
[@&#8203;okwasniewski](https://togithub.com/okwasniewski) in
[https://github.com/software-mansion/react-native-screens/pull/2025](https://togithub.com/software-mansion/react-native-screens/pull/2025)

- **`slide_from_left` transition on iOS** - You can use
`slide_from_left` animation that will be used for pushing or popping a
new screen. Made by
[@&#8203;kirillzyusko](https://togithub.com/kirillzyusko) in
[https://github.com/software-mansion/react-native-screens/pull/2057](https://togithub.com/software-mansion/react-native-screens/pull/2057)

- Add `cancelSearch` command on SearchBar by
[@&#8203;Jasonzj](https://togithub.com/Jasonzj) in
[https://github.com/software-mansion/react-native-screens/pull/1987](https://togithub.com/software-mansion/react-native-screens/pull/1987)

- Fixed Android screen stack animation by
[@&#8203;janicduplessis](https://togithub.com/janicduplessis) in
[https://github.com/software-mansion/react-native-screens/pull/2019](https://togithub.com/software-mansion/react-native-screens/pull/2019)

#### 🐛 Bug fixes

- Not working hitslop for headerRight/Left views by
[@&#8203;kkafar](https://togithub.com/kkafar) in
[https://github.com/software-mansion/react-native-screens/pull/1995](https://togithub.com/software-mansion/react-native-screens/pull/1995)
- App freeze when navigating back from any modal nested in contained
modal by [@&#8203;kkafar](https://togithub.com/kkafar) in
[https://github.com/software-mansion/react-native-screens/pull/1996](https://togithub.com/software-mansion/react-native-screens/pull/1996)
- Incorrect safe area on transparent modals using landscape orientation
by [@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2008](https://togithub.com/software-mansion/react-native-screens/pull/2008)
- Invalid orientation of contained modals by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2011](https://togithub.com/software-mansion/react-native-screens/pull/2011)
- Modify the decorFitsSystemWindow parameter in setNavigationBarHidden
by [@&#8203;jiyong1](https://togithub.com/jiyong1) in
[https://github.com/software-mansion/react-native-screens/pull/1988](https://togithub.com/software-mansion/react-native-screens/pull/1988)
- Avoid race condition related to state on the new arch by
[@&#8203;j-piasecki](https://togithub.com/j-piasecki) in
[https://github.com/software-mansion/react-native-screens/pull/2024](https://togithub.com/software-mansion/react-native-screens/pull/2024)
- Check for multiple screens while changing screen orientation by
[@&#8203;uzegonemad](https://togithub.com/uzegonemad) in
[https://github.com/software-mansion/react-native-screens/pull/2035](https://togithub.com/software-mansion/react-native-screens/pull/2035)
- Fix setting incorrect measure with native header by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) and
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2028](https://togithub.com/software-mansion/react-native-screens/pull/2028)
- Add notifying for header height change, fix header height values by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2075](https://togithub.com/software-mansion/react-native-screens/pull/2075)
- Change context while running `runOnUiQueueThread` on 0.73 with
Bridgeless by [@&#8203;cortinico](https://togithub.com/cortinico) in
[https://github.com/software-mansion/react-native-screens/pull/2022](https://togithub.com/software-mansion/react-native-screens/pull/2022)
- Use reactApplicationContext in onScreenChanged by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2046](https://togithub.com/software-mansion/react-native-screens/pull/2046)
- Remove calculating status bar height in useAnimatedHeaderHeight when
header is not shown by [@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2033](https://togithub.com/software-mansion/react-native-screens/pull/2033)
- Handle setting `display` for `_viewConfig` attribute by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) and
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2071](https://togithub.com/software-mansion/react-native-screens/pull/2071)
- Fix crash with searchResultsController in RNSSearchBar by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2004](https://togithub.com/software-mansion/react-native-screens/pull/2004)
- Add constraints for velocity in `goBackGesture` screen transition by
[@&#8203;piaskowyk](https://togithub.com/piaskowyk) in
[https://github.com/software-mansion/react-native-screens/pull/2061](https://togithub.com/software-mansion/react-native-screens/pull/2061)
- Add view check for getting StackView in `goBackGesture` by
[@&#8203;piaskowyk](https://togithub.com/piaskowyk) in
[https://github.com/software-mansion/react-native-screens/pull/2060](https://togithub.com/software-mansion/react-native-screens/pull/2060)
- Change default value of context of ScreenGestureDetector, add warning
for goBackGesture by [@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2013](https://togithub.com/software-mansion/react-native-screens/pull/2013)
- Move GHContext from gesture-handler to native-stack by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2017](https://togithub.com/software-mansion/react-native-screens/pull/2017)
- Change default gesture from Tap to Fling, fix failing CI by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2023](https://togithub.com/software-mansion/react-native-screens/pull/2023)

#### 🔢 Miscellaneous

- **Drop React Native 0.64 - 0.67 since 3.30.0** by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2036](https://togithub.com/software-mansion/react-native-screens/pull/2036)
- Remove mixed CJS/ESM, refactorize index.native.tsx by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/1982](https://togithub.com/software-mansion/react-native-screens/pull/1982)
- Add react-navigation as submodule & use it in test applications by
[@&#8203;kkafar](https://togithub.com/kkafar) and
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/1993](https://togithub.com/software-mansion/react-native-screens/pull/1993)
- Unify member-field naming convention in Kotlin by
[@&#8203;kkafar](https://togithub.com/kkafar) in
[https://github.com/software-mansion/react-native-screens/pull/1999](https://togithub.com/software-mansion/react-native-screens/pull/1999)
- Update compatibility table with supported RN versions with Fabric by
[@&#8203;kkafar](https://togithub.com/kkafar) in
[https://github.com/software-mansion/react-native-screens/pull/2001](https://togithub.com/software-mansion/react-native-screens/pull/2001)
- Change name of `headerBackButtonClicked` event by
[@&#8203;WoLewicki](https://togithub.com/WoLewicki) in
[https://github.com/software-mansion/react-native-screens/pull/2015](https://togithub.com/software-mansion/react-native-screens/pull/2015)
- Stabilize Android E2E tests by
[@&#8203;kirillzyusko](https://togithub.com/kirillzyusko) in
[https://github.com/software-mansion/react-native-screens/pull/2062](https://togithub.com/software-mansion/react-native-screens/pull/2062)
- Update Podfiles in Example projects, update RN in FabricExample to
0.73 by [@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/1989](https://togithub.com/software-mansion/react-native-screens/pull/1989)
- Update React Native to 0.73.4, change Cocoapods version by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2032](https://togithub.com/software-mansion/react-native-screens/pull/2032)
- Configure yarn version in package.json by
[@&#8203;bakkerjoeri](https://togithub.com/bakkerjoeri) in
[https://github.com/software-mansion/react-native-screens/pull/2077](https://togithub.com/software-mansion/react-native-screens/pull/2077)
- Bump ip from 1.1.8 to 1.1.9 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/software-mansion/react-native-screens/pull/2038](https://togithub.com/software-mansion/react-native-screens/pull/2038)
- Bump ip from 1.1.8 to 1.1.9 in example apps by
[@&#8203;tboba](https://togithub.com/tboba) in
[https://github.com/software-mansion/react-native-screens/pull/2044](https://togithub.com/software-mansion/react-native-screens/pull/2044)

#### New Contributors

- [@&#8203;jiyong1](https://togithub.com/jiyong1) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/1988](https://togithub.com/software-mansion/react-native-screens/pull/1988)
- [@&#8203;Jasonzj](https://togithub.com/Jasonzj) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/1987](https://togithub.com/software-mansion/react-native-screens/pull/1987)
- [@&#8203;j-piasecki](https://togithub.com/j-piasecki) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/2024](https://togithub.com/software-mansion/react-native-screens/pull/2024)
- [@&#8203;cortinico](https://togithub.com/cortinico) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/2022](https://togithub.com/software-mansion/react-native-screens/pull/2022)
- [@&#8203;okwasniewski](https://togithub.com/okwasniewski) made their
first contribution in
[https://github.com/software-mansion/react-native-screens/pull/2025](https://togithub.com/software-mansion/react-native-screens/pull/2025)
- [@&#8203;uzegonemad](https://togithub.com/uzegonemad) made their first
contribution in
[https://github.com/software-mansion/react-native-screens/pull/2035](https://togithub.com/software-mansion/react-native-screens/pull/2035)
- [@&#8203;bakkerjoeri](https://togithub.com/bakkerjoeri) made their
first contribution in
[https://github.com/software-mansion/react-native-screens/pull/2077](https://togithub.com/software-mansion/react-native-screens/pull/2077)

#### 🙌 Thank you for your contributions!

**Full Changelog**:
software-mansion/react-native-screens@3.29.0...3.30.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone
America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone
America/Los_Angeles.

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/valora-inc/wallet).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: valora-bot <valorabot@valoraapp.com>
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
There was some issues with android animation, the root cause is the
drawing order, not the actual animations. This reverts the changes to
the animations so it matches stock android ones and always reverse
drawing order for android api 33+.

Revert the animation changes in
software-mansion@00543fb
and
software-mansion@05f4dd7.

Return true from needsDrawReordering when api 33+.

Here you can add screenshots / GIFs documenting your change.

You can add before / after section if you're changing some behavior.

Api 33

https://github.com/software-mansion/react-native-screens/assets/2677334/8777838c-a2bb-4e43-bcc2-a9a51926eeb9

The mitigations for wrong drawing order makes it kind of hard to see the
issue, but going frame by frame we can see the animation is weird
initially

<img width="286" alt="image"
src="https://github.com/software-mansion/react-native-screens/assets/2677334/90b09c7c-4a56-44fb-b84e-7a6162c75a2c">

Api 31

https://github.com/software-mansion/react-native-screens/assets/2677334/2df2eaaa-92ef-4bc0-9ef5-e64e241a38d3

Api 33

https://github.com/software-mansion/react-native-screens/assets/2677334/2588241b-9536-4726-aacc-dca7facb32ad

We can now see that the new screen is actually drawn on top of the old
one so it looks better during the initial fade.

<img width="298" alt="image"
src="https://github.com/software-mansion/react-native-screens/assets/2677334/2a6c1fd5-0079-4f21-aa4e-1ddff4569296">

Tested in example app

- [x] 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
- [x] Ensured that CI passes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants