alexandrepiveteau
11/03/2020, 12:26 AM@Composable fun
that is effectively inlined (and without a group) ?
I have a UI with a flat hierarchy and would like to factorise some of the logic in different functions, knowing that exactly one of these will be called no matter what the input parameters are. The pattern I’d like to achieve is similar to this Gist : https://gist.github.com/alexandrepiveteau/47a18b29a6bd9cc2fcd2d347bc8f4a44.
While looking into this, I’ve stumbled on @ComposableContract(readonly = true)
, which “does not generate a group around the body of the function it annotates”, and I feel like is kind of what I’d need. However, the documentation clearly states that it is “not safe unless […] composer only executes read operations”. What’s exactly a “write” operation for a composer ? And is there a better way to achieve what I’m trying to do than using @ComposableContract(readonly = true)
?alexandrepiveteau
11/03/2020, 12:28 AM@Composable fun
, but would like to enable drag and drop of individual stickies between columns, with continuous animations. Ideally, I’d still like to factorise some of the code (for instance the stack positioning logic) in dedicated functions, while simultaneously keeping all the stickies at the same “level” in my composable hierarchy. The WIP source code is at https://github.com/heig-IHM/stickies)Zach Klippenstein (he/him) [MOD]
11/03/2020, 2:15 AMChuck Jazdzewski [G]
11/03/2020, 5:08 PMif
statement at all indicates that, even if the group was removed from the call, at least one group is necessary.