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

Blur effect applied after a few hundred milliseconds #19

Open
ivevasiljevic opened this issue Feb 8, 2024 · 1 comment
Open

Blur effect applied after a few hundred milliseconds #19

ivevasiljevic opened this issue Feb 8, 2024 · 1 comment

Comments

@ivevasiljevic
Copy link

Please complete the following information:

  • Library Version 0.1.2
  • Google Pixel 4a 5G, Android v.14

Describe the Bug:

I applied a blur effect to my Text Composables as such:

Cloudy { Text( modifier = Modifier.padding(2.dp), text = stringResource(id = previewTransaction.companyName), style = Typography.b1MediumTextStyle, color = Grey500 ) }

As it turns out after my loading indicator is gone, and the content is showed, the effect takes a bit of time to show up, or to be applied. I am wondering why is this happening. Is the implementation intended as such?

Expected Behavior:

I expect the blur effect to be applied immediately, or calculated as the views are being composed.

@shahzadansari
Copy link

Following. Even though it's not much but there is a slight delay between Loading and Success states. But I guess since Bitmap is being drawn, this might be unavoidable. Adding a sample for repro.

@Composable
fun Sample() {
    Box(modifier = Modifier.fillMaxSize()) {
        var showDialog by remember { mutableStateOf(false) }

        Cloudy(
            radius = if (showDialog) 10 else 0,
            content = {
                Text(text = "a".repeat(1200))
            }
        )

        if (showDialog) {
            Box(
                modifier = Modifier
                    .size(200.dp)
                    .background(Color.Green)
                    .align(Alignment.Center)
            )
        }

        Button(
           onClick = { showDialog = !showDialog }, 
           modifier = Modifier.align(Alignment.BottomCenter), 
           content = { Text(text = "Toggle") }
        )
    }
}
repro.mp4

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