You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments