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

Julius Marozas

09/05/2020, 1:26 PM
Why can I only decorate one parameter with
@PreviewParameter
? Is this going to change in the future?
a

Adam Powell

09/05/2020, 2:29 PM
@nosuid
y

Yashovardhan

09/05/2020, 3:08 PM
The main reason I think behind this is because they don't know how you want the parameters to interact with each other. Say you have 2 parameters - a Boolean for dark/light theme and a text provider with 2 values. Now should that result in 4 different previews (2 light theme with 1st text and 2 dark with the 2nd) or just 2 previews (light theme with 1st text, dark theme with other)
j

Julius Marozas

09/05/2020, 3:19 PM
Yeah, that makes sense. Still, I think the current approach of combining providers is too cumbersome.
y

Yashovardhan

09/05/2020, 3:23 PM
It's basically combining sequences so yeah. I think you can write a generic class for combining 2 preview providers into one and then use it. But if you have more than 3 parameters that can be difficult
4 Views