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

Shared element composable inside LazyRow crashes while scrolling horizontally #14

Closed
Yash-Garg opened this issue Aug 28, 2022 · 2 comments

Comments

@Yash-Garg
Copy link

Please complete the following information:

  • Library Version - v0.2.2
  • Test Device(s) - Emulator with Android 13, Poco F1 with Android 12

Describe the Bug:

How do I handle the shared element transition of a composable within a LazyRow?
The app just crashes when I try to scroll through the row, the transition works fine as intended.

Expected Behavior:

The LazyRow should scroll horizontally, but instead crashes.

Stacktrace:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: app.test.compose, PID: 3603
    java.lang.IllegalStateException: Check failed.
        at androidx.compose.ui.node.LayoutNodeLayoutDelegate$LookaheadPassDelegate.replace(LayoutNodeLayoutDelegate.kt:1045)
        at androidx.compose.ui.node.LayoutNode.lookaheadReplace$ui_release(LayoutNode.kt:829)
        at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout-0kLqBqw(MeasureAndLayoutDelegate.kt:352)
        at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout-0kLqBqw(AndroidComposeView.android.kt:783)
        at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$precompose$1.premeasure-0kLqBqw(SubcomposeLayout.kt:671)
        at androidx.compose.foundation.lazy.layout.LazyLayoutPrefetcher.run(LazyLayoutPrefetcher.android.kt:187)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7898)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
@sphrak
Copy link

sphrak commented Aug 29, 2022

@Yash-Garg I don't think any of the lazy Column/Row/Grid APIs are supported yet

@Yash-Garg
Copy link
Author

@Yash-Garg I don't think any of the lazy Column/Row/Grid APIs are supported yet

Ah, okay. Thank you for the quick response!

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