https://kotlinlang.org logo
Title
k

Kyant

01/30/2022, 3:54 PM
How to fix the position of composables even if a composable changes size? 🤔 Should I customize a layout?
a

Adam Powell

01/30/2022, 4:28 PM
Fix them to what? What's the code you'd like to be able to write and what output do you want it to produce?
k

Kyant

01/30/2022, 5:19 PM
I have a Surface in a scrollable column, when I change the size (bigger) and offset (up) of the Surface, the things below it will move down. And I want the things below the Surface won't be moved, let their positions identical to those before resizing.
a

Adam Powell

01/30/2022, 5:23 PM
oh, then yes, offsets are applied after layout and do not affect sibling layout. You might indeed have a better time using the
Layout
composable to coordinate exactly what you want here.
k

Kyant

01/30/2022, 5:24 PM
Can I "lift" the Surface out of its parent layout at runtime?
a

Adam Powell

01/30/2022, 5:27 PM
looks like you're looking for the shared element transition features that are currently underway for making this easier to write. You can do it manually but it's kind of involved.
k

Kyant

01/30/2022, 5:29 PM
Will it be supported in the official library?😲
I have tried a shared element library, but the code is outdated 😅, hard to use.
a

Adam Powell

01/30/2022, 5:42 PM
yeah there's work in progress for it