-
-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Android): separate transitions of sheet and dimming view (#2542)
## Description This PR allows the form sheet on Android to be dismissed using `slide-down` animation. Currently the sheet fades-out together with the dimming view due to using regular [Tween animations](https://developer.android.com/guide/topics/resources/animation-resource#Tween), which apply animation whole view hierarchy from the fragment's root view down - this does not allow for separate animations for the sheet and dimming view. `Transition API` was considered as an implementation measure, however due to numerous encountered problems, most prominent example being "disappearing shadows during pop transitions", I rejected it. The implementation settled on using custom value / object evaluators. This approach comes with its own series of issues, with the most prominent one: * on old architecture the fragment transaction execution (transition) starts before initial frame for content wrapper is received - I decided to defer the transaction to the moment of receiving the layout. > [!caution] This PR changes current default animation for formsheets on Android. This is potentially a breaking change. I haven't decided yet whether to treat is as a fix or hide this new animation behind some prop. WIP recordings of the changes. ## Changes * Form Sheet screens use now custom animators instead of tween animation (`setCustomTransition`) defined in `ScreenStack.onUpdate`. * Removed `DimmingFragment` as there is no longer "nested fragment strcuture". Dimming view is now attached directly into hierarchy (under coordinator layout) w/o hosting it in separate fragment. * Refactored native dismiss code > [!note] During testing I've noticed that for some reason the form sheet screens do not receive `onWill(dis)appear` events on navigator. This is something to investigate, however it seems that this is not a regression. ## Test code and steps to reproduce `TestFormSheet` / `TestAndroidTransitions` examples ## Checklist - [x] Included code example that can be used to test this change - [x] Ensured that CI passes
- Loading branch information
Showing
14 changed files
with
595 additions
and
534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.