https://kotlinlang.org logo
#compose
Title
# compose
a

Adam Powell

02/01/2020, 2:40 PM
WIP
❤️ 1
🚀 1
i

Ian Warwick

02/01/2020, 2:50 PM
nice one so I won't worry about that myself then 😄 will it be good for undo/redo scenarios as well as back stack poppin' and all that? 🙂
actually of course it would be, looking forward to that nice 👍
a

Adam Powell

02/01/2020, 3:09 PM
undo/redo is likely to be more about the data backing your composition rather than the composition itself, curious what you have in mind there
back stack too, for similar reasons
though integrations with the arch components navigation library are inevitable there 🙂
i

Ian Warwick

02/01/2020, 4:22 PM
Actually yes undo/redo is more of a data thing but the concept of going from one screen to another and back again is something we are used to with activities and the back stack, just wondering how that would be in compose and was thinking one way to achieve "going back" is to save a composition before replacing it with a new one.
a

Adam Powell

02/01/2020, 4:41 PM
sort of, but that mental model carries some other baggage. A composition without the data that created it isn't really a, "live" UI anymore
and a composition is always a function of the data that created it
i

Ian Warwick

02/01/2020, 4:43 PM
ok though what about data created inside a composition via
remember
?
a

Adam Powell

02/01/2020, 4:43 PM
the scope of that data is dependent on where it is in the composition. If you
remember
something above the point where you do your nagivation, it will persist.
i

Ian Warwick

02/01/2020, 4:44 PM
aha nice yeh 🙂
ah ok above
z

Zsolt

02/01/2020, 5:44 PM
@Ian Warwick if you need back stack functionality, compose-router already has that along with scoped savedinstancestate
i

Ian Warwick

02/01/2020, 5:59 PM
yeh nice I saw that @Zsolt its quite cool cheers
2 Views