Join Slack
Powered by
I am new in android development. Can anybody expla...
# compose
a
amar_1995
11/06/2019, 6:39 AM
I am new in android development. Can anybody explain with effect the impact of column vs flexcolumn, row vs flexRow, flexible vs inflexible. I am not able to understand when to use what.
l
Luca Nicoletti
11/06/2019, 8:32 AM
Don’t worry,
Flex
are most likely to go away
Luca Nicoletti
11/06/2019, 8:33 AM
reference:
https://kotlinlang.slack.com/archives/CJLTWPH7S/p1571428992170600?thread_ts=1571428359.169900&cid=CJLTWPH7S
a
amar_1995
11/06/2019, 10:02 AM
And what is the purpose of flexible and inflexible ?
a
Anastasia [G]
11/06/2019, 12:03 PM
Let's say you want to have two components in a row - one with a defined size (e.g. image) and the other one should take all of the remaining space (e.g. text field). For the image you just specify the size and keep it inflexible (which is a default) so it will be of that size. But to express in the code that textfield "should occupy the remaining space" you use Flexible(1f) modifier. You can find examples with the explanations here
https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-master-dev/ui/ui-layout/integration-tests/samples/src/main/java/androidx/ui/layout/samples/FlexSample.kt?autodive=0%2F%2F%2F%2F%2F#90
6
Views
Open in Slack
Previous
Next