Hey guys! I'm getting this exception when I rapidl...
# compose
m
Hey guys! I'm getting this exception when I rapidly swipe my Vertical Pager.
Copy code
java.lang.IllegalStateException: Offset is unspecified
at androidx.compose.ui.geometry.Offset.getX-impl(Offset.kt:67)
Code is
Copy code
val pageOffset= state.getOffsetFractionForPage(page)
            .graphicsLayer {
                        val offscreenDown = pageOffset < 0f
                        val deg = 105f
                        val interpolated = FastOutLinearInEasing.transform(pageOffset.absoluteValue)
                        rotationX = min(interpolated * if (offscreenDown) -deg else deg, 90f)
                        transformOrigin = TransformOrigin(
                            pivotFractionX = .5f,
                            pivotFractionY = if (offscreenDown) 0f else 1f
                        )
                    }
Added this logic in .graphics layer to have some animation while changing the page.
s
@levima
a
any sample app which uses the new
getOffsetFractionForPage
using newer compose version notice stuttering of animation for something similar of a code where i tweak XOffset on page scroll
m
anyhow, I have resolved it by reducing the deg = 105 to 75. It works fine now 🌟
👍 2