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?deviant
08/12/2022, 12:09 PMLukasz 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 PMvide
08/15/2022, 3:56 PMLazyVerticalGrid(
columns = GridCells.Fixed(4),
horizontalArrangement = Arrangement.SpaceBetween,
verticalArrangement = Arrangement.spacedBy(Spacing.SPACE_12)
) { items(20) { idx -> Box(Modifier.size(50.dp).background(Color.Red)) }}
dimsuz
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?