Pablo
02/21/2024, 2:07 PMFilip Wiesner
02/21/2024, 2:16 PMPablo
02/21/2024, 2:50 PMPablo
02/21/2024, 2:51 PMPablo
02/21/2024, 2:51 PMFilip Wiesner
02/21/2024, 2:56 PMIn all the samples I'm seeing when learning compose, even in android official courses, they use fixed size, for example, an Image gets a Modifier.size(72.dp). I can't understant why that should be a good strategy.It's in official courses because that's what you are supposed to do. If you insist on percentage sizes, the
weight
and `fillMaxSize(ratio)`/`fillMaxWidth(ratio)` is probably what you want.Pablo
02/21/2024, 2:57 PMFilip Wiesner
02/21/2024, 2:58 PMSP
for text. You could use DP and SP interchangeably in view system if I remember correctly. But I haven't touched Views for a long time nowPablo
02/21/2024, 2:58 PMPablo
02/21/2024, 2:59 PMFilip Wiesner
02/21/2024, 2:59 PMFilip Wiesner
02/21/2024, 3:02 PMPablo
02/21/2024, 3:07 PMPablo
02/21/2024, 3:08 PMPablo
02/21/2024, 3:09 PMPablo
02/21/2024, 3:09 PMFilip Wiesner
02/21/2024, 3:14 PMweight
and `fillMaxSize(ratio)`/`fillMaxWidth(ratio)`. Or you can create your own custom layouts that can work better with percentages.Pablo
02/21/2024, 4:20 PMPablo
02/21/2024, 4:22 PMPablo
02/22/2024, 1:15 PM