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

offsetMillis in Compose #627

Open
JavierSegoviaCordoba opened this issue Nov 7, 2022 · 4 comments
Open

offsetMillis in Compose #627

JavierSegoviaCordoba opened this issue Nov 7, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@JavierSegoviaCordoba
Copy link

A function that includes offsetMillis is missing for Compose.

It should be great if it could be added, and instead of using a Long it uses Duration.

snapshot functions can be mixed with the View one. Maybe the Gradle plugin can take an enum so:

enum class UiSystem {
    Compose,
    View,
    Both,
}

This would allow to Paparazzi Gradle plugin to only apply one library if the consumer is not using both systems, and that can enable splitting the Paparazzi snapshot functions into different modules, per system. or both.

@JavierSegoviaCordoba JavierSegoviaCordoba added the enhancement New feature or request label Nov 7, 2022
@alashow
Copy link

alashow commented Dec 22, 2022

For some reason I expected this to work but it doesn't:

fun Paparazzi.snapshot(
    name: String? = null,
    offsetMillis: Long = 0L,
    composable: @Composable () -> Unit,
) {
    val hostView = ComposeView(context)
    hostView.setContent(composable)
    snapshot(hostView, name, offsetMillis)
}

@ArcaNO93
Copy link

@jrodbx
code snippet provided by @alashow does not work for me either
can you please confirm whether the offsetMillis param works for compose?

@Burtan
Copy link

Burtan commented Jun 30, 2024

I cannot get animations to work either in compose (showing snackbars). It works when using @Preview in interactive mode.

@leo-beliakov
Copy link

@jrodbx Any updates on this?

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

No branches or pull requests

5 participants