Raid Xu
06/14/2022, 5:07 PMstate: State<T>
in it, then dispose the snapshot, the created state
can’t be read from GlobalSnapshot
, which makes sense.
However if anything triggered advanceGlobalSnapshot
(for example registerApplyObserver
), the new GlobalSnaphot
will be able to read the state
now (because the new GlobalSnapshot
no longer remember the disposed snapshot in invalid snapshots). Is this a bug?kotlinforandroid
06/14/2022, 5:45 PMNavGraph
if my NavGraph
is nested inside a Scaffold
?orangy
06/14/2022, 6:27 PMText
component with AnnotatedString
with some `ParagraphStyle`s in it. Is there any way to setup spacing between paragraphs? I want something like half lineHeight between them.zsperske
06/14/2022, 9:43 PMButton.Flat.Blue.Small
spierce7
06/14/2022, 9:54 PMFeri Nagy
06/15/2022, 7:54 AMitems(pagingItems) {}
, we have to iterate through the items manually, do pagingItems.peek(index)
and add single item {}
one by one:
@Composable
fun PlainPaging(pagingItems: LazyPagingItems<Item>) {
LazyColumn {
items(pagingItems) { item ->
when (item) {
is Item.Header -> Text(text = item.title)
is Item.Data -> Text(text = item.text)
null -> Text("placeholder")
}
}
}
}
// vs
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun StickyPaging(pagingItems: LazyPagingItems<Item>) {
LazyColumn {
for (index in 0 until pagingItems.itemCount) {
when (val item = pagingItems.peek(index)) {
is Item.Header -> stickyHeader { Text(text = item.title) }
is Item.Data -> item { Text(text = item.text) }
null -> item { Text("placeholder") }
}
}
}
}
Is this going to have some performance implications? Is there a better way to do it? Thanksallan.conda
06/15/2022, 3:15 PMryan.fonzi
06/15/2022, 3:53 PMexpanded
logic for ExposedDropdownMenuBox
wonky right now? I'm trying to use it for autocomplete results via an editable OutlinedTextField
nested inside. When the dropdown menu is expanded, it's consuming "backspace" inputs to try to dismiss itself. In order to actually delete a character, I have to basically hit backspace twice. Once to dismiss the popup, and another to actually delete the character.
Has anyone run into this behavior?Dylan
06/15/2022, 4:05 PMArtem Bezlyubchenko
06/15/2022, 4:07 PMMediumTopAppBar
| LargeTopAppBar
please.
It shows two lines on toolbar.
I’m using Material3 and I don’t use old material components…
Code is in the threadChris Fillmore
06/15/2022, 4:32 PMval scope1 = rememberCoroutineScope()
val scope2 = LocalLifecycleOwner.current.lifecycleScope
orangy
06/15/2022, 7:17 PMLayout
, and somehow the content gets centered. I’ve measured this single item (image), placed it at (0,0) in a layout
call with the size of the image (measured total children), and I expect it to be in the top left corner of the red area (parent size). Why is it in the center? Green rectangle depicts inner bounds of the parent, as if there was padding or something.Nat Strangerweather
06/15/2022, 8:34 PMColor
value to Int
(using toArgb()
) so I can save it in Datastore, how would I then convert the Int
back to Jetpack Compose Color
?Simon Stahl
06/16/2022, 1:50 AMpage/{pageName}
).
Questions:
1. currentDestination?.hierarchy
does not contain the root tab name after navigating to a sub page, so the tab does not stay selected
2. I would like to change the back behavior. By default, back first pops the current tabs backstack. Once it is empty, it moves to the startDestination
(root page in the first tab with backstack empty). I would like to change that to: pop backstack of current tab. Once empty, switch to last used tab including backstack and start popping there. Once empty switch to the next last used tab etc. If there are no more backstack entries, close the app.
For reference, please find my sample code in the commentsZoltan Demant
06/16/2022, 4:19 AM@Stable
? :60fps_parrot:
"kotlinx.collections.immutable.ImmutableList"
"kotlinx.collections.immutable.ImmutableSet"
"kotlinx.collections.immutable.ImmutableMap"
Heikki Rauhala
06/16/2022, 7:13 AMmadhuri gupta
06/16/2022, 7:42 AMRavi
06/16/2022, 8:07 AMHamza GATTAL
06/16/2022, 2:05 PMjulioromano
06/16/2022, 2:06 PMpointerInput
and graphicsLayer
to implement 360 degree scrolling on a composable (using translationX and translationY).
It seems to work but I can scroll the composable infinitely (bringing it completely out of the screen), how is it possible to compute the actual bounds of the composable so that I can stop the translation when the bounds have been reached?orangy
06/16/2022, 2:27 PMParagraphStyle(textIndent = TextIndent(0.sp, 12.sp))
and string "sdkjfn\nskdjfn\n"
I get the result as in attached image. Expected:
sdkjfn
skdjfn
Looks like indents are not considered during measuring of overall size, and then when laying out it have to wrap line.spierce7
06/16/2022, 5:34 PMVinay Gaba
06/16/2022, 8:38 PMMarco Pierucci
06/17/2022, 2:21 PMTower Guidev2
06/17/2022, 3:03 PMAndy Himberger
06/17/2022, 3:44 PMManojna Chintapalli
06/17/2022, 6:22 PMColton Idle
06/17/2022, 7:58 PMColton Idle
06/17/2022, 9:12 PMTgo1014
06/17/2022, 11:47 PMTgo1014
06/17/2022, 11:47 PMFrancesc
06/17/2022, 11:51 PMTgo1014
06/17/2022, 11:53 PMFrancesc
06/17/2022, 11:54 PMif (navController.currentBackStackEntry?.destination != <nav id of where the button is>) {
// navigate
}
Tgo1014
06/17/2022, 11:56 PMFrancesc
06/17/2022, 11:56 PMroute
or the id
from the backstack entry to compare, I'm just typing this from memoryTgo1014
06/17/2022, 11:56 PMFrancesc
06/17/2022, 11:57 PMTgo1014
06/17/2022, 11:58 PMFrancesc
06/17/2022, 11:58 PMTgo1014
06/17/2022, 11:59 PMnavController.navigate(B) {
popUpTo(A) {
inclusive = false
}
}
Francesc
06/17/2022, 11:59 PMpopUpTo
but popBackStack
but that's the ideaTgo1014
06/18/2022, 12:04 AMpopBackStack
but for wear when you swipe back it goes back to another B, if I set it as popUpTo
then it works 👀Ian Lake
06/18/2022, 12:11 AMlaunchSingleTop
is for. Have you tried using that?Tgo1014
06/18/2022, 12:12 AMIan Lake
06/18/2022, 12:12 AMnavController.navigate(B) {
launchSingleTop = true
}
Tgo1014
06/18/2022, 12:13 AMIan Lake
06/18/2022, 12:13 AMTgo1014
06/18/2022, 12:14 AM