Maciej S
11/30/2022, 11:49 AMAbdul Moeed
11/30/2022, 12:59 PMTower Guidev2
11/30/2022, 3:02 PMthelumiereguy
11/30/2022, 6:37 PMSnapshot.withMutableSnapshot {
itemList.forEach { item -> _messagesStateMap[someIndex] = item }
}
Would this be a proper usecase for Snapshot? I dont want to trigger UI Update on every iteration of the loop
So, with this, I guess it’ll only trigger update after the apply
is called. What do you guys think?Wishnuprathikantam
12/01/2022, 5:37 AMeygraber
12/01/2022, 8:54 AMAnimatedVisibility
runs an EnterTransition
of slideInHorizontally
twice in some scenarios. Anyone else seeing anything like this - https://issuetracker.google.com/issues/260870116Eko Prasetyo
12/01/2022, 9:46 AMNavigator.of(context).push(...).then(*do something after pop()*)
How can I do this in Compose navigation?Vaios Tsitsonis
12/01/2022, 11:40 AModay
12/01/2022, 12:56 PMprivate val locationFilter =
BrowseEventsFilter.LocationFilter(location = MutableStateFlow(null))
private val categoryFilter =
BrowseEventsFilter.CategoryFilter(category = MutableStateFlow(null))
private val periodFilter = BrowseEventsFilter.PeriodFilter(
period = MutableStateFlow(Period.Any),
dateRange = MutableStateFlow(null)
)
val filtersState = MutableStateFlow(
listOf(
periodFilter,
locationFilter,
categoryFilter
)
)
viewModelScope.launch(<http://dispatchers.io|dispatchers.io>) {
filtersState.collect {
and in the activity
val filtersState by browseEventsViewModel.filtersState.collectAsState()
is this not enough to guarantee a recomposition if something inside filterState changes?K Merle
12/01/2022, 2:15 PMFidriyanto Rizkillah
12/01/2022, 8:14 PMjames
12/01/2022, 9:46 PMScaffold
at (or near) the top of their hierarchy, meaning each individual “screen” was wrapped by one “grandparent” Scaffold, which meant you would have a single source of controlling a drawer layout and a snackbar host. These days I don’t see that pattern as much, and the pattern is more like one Scaffold for each screen.
Which of these is the recommended way of doing things? My guess is the second one (many Scaffolds) is the way but I wanted to hear thoughts from others 🙏Andre Theilacker
12/01/2022, 10:10 PM@Stable
object TopLastAtMiddleArrangement : Arrangement.Vertical {
override fun Density.arrange(
totalSize: Int,
sizes: IntArray,
outPositions: IntArray
) {
var currentOffset = 0
sizes.forEachIndexed { index, size ->
if (index == sizes.lastIndex) {
val remaining = totalSize - currentOffset - size
outPositions[index] = if (remaining > 0) (remaining / 2) + currentOffset else currentOffset
} else {
outPositions[index] = currentOffset
currentOffset += size
}
}
}
}
I was hoping to make an implementation able to, when there is space, expand the given item to fill the gap. I was hoping to be able to do that by changing the sizes array, but that didn't seem to work.
Any ideas/suggestions?Milo
12/01/2022, 10:37 PMIssa
12/01/2022, 11:48 PMfirstVisibleItemIndex
after scroll is different than before
• The side effect should not be executed the item is not fully scrolled
I am implementing a fullscreen lazyrow items with a snap behavior
Thanks!Android75
12/02/2022, 5:25 AMShridhar Goel
12/02/2022, 7:37 AMchanjungskim
12/02/2022, 8:05 AM@Composable
fun NutritionalBalanceRoute(
viewModel: NutritionalBalanceViewModel = hiltViewModel()
) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = "Nutrition",
style = MaterialTheme.typography.headlineMedium
)
}
}
chanjungskim
12/02/2022, 8:07 AM@Preview
@Composable
fun PreviewNutritionalBalanceRoute(){
val viewModel = hiltViewModel<NutritionalBalanceViewModel>()
Surface {
NutritionalBalanceRoute(viewModel)
}
}
but it didn't work.Tin Tran
12/02/2022, 9:42 AMTextDecoration
to compose text? I’d like to have a dashed underline. It seems like I have to go down deep into the text painter and customize it….timrijckaert
12/02/2022, 11:22 AMComposable
.
Box(
modifier = Modifier
.size(100.dp)
.background(Color.Blue)
.clickable {
// parent click listener
Timber.d("parent click")
}
) {
Box(
modifier = Modifier
.size(50.dp)
.background(Color.Red)
) {
// children
}
// ...
}
When clicking on the red Box
the parent Composable
consumes the click event even though the red box is in front of it.
This looks like a weird default behavior to be. Different from the View
system....
However when the red Box
has a click listener of its own the behavior is correct and the red Box
click listener is triggered.
Is there a better way to let the red Box
consume the event without putting an explicit clickable
modifier on it?Elio Maroun
12/02/2022, 12:36 PMCsaba Szugyiczki
12/02/2022, 12:43 PMColumn
listing nearby Stops.
These Stop items show which Lines stop there.
When Talkback reaches the Lines, I want it to add a prefix before starting to read out the line numbers which says “Departs from here: ” and then the line numbers, so in the screenshot it would read the name of the stop, then the distance from the stop and then: “Departs form here: bus 231, night bus 973, night bus 996, night bus 996A”
Currently I am adding a 1x1 Spacer before the Green box (which is a Column in my code) with the contentDescription
set to “Departs from here: ” but it feels like a nasty hack. Is there a better way to add a prefix to a group of elements?zsperske
12/02/2022, 9:43 PMAbstractComposeView
inside of a BottomSheetDialog
(from the material design library). Wondering if anyone else has run into this before & found a solution. Error starts with:
java.lang.IllegalStateException: ViewTreeLifecycleOwner not found from android.widget.FrameLayout
Arjan van Wieringen
12/03/2022, 11:24 AMMehdi Haghgoo
12/03/2022, 4:47 PMAloneWalker
12/04/2022, 8:20 AMprivate var screenState by mutableStateOf(ScreenState())
private var dialogOneState by mutableStateOf(DialogOneState())
private var lazyColumnState by mutableStateOf(LazyColumnState())
or only one?KotlinLeaner
12/04/2022, 10:26 AMMehdi Haghgoo
12/04/2022, 11:48 AMKarthick
12/04/2022, 1:08 PMBox
to Row
. I was able to shrink and slide it diagonally with AnimatedVisibility. But how to move it into the Row?. Video sample in thread. 🧵Karthick
12/04/2022, 1:08 PMBox
to Row
. I was able to shrink and slide it diagonally with AnimatedVisibility. But how to move it into the Row?. Video sample in thread. 🧵PHondogo
12/04/2022, 6:24 PM