Joseph Hawkes-Cates
06/10/2022, 9:22 PMChris Fillmore
06/10/2022, 11:34 PMModifier.composed()
?
I have a custom modifier that is fairly general purpose (like transformable()
but with slightly different behaviour). I see transformable()
uses composed()
. Is this just an optimization? Thanks for any tips!Colton Idle
06/11/2022, 12:31 AMmutableStateListOf<Item>
and then just list.clear()
and list.addAll()
when I get a new list that's mostly the same?
My use case:
I am using Firestore where you can listen to a query via a Flow. So if I listen to a query of top20Books(), and I show that in my list, but one of the ratings on the books changes, my listener will get invoked again, which will cause me to throw away the old list and add the new list. But the only item that change was the top item, where the rating changed from a 4.82 to a 4.83.
Or should I take a different route on this. Like should I try to do the diffing myself?orangy
06/11/2022, 10:52 AManimateColor
involving alpha. It goes from Color.White
to Color.Blue.copy(0.1f)
with a tween()
spec. Instead of linear transition from one appearance to another, it goes first to less transparent Color.Blue
pretty fast and then alpha catches up, resulting in the unexpected effect of a “hump” transition. Any ideas how to fix it? E.g. in browser similar transition effect between same colors works as expected. (Compose for Desktop, if it is important)lilypuchi
06/11/2022, 12:37 PMIn SubcomposeLayout for example, whenever a layout occurs, the parameters passed to its lambda might vary, and in that case it will trigger a recomposition. In the other hand, if a state that is read from a subcomposition changes, a recomposition will be scheduled for the parent Composition once the initial composition is performed.
How does one read read a state from a subcomposition 🤔 ? Is it same as reading state ‘in’ a subcomposition or am I reading it wrong?Saiedmomen
06/11/2022, 6:43 PMsection▾
drawBehind
so that composition and layout phases can be skipped.
I don't understand if composition is skipped, how snapshot subscription works and drawBehind
is notified of color change.
Is the draw phase executed on each frame?
Is it related to nested use of composition for canvas?
@Composable
fun SkipPhases() {
val transition = rememberInfiniteTransition()
val color by transition.animateColor(
initialValue = Color.Cyan,
targetValue = Color.Magenta,
animationSpec = InfiniteRepeatableSpec(tween())
)
Box(modifier = Modifier.fillMaxSize().drawBehind { drawRect(color) }) {
Text(text = "SkipPhases")
}
}
Marcin Wisniowski
06/11/2022, 7:52 PMMehdi Haghgoo
06/12/2022, 6:19 AMkotlinforandroid
06/12/2022, 9:42 AMorangy
06/12/2022, 12:04 PMLazyListState
to be exposed, because composition of this bigger component can change, but semantic would remain. How do you do this?orangy
06/12/2022, 1:03 PMLazyColumn
and I want it to retain scroll position relative to the item key when I update the content. E.g. if I have items from the listOf(1,2,3)
and I scroll to top, and then update data and repopulate items from listOf(0,1,2,3)
I want scroll position to be still at item 1
with the same offset, and to see item 0
user would need to scroll up. Any hints on how to implement this effectively?Siddarth R Iyer
06/12/2022, 2:43 PMColton Idle
06/12/2022, 3:50 PM.blur(Dp(bottomSheetProgress * 4))
even if I make it
.blur(Dp(0F))
it will still clip. Is there anyway to opt out of this behavior?Chuck Stein
06/12/2022, 5:02 PMSnackbarDuration.Indefinite
javadoc says "_Show the Snackbar indefinitely until explicitly dismissed or action is clicked_", however so far I haven't figured out any way for the user to manually dismiss a snackbar other than clicking the action. How can this be done?Alexandre Brown
06/12/2022, 8:07 PMAlexandre Brown
06/13/2022, 1:33 AMColton Idle
06/13/2022, 2:02 AMRow(Modifier.horizontalScroll())
but have the current item "snap" in place. I've looked at Chris Banes' snapper lib, but it only works with LazyRows. And HorizontalPager in accompanist is built on LazyRow so that's also a no-go.
I need a non-lazy row/carousel impl with "snapping", but really can't find anything but I'm sort of finding it tough to believe no one has solved for this problem yet.eygraber
06/13/2022, 2:12 AMComposeTestRule
with Robolectric. Currently getting androidx.compose.ui.test.ComposeTimeoutException: Condition still not satisfied after 2000 ms
errors on captureToImage
when calling
rule.onRoot().captureToImage().asAndroidBitmap().compress(Bitmap.CompressFormat.PNG, 100, FileOutputStream(File("test.png")))
orangy
06/13/2022, 8:26 AMTash
06/13/2022, 5:22 PMAny of the features available in this group of libraries may become obsolete in the future, at which point they will (probably) become deprecated.
We will aim to provide a migration path (where possible), to whatever supersedes the functionality.Citing that these migrations/deprecations could become problematic to maintain. Did anyone run into similar concerns and go with some alternative?
Colton Idle
06/13/2022, 8:26 PMtotalHeightOfFirstAndSecondItemInLazyCol
.
Box {
Box(fillMaxWidth().height(totalHeightOfFirstAndSecondItemInLazyCol)
LazyColumn() { //all items are different sizes }
}
zsperske
06/13/2022, 9:06 PMandroid:letterSpacing
value like the following, how do I use it in Compose?
<!-- Letter Spacing -->
<dimen name="largeTitleLetterSpacing">0.00625</dimen>
Landry Norris
06/13/2022, 9:17 PMGrégory Lureau
06/13/2022, 9:48 PMandrew
06/14/2022, 2:00 AMraghunandan
06/14/2022, 6:05 AMnuhkoca
06/14/2022, 10:58 AMplaceables
using custom layout? In my case, button overlaps other items but I would expect other components to get smaller as much as button gets wider. Code in the 🧵fengdai
06/14/2022, 11:57 AMLaunchedEffect
which will change a state after a delay and trigger a recomposition. I want to wait for the end of the consequent recomposition and then do some assertions. How can I achieve the waiting? waitForIdle
doesn’t work.Slackbot
06/14/2022, 2:54 PMColton Idle
06/14/2022, 4:17 PMModifier.statusBarsHeight()
, but I don't need the Modifier, I just need to add a few values together (including the status bar height).Colton Idle
06/14/2022, 4:17 PMModifier.statusBarsHeight()
, but I don't need the Modifier, I just need to add a few values together (including the status bar height).Alex Vanyo
06/14/2022, 5:07 PMWindowInsets.statusBars.getTop
!
Although I’m curious if you could share your use case a bit for adding some together?Albert Chang
06/15/2022, 12:46 AM<http://LocalWindowInsets.current.statusBars.top|LocalWindowInsets.current.statusBars.top>
.Alex Vanyo
06/15/2022, 12:47 AMColton Idle
06/15/2022, 1:13 AM