skydoves / Cloudy

☁️ Jetpack Compose blur effect library, which falls back onto a CPU-based implementation to support older API levels.
Apache License 2.0
840 stars 30 forks source link

HorizontalPager scroll next page crash #21

Closed BlueSky15171 closed 4 months ago

BlueSky15171 commented 8 months ago

Please complete the following information:

Describe the Bug: java.lang.RuntimeException: Failed to copy pixels of the given bitmap! at com.skydoves.cloudy.CloudyKt.drawBitmapWithPixelCopy$lambda$7(Cloudy.kt:281) at com.skydoves.cloudy.CloudyKt.$r8$lambda$X2Nw-BPO6_ca_Hnlrx5we4hyARg(Unknown Source:0) at com.skydoves.cloudy.CloudyKt$$ExternalSyntheticLambda0.onPixelCopyFinished(Unknown Source:6) at android.view.PixelCopy$1.run(PixelCopy.java:191) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7723) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@459a31, androidx.compose.runtime.BroadcastFrameClock@583c516, StandaloneCoroutine{Cancelling}@42bce97, AndroidUiDispatcher@f632884]

Expected Behavior: HorizontalPager scroll next page crash

HorizontalPager{ LazyVerticalGrid(scroll = false) }

how can fix this?

skydoves commented 4 months ago

Hey @BlueSky15171, the new version 0.2.0 has been released, and now you can resolve this issue by using the Modifier.cloudy modifier instead of the Cloudy composable function.