Lukasz Kalnik
08/12/2022, 9:40 AMsavedStateHandle
. Then I need to load data in the ViewModel based on the passed argument.
Do I get some callback when the ViewModel has been navigated to? How do I perform the initial data loading based on the navigation argument?MR3Y
08/12/2022, 12:18 PMAnimatedContent
like : https://gist.github.com/c5inco/38e5075a883e5cc1136308bd3c44686dLukasz Kalnik
08/12/2022, 1:35 PMFudge
08/12/2022, 2:34 PMonNodeWithText("foo").assertHasClickAction() // OK
onAllNodesWithText("foo").assertAll(hasClickAction()) // OK
onNodeWithText("foo").assertExists() // OK
onAllNodesWithText("foo").assertAll(exists()) // No exists() or similar method for assertExists()?
Am I missing something? How do I test everything in a node collection exists?Andy Himberger
08/12/2022, 4:18 PMmattinger
08/12/2022, 5:37 PMStylianos Gakis
08/12/2022, 11:16 PMScaffold
is that when it shows its size is added to the paddingValues
provided by the Scaffold
and therefore pushes the items inside a bit up when it shows so that it does not show over other items.
Am I wrong in this, do I maybe not remember correctly that I’ve seen this before, or does it sound like I am doing something wrong in my implementation somehow?Colton Idle
08/13/2022, 10:11 AM.height(IntrinsicSize.Min)
? If not... why not since it seems like it'd behave the same? 🤔deviant
08/13/2022, 3:31 PMandroid:fontFamily="sans-serif-condensed"
Ji Sungbin
08/13/2022, 4:44 PMjames
08/14/2022, 12:03 AMMaterialTheme
in any way, nor share its naming system: how do you handle certain Material composables which hardcode colours and do not provide a way to override them?
the only way I can think of to do this is to create a MaterialTheme
and try my best to match my design system colours to the Material ones (Primary, OnPrimary, Surface, OnSurface etc).. then when I need to use a certain Material composable that doesn’t allow me to override the colour I can use CompositionLocalProvider
to wrap that particular composable
☝️ this seems like it would work, but I wonder if there’s a cleaner way to achieve this?Marko Novakovic
08/14/2022, 9:44 AMLayoutManager.findFirstCompletelyVisibleItemPosition()
?hfhbd
08/14/2022, 10:15 AMMarko Novakovic
08/14/2022, 10:20 AMRecyclerView
inside AndroidView
inside Column
is not scrolling. how to make it behave like LazyColumn
and scroll correctly? am trying with NestedScrollConnection
but without successMehmet Peker
08/14/2022, 12:43 PMSergio C.
08/14/2022, 2:17 PMColton Idle
08/14/2022, 5:08 PMval listFlow = snapshotFlow { appState.myList }
viewModelScope.launch {
listFlow.collectLatest {
Log...
but even when I clear the list and addAll to it, my flow doesn't get fired again (I don't see my log). Am I misunderstanding snapshotFlow, or should this work?PHondogo
08/14/2022, 9:13 PMCaused by: java.lang.ClassNotFoundException: Didn't find class "androidx.compose.material.icons.outlined.ArrowCircleLeftKt"
Both targets have dependency for extended material icons.
What may be the problem?Jerry Yion
08/15/2022, 2:48 AMZoltan Demant
08/15/2022, 3:49 AMLukasz Kalnik
08/15/2022, 10:00 AMArtur Schwarz
08/15/2022, 11:13 AMval appBarContentPadding = WindowInsets
.statusBars
.only(WindowInsetsSides.Horizontal + <http://WindowInsetsSides.Top|WindowInsetsSides.Top>)
.asPaddingValues()
val fullAppBarHeight = remember(appBarContentPadding) {
appBarHeight + appBarContentPadding.calculateTopPadding()
}
At first, the statusBar Insets have proper values:
InsetsPaddingValues(insets=(statusBars(0, *99*, 0, 0) only WindowInsetsSides(Start+Left+Top+End+Right)), density=DensityImpl(density=3.0, fontScale=1.0))
After a configuration change (such as changing language on the phone and resuming the app) the values are wrong:
InsetsPaddingValues(insets=(statusBars(0, *0*, 0, 0) only WindowInsetsSides(Start+Left+Top+End+Right)), density=DensityImpl(density=3.0, fontScale=1.0))
Could this be a bug or are we doing something wrong?Nikolas Alvelo
08/15/2022, 2:48 PMConstraints::bitsNeedForSize
in production. It seems to be inconsistently occurring across Android 12 devices, a lot of Samsung and others. The page in question uses an Accompanist FlowRow
and the child elements are either Row { ... }
or Card { ... }
. We never saw this issue in testing over several months, so it seems to be device-specific.
Has anyone else run into this scenario and were you able to resolve it?
We are using Compose compiler 1.3.0, Compose 1.2.1, Accompanist 0.25.1, Kotlin 1.7.10, compile/target 32
Stacktrace:
Fatal Exception: java.lang.IllegalArgumentException: Can't represent a size of 508326 in Constraints
at androidx.compose.ui.unit.Constraints$Companion.bitsNeedForSize(Constraints.kt:403)
at androidx.compose.ui.unit.Constraints$Companion.createConstraints-Zbe2FdA$ui_unit_release(Constraints.kt:363)
at androidx.compose.ui.unit.ConstraintsKt.Constraints(Constraints.kt:433)
at androidx.compose.foundation.layout.SizeModifier.getTargetConstraints-OenEA2s(Size.kt:737)
at androidx.compose.foundation.layout.SizeModifier.measure-3p2s80s(Size.kt:749)
at androidx.compose.ui.node.ModifiedLayoutNode.measure-BRTryo0(ModifiedLayoutNode.kt:53)
Stylianos Gakis
08/15/2022, 3:21 PMDrawable
, but I can’t figure out a way to get a hold of a Drawable
in a simple way in Compose without going for xml drawables or something like that. Is there some API I’m missing?Colton Idle
08/15/2022, 3:42 PMLokik Soni
08/15/2022, 6:28 PMshikasd
08/15/2022, 8:10 PMdimsuz
08/15/2022, 10:53 PMdrawable-xxxhdpi
, and I render it like so:
Box(modifier = Modifier.fillMaxWidth()) {
Image(
modifier = Modifier.matchParentSize().padding(19.dp),
painter = painterResource(id = R.drawable.impossibly_large_image),
)
Image(
painter = painterResource(R.drawable.regular_sized_image)
)
}
Both images have transparency.
I have some pointer input which changes parent composable's state, but this Box is isolated in a separate composable function, not depending on any state.
And I have GPU profiler on-screen spikes a quite above 16ms line (see thread for a screenshot).
If i remove that "oversized image" it immediately falls below 16ms.
My question is: shouldn't Compose pre-scale and somehow cache the Image? Are there some steps to encourage such caching?Colton Idle
08/16/2022, 12:43 AMK Merle
08/16/2022, 7:49 AMjava.lang.IllegalStateException: Snapshot is not open
Anyone experienced it?K Merle
08/16/2022, 7:49 AMjava.lang.IllegalStateException: Snapshot is not open
Anyone experienced it?java.lang.IllegalStateException: Snapshot is not open
at androidx.compose.runtime.snapshots.SnapshotKt.validateOpen(Snapshot.kt:1767)
at androidx.compose.runtime.snapshots.SnapshotKt.access$validateOpen(Snapshot.kt:1)
at androidx.compose.runtime.snapshots.MutableSnapshot.apply(Snapshot.kt:709)
at androidx.compose.runtime.Recomposer.applyAndCheck(Recomposer.kt:954)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1283)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:107)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:485)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:454)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:603)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@dcbbfad, androidx.compose.ui.platform.MotionDurationScaleImpl@f582e2, StandaloneCoroutine{Cancelling}@335c673, AndroidUiDispatcher@4eb930]
Zach Klippenstein (he/him) [MOD]
08/16/2022, 11:38 PMK Merle
08/17/2022, 5:40 AM1.2.1
, compiler 1.3.0
, Kotlin 1.7.10
I literally don't know when it happens, I just tried API 23, and it just breaks, API 24 works.
Removing StateFlows
from ViewModels
makes bug go away. There isn't anything in particular special about those, as I've done it hundreds of times.Colton Idle
08/17/2022, 3:33 PMK Merle
08/18/2022, 5:45 AMZach Klippenstein (he/him) [MOD]
08/18/2022, 3:51 PMChuck Jazdzewski [G]
08/18/2022, 3:58 PMK Merle
08/18/2022, 3:59 PMChuck Jazdzewski [G]
08/20/2022, 12:06 AMmruno
08/26/2022, 9:16 PMChuck Jazdzewski [G]
08/26/2022, 9:17 PMmruno
08/26/2022, 9:21 PMChuck Jazdzewski [G]
08/26/2022, 9:26 PMmruno
08/29/2022, 6:52 PMChuck Jazdzewski [G]
08/30/2022, 4:41 PMmruno
08/30/2022, 4:43 PM