element-hq / element-hq/element-x-android
Improve Appyx navigation with modals and other custom states
- Lingua principale
- Kotlin
- Stelle
- 2.4k
- Fork
- 624
- Merge medio
- 1g 14h
- PR unite (30g)
- 149
Descrizione
One of my tickets had 'present the screen as a modal' (bottom to top, overlaying the existing content) as a nice to have. I realised this wasn't possible with the current implementation of our navigation. Here is an explanation of the issue:
> You can only have 1 TransitionHandler per ParentNode, so in a backstack or some other FlowNode you can only have 1 type of animation, unless this custom handler is specially clever and knows when to apply different animations for different custom states, which we currently don't have.
Two possible solutions to this issue are:
1. Appyx has the concept of a CombinedNavModel so you can create a Backstack and some other NavModel (such as a ModalNavModel) and concatenate them and use them independently while in the same FlowNode/ParentNode.
2. Another option would be to extend the Backstack NavModel and create a custom one that works as a Backstack but also has the concept of modal screens and a state of 'being presented' and 'being overlayed' so they don't break the animations.
This is something we should explore as in the future we'll surely run into cases where we need some complex navigation that a simple backstack can't handle. We think the 2nd option above is probably the best one, although we'd need to double check if complex interactions would be possible (like launching another backstack inside the modal).
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.