Patrick Steiger
06/10/2023, 8:10 PMFabio Grumiro
06/10/2023, 9:07 PM@Stable
annotation since it seems that it doesn't affect skipping. Is it just useful for documentation purposes, or is it used by the compiler in some way?Sunil Kumar
06/11/2023, 9:54 AMLouis
06/11/2023, 12:47 PMYariv Ziporin
06/11/2023, 3:01 PMJustin Xu
06/11/2023, 10:07 PMSnapshotStateMap
state variable and a regular Map
that is generated from the state map, then provided to a Composable as follows:
val stateMap: SnapShotStateMap<...> = remember { mutableStateMapOf() }
val anotherMap: Map<...> = stateMap.map { ... }
...
DisplayMapComposable(
map = anotherMap,
changeStateMap = { // Change stateMap in some way }
)
When changeMap
is called inside the DisplayMapComposable
and modifies stateMap
, will it trigger a recomposition of the DisplayMapComposable
itself?eygraber
06/11/2023, 10:35 PMaspectRatio
was already used, I don't want to use it againAlex Styl
06/12/2023, 6:27 AMArkadii Ivanov
06/12/2023, 9:15 AMOffset
in a similar way to keyframes
, but with smooth curvy lines between points instead of straight lines?Oleksandr
06/12/2023, 2:56 PMMarcin Wisniowski
06/12/2023, 3:53 PMLucas Kivi
06/13/2023, 2:32 AMTung97 Hl
06/13/2023, 5:26 AMKev Thompson
06/13/2023, 9:29 AMK Merle
06/13/2023, 10:18 AMPiotr Prus
06/13/2023, 12:31 PMonPlaced
lambda. That way every time my view appears on the screen it animates nicely. Now, I need to make exit animation, but I believe there is no modifier that I could use for it, right? The only think that comes to my mind is DisposableEffect that will run when child view exit the composition.Mario Adam
06/13/2023, 2:20 PMAlexandru Hadăr
06/13/2023, 2:56 PMdrawRect
generate the same gradient effect as Box.background(gradient)
?
I'm trying to replicate the bottom fading effect at the top as well.
However, at the top, the white color persists across the whole gradient.
The code is in the 🧵myanmarking
06/13/2023, 3:46 PMSam Stone
06/13/2023, 4:56 PM@Composable
fun FamilyTree(root: Person) {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
PersonCard(root)
Row {
root.children.forEach { child ->
FamilyTree(child)
}
}
}
}
theapache64
06/13/2023, 6:07 PMpainterResource
supposed to cause a recomposition when loading a PNG file ? 🤔 (Android)Micko Cabacungan
06/13/2023, 6:36 PM@Composable
fun MainScreen() {
val data: List<Viewer> ...list of viewers
Row() {
data.forEach {
// this seems to not resize itself if there are two or more of this widget
// how can I make sure that n number of ViewerCameraWidget gets resized correctly
// to fit on screen?
ViewerCameraWidget() //uses android view
}
}
}
theapache64
06/13/2023, 10:04 PM@Composable
fun MyComposable() {
// Store the value of count using remember
var count by remember { mutableStateOf(0) }
// Compute the derived state based on count
val doubledCount by
derivedStateOf {
println("MainActivity:MyComposable:derivedStateOf")
count * 2
}
Column {
// Update the count when a button is clicked
Button(onClick = { count++ }) {
Text("Increment Count: $count")
}
// Display the derived state
Text("Doubled Count: $doubledCount")
}
}
Even though derivedStateOf
’s body called twice (because we don’t have remember
around it), the value is correct.
• Why (or how?) is this happening?
• Why there’s no infinite recomposition? 👀Sam Pengilly
06/13/2023, 10:20 PMLayout
to select between one of two different input composables. I assume the only caveat is the slight performance cost of composing something that won’t get used. I also assume that the semantics tree is only constructed after layout since it relies on the relative position of nodes.Omkar Amberkar
06/13/2023, 10:23 PMAyfri
06/14/2023, 6:30 AMRihards
06/14/2023, 8:23 AMmodifier = Modifier.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = null,
onClick = { }
)
Nav
06/14/2023, 10:07 AMImage()
to render an image.
However, when i try the same with a .png image Android studio cannot seem to locate the file. I am importing the asset through resource manager but i think the asset ends up in the androidApp folder instead of commonMain. So i made a Resources
folder inside commonMain manually but it still cannot find the image. Does anyone know the right way to import assets that can be used inside the commonMain folder?
Prateek Kumar
06/14/2023, 12:26 PMval image = rememberUpdatedState(mcqData.imageUrl)
GlideImage(imageModel = { image.value })
Or
val screenModeUpdated by rememberUpdatedState(screenMode)
LaunchedEffect(key1) {
if (screenModeUpdated == ScreenMode.SELECTION_MODEL)
viewModel.initMcqs(
}
Adrián Lázaro
06/14/2023, 2:37 PM