Fixed
Status Update
Comments
ni...@google.com <ni...@google.com>
ma...@google.com <ma...@google.com>
ap...@google.com <ap...@google.com> #2
I hit this exact stacktrace too. I have a pretty simple app with the only complex screen being a lazygrid layout. not sure what the root cause here could be.
na...@google.com <na...@google.com> #3
As you can see it's been a long time and they do not even answer.
The workaround that is still needed is simple. Since this is a relatively rare issue and not a single user ever contacted about that issue before or after the workaround I guess it's good enough for now.
@SuppressLint("RestrictedApi")
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
return runCatching { super.dispatchKeyEvent(event) }.getOrDefault(false)
}
Description
LazyList has a SnapInfoProvider that we can import and pass into a LazyList to get snapping behavior, but there isn't one for LazyGrid.https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/gestures/snapping/LazyListSnapLayoutInfoProvider.kt?q=snapping%20-f:test%20l:kt
demo:https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/snapping/LazyGridSnapLayoutInfoProvider.kt