• ziv kesten

    ziv kesten

    1 year ago
    I get a crush when i try to scroll fast using
    collectAsLazyPagingItems.
    compose versons: compose_version = ‘1.0.0-alpha07’ nav_compose_version =‘1.0.0-alpha02’ paging_compose_version = ‘1.0.0-alpha02’ The crash is:
    com.zk.trackshows E/AndroidRuntime: FATAL EXCEPTION: main
        Process: com.zk.trackshows, PID: 22201
        java.lang.IllegalArgumentException: Layer is redrawn for LayoutNode in state NeedsRelayout [LayoutNode@56ee45a children: 1 measureBlocks: androidx.compose.ui.layout.SubcomposeLayoutState$createMeasureBlocks$1@772aaf4]
            at androidx.compose.ui.node.LayerWrapper.invoke(LayerWrapper.kt:167)
            at androidx.compose.ui.node.LayerWrapper.invoke(Unknown Source:3)
            at androidx.compose.ui.platform.RenderNodeApi29$record$1$1.invoke(RenderNodeApi29.kt:159)
            at androidx.compose.ui.platform.RenderNodeApi29$record$1$1.invoke(Unknown Source:0)
            at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:1721)
            at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:128)
            at androidx.compose.ui.platform.AndroidComposeView.observeLayerModelReads(AndroidComposeView.kt:494)
            at androidx.compose.ui.platform.RenderNodeApi29.record(RenderNodeApi29.kt:158)
            at androidx.compose.ui.platform.RenderNodeLayer.updateDisplayList(RenderNodeLayer.kt:192)
            at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(AndroidComposeView.kt:563)
            at android.view.View.draw(View.java:22175)
            at android.view.View.updateDisplayListIfDirty(View.java:21024)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4441)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4414)
            at android.view.View.updateDisplayListIfDirty(View.java:20984)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4441)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4414)
            at android.view.View.updateDisplayListIfDirty(View.java:20984)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4441)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4414)
            at android.view.View.updateDisplayListIfDirty(View.java:20984)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4441)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4414)
            at android.view.View.updateDisplayListIfDirty(View.java:20984)
            at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4441)
            at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4414)
            at android.view.View.updateDisplayListIfDirty(View.java:20984)
            at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:582)
            at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:588)
            at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:665)
            at android.view.ViewRootImpl.draw(ViewRootImpl.java:4048)
            at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3757)
            at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3026)
            at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1963)
            at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8237)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
            at android.view.Choreographer.doCallbacks(Choreographer.java:1041)
            at android.view.Choreographer.doFrame(Choreographer.java:953)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1220)
            at android.os.Handler.handleCallback(Handler.java:883)
            at android.os.Handler.dispatchMessage(Handler.java:100)
            at android.os.Looper.loop(Looper.java:214)
            at android.app.ActivityThread.main(ActivityThread.java:7711)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
    The crash does not happen when scrolling slowly. I am using RemoteMediator with local and remote data sources.
    ziv kesten
    Andrey Kulikov
    2 replies
    Copy to Clipboard
  • v79

    v79

    1 year ago
    Just started having a look at Jetback compose.... decided it's not for me when I saw a variable declaration as `
    val count = remember { mutableStateOf(0) }
    I mean, what does that even mean? What's wrong with
    var count = 0
    or
    val count: IntWrapper = IntWrapper(0)
    .
    remember
    isn't listed as in import, control-clicking doesn't take me to a declaration. It's wilfully obtuse!
    v79
    Archie
    +2
    11 replies
    Copy to Clipboard
  • Nat Strangerweather

    Nat Strangerweather

    1 year ago
    Does anybody know where I can find out how to pass a variable from one Composable to another?
    Nat Strangerweather
    j
    +1
    17 replies
    Copy to Clipboard
  • Shakil Karim

    Shakil Karim

    1 year ago
    I am facing performance issues on some devices while using Compose, Specially on scrolling, Is it a known issue?
    Shakil Karim
    Adam Powell
    2 replies
    Copy to Clipboard
  • carbaj0

    carbaj0

    1 year ago
    java.lang.NoSuchMethodError: No interface method withRestorableState(Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V in class Landroidx/compose/runtime/savedinstancestate/RestorableStateHolder; or its super classes (declaration of 'androidx.compose.runtime.savedinstancestate.RestorableStateHolder' appears in /data/app/com.acv.composeland-V85a_e5F918MbctysYPnqQ==/base.apk)
            at androidx.navigation.compose.NavHostKt.withRestorableState(NavHost.kt:143)
            at androidx.navigation.compose.NavHostKt.access$withRestorableState(Unknown Source:0)
            at androidx.navigation.compose.NavHostKt$NavHost$5.invoke(NavHost.kt:130)
            at androidx.navigation.compose.NavHostKt$NavHost$5.invoke(Unknown Source:10)
            at androidx.compose.runtime.internal.ComposableLambda.invoke(ComposableLambda.kt:146)
            at androidx.compose.runtime.internal.ComposableLambda.invoke(Unknown Source:10)
            at androidx.compose.runtime.AmbientKt.Providers(Ambient.kt:187)
            at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:126)
            at androidx.navigation.compose.NavHostKt$NavHost$6.invoke(Unknown Source:8)
            at androidx.navigation.compose.NavHostKt$NavHost$6.invoke(Unknown Source:10)
            at androidx.compose.runtime.RecomposeScope.compose(Composer.kt:286)
    carbaj0
    j
    9 replies
    Copy to Clipboard
  • Adriano Celentano

    Adriano Celentano

    1 year ago
    any idea why my TextField input is jumping ?
    Adriano Celentano
    1 replies
    Copy to Clipboard
  • l

    Leon K

    1 year ago
    Hey, I'm currently trying to implement an android on-screen keyboard, doing the UI with Jetpack compose if possible. I've gotten errors about missing ViewTreeLifecycleOwner, ViewTreeViewModelStoreOwner, and ViewTreeSavedStateRegistryOwner.... is it even possible to do this? given that the keyboard stuff seems to be handled via a View, could these even have a ViewTreeViewModelStoreOwner and stuff like that? It seems as though the Compose stuff is bound to running inside of an activity, which - as far as i can tell - doesn't translate to the Input Method API
    l
    Adam Powell
    +1
    22 replies
    Copy to Clipboard
  • r

    robnik

    1 year ago
    I notice the JetNews sample uses it's own navigation ViewModel, instead of NavController and NavHost as documented here https://developer.android.com/jetpack/compose/navigation. The JetNews code looks easier to understand, and I'm wondering if there is a good reason to bother with NavController. I don't think it supports multiple back stacks (one per tab), which I want.
    r
    Robert Menke
    2 replies
    Copy to Clipboard
  • r

    robnik

    1 year ago
    I know there is a bug where
    LazyColumnFor
    does not remember things when items are removed and shifted. I heard that
    key(...)
    provides a workaround. I tried this, but it didn't work:
    LazyColumnFor(items = nums) { listNum ->
       key(listNum) {
          val r = remember { Random.nextInt(300) }
          Text("Num: $listNum, remembered: $r")
       }
    }
    nums
    is mutable state. When I remove the first item, all the remembered numbers change.
    r
    Andrey Kulikov
    +2
    7 replies
    Copy to Clipboard
  • k

    Kshitij Patil

    1 year ago
    Does this remember scroll position and
    snapToIndex
    APIs for LazyColumn are added in
    alpha08
    ? I'm using
    alpha07
    and I do get behavior of remembering scroll position on putting app background but it's not working when I switch the tab and come back (I'm using multi backstack Navigation) so I was expecting it to work
    k
    Andrey Kulikov
    3 replies
    Copy to Clipboard