I am using AdapterList in Android Jetpack Compose. In list I have clickable component. When I start scrolling without untouch and go out of that AdapterList, It's crashing. It might be library issue.
Thanks in Advance.
I am using...
//Jetpack Component
implementation 'androidx.ui:ui-framework:0.1.0-dev09'
implementation 'androidx.ui:ui-layout:0.1.0-dev09'
implementation 'androidx.ui:ui-material:0.1.0-dev09'
implementation 'androidx.ui:ui-foundation:0.1.0-dev09'
implementation 'androidx.ui:ui-tooling:0.1.0-dev09'
AdapterList
AdapterList(data = model.seats, modifier = Modifier.weight(1f).fillMaxSize()) { seat ->
ItemSeat(seat)}
ListItem
@Composable
fun ItemSeat(seat: Seat) {
Clickable(onClick = {},
modifier = Modifier.drawBackground(color = colorResource(id = R.color.color_cd3f34))
.fillMaxWidth()) {
Text(text = "Seat ${seat.no}")
}
}
Crash Logs
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nextorder.pos, PID: 4821
java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true
at androidx.ui.core.LayoutNodeWrapper.localToRoot(LayoutNodeWrapper.kt:169)
at androidx.ui.core.LayoutNodeWrapper.localToGlobal(LayoutNodeWrapper.kt:165)
at androidx.ui.core.pointerinput.PointerInputFilter.getPosition$ui_platform_release(PointerInput.kt:100)
at androidx.ui.core.pointerinput.Node.dispatchChanges(HitPathTracker.kt:326)
at androidx.ui.core.pointerinput.Node.dispatchChanges(HitPathTracker.kt:332)
at androidx.ui.core.pointerinput.Node.dispatchChanges(HitPathTracker.kt:332)
at androidx.ui.core.pointerinput.Node.dispatchChanges(HitPathTracker.kt:332)
at androidx.ui.core.pointerinput.Node.dispatchChanges(HitPathTracker.kt:332)
at androidx.ui.core.pointerinput.Node.dispatchChanges(HitPathTracker.kt:332)
at androidx.ui.core.pointerinput.Node.dispatchChanges(HitPathTracker.kt:332)
at androidx.ui.core.pointerinput.Node.dispatchChanges(HitPathTracker.kt:332)
at androidx.ui.core.pointerinput.NodeParent.dispatchChanges(HitPathTracker.kt:194)
at androidx.ui.core.pointerinput.HitPathTracker.dispatchChanges(HitPathTracker.kt:100)
at androidx.ui.core.pointerinput.HitPathTracker.dispatchChanges$default(HitPathTracker.kt:91)
at androidx.ui.core.pointerinput.PointerInputEventProcessor.process(PointerInputEventProcessor.kt:67)
at androidx.ui.core.AndroidComposeView.onTouchEvent(AndroidOwner.kt:648)
at android.view.View.dispatchTouchEvent(View.java:13471)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3216)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2888)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3222)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2904)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:754)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1879)
at android.app.Activity.dispatchTouchEvent(Activity.java:3494)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:712)
at android.view.View.dispatchPointerEvent(View.java:13719)
As of dev15 version, AdapterList
has been deprecated in favor of LazyColumnFor
. The issues you pointed should be fixed if you use LazyColumnFor.
It was a known issue and has been fixed in dev14
(the current version)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With