This repository has been archived by the owner on Feb 25, 2020. It is now read-only.
Prevent previous screen fade out on push/pop on Android #73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When animating new screen in on Android we used to, by default, fade out the previously displayed screen. Then when going back to it it would fade in from 0 to 1. This seem to be not how the default screen animation on Android performs and has also an additional consequence that the app background is partially visible during screen transition. It is because during transition both the transitioning in and transitioning out views are semi transparent.
Motivation
Make Android default screen transition alike platform default one and also fix the problem when app background can be seen during transition.
CAUTION
This is potentially breaking change as it changes the default animation configuration on Android.
Notes
Note that there is another issue related to opacity not blending correctly when stack animation in ongoing. This causes the card background "flashes" and can be mitigated by setting
cardStyle: { backgroundColor: 'YOUR-SCREEN_BG' }
in navigation config. When using react-native-screens the correct blending is applied for the duration of animation and hence resolves this problem completely.Test plan
To illustrate the change I changed app background to green to make it easier to see. Here is what changes:
OLD TRANSITION IN:
![without-fadein](https://user-images.githubusercontent.com/726445/50221425-5c983480-0395-11e9-96ee-6890ccfe2cdb.png)
OLD TRANSITION OUT:
![without-fadeout](https://user-images.githubusercontent.com/726445/50221412-52763600-0395-11e9-95d5-54c6fa8f079e.png)
NEW TRANSITION IN:
![with-fadein](https://user-images.githubusercontent.com/726445/50221320-04f9c900-0395-11e9-8c99-20deeba2277e.png)
NEW TRANSITION OUT:
![with-fadeout](https://user-images.githubusercontent.com/726445/50221319-02976f00-0395-11e9-8685-6bf8d1a32191.png)