Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't trigger ComposeUnstableCollections when unstable collection is used in preview #351

Open
carstenhag opened this issue May 27, 2024 · 1 comment

Comments

@carstenhag
Copy link

carstenhag commented May 27, 2024

I have something like this in use:

private class ButtonParameter : PreviewParameterProvider<List<Any?>> {
    override val values: Sequence<List<Any?>>
        get() = sequenceOf(
            listOf<Any?>("Very, very long button text that takes two lines", R.drawable.ic_charge, true, false),
            listOf<Any?>("Button", null, true, false),
...

fun ButtonSecondaryPreview(@PreviewParameter(ButtonParameter::class) properties: List<Any?>)

The linter complains about this and in normal code this would be great, but I don't really see the point of changing it in previews. Just takes a bit of time, but it's not time spent effectively apart from making the linter happy.

@ZacSweers
Copy link
Collaborator

PR is welcome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants