Peter
09/12/2023, 12:26 PM@Preview
@Composable
fun Preview(@PreviewParameter(LoremIpsum::class) text: String) {
Text(text)
}
Peter
09/12/2023, 12:33 PMtext.take(100)
? Or is there smth else I'm missing?Peter
09/12/2023, 12:35 PM@PreviewParameter(LoremIpsum::class, limit = 100)
to select number of words? Bug?xoangon
09/12/2023, 8:33 PMLorenIpsum
class provide 100 words. This logic must be in the values
property of the class that implements PrevierParameterProviderStylianos Gakis
09/12/2023, 8:51 PMStylianos Gakis
09/12/2023, 8:53 PM@PreviewParameter(LoremIpsum::class, limit = 100)
question goes.
The limit there is for the number of previews you’ll be rendering. LoremIpsum does not render 100 previews all with different texts. It gives back 1 String value. So the limit 100 does nothing since you are only getting 1 value off of it anyway.Stylianos Gakis
09/12/2023, 8:55 PMtake(X)
as you said, just to fit your UI, should work just fine for now. Unless there’s a way to do this that I am not aware of.xoangon
09/12/2023, 8:57 PMLorenIpsum
class was something that @Peter had defined in his project. LMAO that this class is actually provided by Compose UI. Thanks for that cs link @Stylianos Gakis!Peter
09/12/2023, 8:58 PMLoremIpsum
supports it via constructor.Stylianos Gakis
09/12/2023, 8:59 PMxoangon
09/12/2023, 9:00 PMLorenIpsum
class could be way more useful by providing a way to configure itPeter
09/12/2023, 9:03 PMPeter
09/13/2023, 8:11 AMStylianos Gakis
09/13/2023, 8:16 AMPeter
09/13/2023, 8:17 AMPeter
09/13/2023, 8:34 AMColton Idle
09/13/2023, 9:33 AMStylianos Gakis
09/13/2023, 9:35 AMPeter
09/13/2023, 9:39 AM