Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: android screen stack animation (#2019)
## 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
- Loading branch information