Zoltan Demant
08/03/2022, 3:13 PM@Composable
function that produces a T. For a simple branch with nodes A > B > C; I end up with a scenario where if any of the nodes change, all of them have to produce a new T. Ideally, only affected nodes should reproduce their T, so if B changes, C can remain the same. Any ideas? More details in 🧵Colton Idle
08/03/2022, 7:36 PMStarting with Electric Eel Canary 9, if your project is using Compose version 1.2 or higher, Live Edit no longer needs to reset composition after code changes. Only the first code change made to a given file resets composition. Subsequent edits don't reset composition.
Roudy Korkis Kanaan
08/04/2022, 1:24 AMrememberTransformableState
for panning/zooming but it's not working as the sample suggests. I copied the sample found here. Zooming and rotating works but offsetChange
is always zeroTin Tran
08/04/2022, 2:19 AMnuhkoca
08/04/2022, 8:29 AMBox(modifier = Modifier.animateItemPlacement()) {
InstrumentView(instrument = item, selected = selectedIndex == i) {
selectedIndex = if (selectedIndex != i) i else -1
}
}
K Merle
08/04/2022, 9:21 AMjava.lang.IllegalArgumentException: No destination with route..
Tin Tran
08/04/2022, 9:32 AMTepes Lucian Victor
08/04/2022, 10:31 AMSlidingPaneLayout
echivalent in compose?Vaios Tsitsonis
08/04/2022, 11:48 AMRow
. It's shape has radius. I ve added clickable
modifier and the ripple effect does not respect the shape... How I can implement the desired behavior (apart from wrapping my composable with Card
:P)dave08
08/04/2022, 11:57 AMSlackbot
08/04/2022, 2:21 PMLukasz Kalnik
08/04/2022, 2:51 PMcontent
in ModalBottomSheetLayout
when sheetContent
takes all the contents of the bottom sheet?
What if I want to display this modal bottom sheet over different screens, should I just then leave content
empty?Altynbek Nurtaza
08/04/2022, 7:55 PMPaul
08/04/2022, 9:19 PMK Merle
08/05/2022, 5:35 AMNavHost
, and navigation
DSL is kind of is not optimal. Having actual NavHost
nested in parent NavHost
would give me more control over background shared element of nested screens. Is having NavHost
nested not recommended?ken_kentan
08/05/2022, 9:00 AMNavGraphBuilder.dialog
?Filip Wiesner
08/05/2022, 9:29 AMKotlinLeaner
08/05/2022, 10:39 AMFont(R.font.source_sans_variable_350)
and I am passing FontWeight
so what would be? I checked FontWeight.Light
and FontWeight.Normal
which is 300 and 400 respectively. So is there any solution for this ?Lukasz Kalnik
08/05/2022, 12:49 PMModalBottomSheetLayout
where the contents is the main screen with a list of items, and the sheetContent
are item details (with different settings).
As the item details are quite complex, and don't influence the main screen, I would like to have them in a separate ViewModel. How can I pass the itemId
from the MainScreenViewModel
to the ItemDetailsViewModel
. I don't really fancy creating a shared ViewModel just to pass one value (which is anyway only temporary, as the ItemDetailsViewModel
will store itemId
as well to get the item data).Nat Strangerweather
08/05/2022, 2:35 PMGeorge
08/05/2022, 7:17 PMTlaster
08/06/2022, 4:59 AMColorScheme.fromSeed
in flutter?Zoltan Demant
08/06/2022, 8:17 AMgsala
08/06/2022, 8:43 AMText
or BasicText
Composables? I’m trying to get a balanced
break strategy where the line lengths are similar.dimsuz
08/06/2022, 11:16 AMState
value to affect placement of layout children, will it impact performance in some way? Is there some in-depth look of what is cached and when during layout in compose?
E.g.
fun MyLayout(x: Int) {
Layout(content = {...}) { m, c ->
...
layout(w,h) { child.placeRelative(x, 0) }
}
}
fun Screen() {
// or x is from pointerInput + stored in State
val x by animateValue(300)
MyLayout(x)
}
CLOVIS
08/06/2022, 1:54 PMnuhkoca
08/06/2022, 11:40 PMColton Idle
08/07/2022, 2:56 AMdimsuz
08/07/2022, 12:46 PMBox
and I want to use pointerInput
to detect drag gestures inside this box, but I want to ignore cases when drag starts in the smaller child in center of that box. For example box is 400x400.dp and I want to ignore drags coming from within 100x100.dp of its centered child.
How can I achieve this? Use onGlobalLayout
to capture the position and size of the child and then in onDrag
check if change: PointerInputChange
comes from a child area and do not do what I usually do there in this case?Alexander Maryanovsky
08/07/2022, 2:43 PMColumn
of Item
, for example like this:
A2
C1
B2
with something like
@Composable
fun Item(letter: Char, index: Int){ ... }
Now each item belongs to a group, specified by the letter (A, B, C etc.) and has an index, specified by the number. The user can
1. Change the item’s index by selecting the item and pressing left/right. So, selecting “A2”, for example, and pressing right, changes the item to “A3". When this happens, I’m animating the Text
using AnimatedContent
so the “A3” slides in from the right and the “A2" slides out to the left. The animation runs when the new index is adjacent to the previous index.
2. Remove an item by selecting it and pressing “delete”.
Now, I have a problem. If the list is, for example
A1
A2
...
and the user deletes A1, the animation runs because as far as the 1st call to Item
is concerned, what happened was the index `remember`ed by AnimatedContent
changed from ‘1’ to ‘2’.
I would like to not have the animation run in this case.
If I key
the Item
with index
then the animation doesn’t run even when it should.Alexander Maryanovsky
08/07/2022, 2:43 PMColumn
of Item
, for example like this:
A2
C1
B2
with something like
@Composable
fun Item(letter: Char, index: Int){ ... }
Now each item belongs to a group, specified by the letter (A, B, C etc.) and has an index, specified by the number. The user can
1. Change the item’s index by selecting the item and pressing left/right. So, selecting “A2”, for example, and pressing right, changes the item to “A3". When this happens, I’m animating the Text
using AnimatedContent
so the “A3” slides in from the right and the “A2" slides out to the left. The animation runs when the new index is adjacent to the previous index.
2. Remove an item by selecting it and pressing “delete”.
Now, I have a problem. If the list is, for example
A1
A2
...
and the user deletes A1, the animation runs because as far as the 1st call to Item
is concerned, what happened was the index `remember`ed by AnimatedContent
changed from ‘1’ to ‘2’.
I would like to not have the animation run in this case.
If I key
the Item
with index
then the animation doesn’t run even when it should.Alex Vanyo
08/08/2022, 4:22 PMkey
is definitely the right track, but you will probably need to create some sort of unique id to use as the key
to specify which items are “the same” that are being modified or deleted.
Here’s another way to look at it:
Let’s say I gave you this list before, and this list after.
Before:
A1
A2
A3
...
After:
A2
A3
A4
...
Just from looking at those two lists, there’s two possibilities:
Either A1
was deleted, or all of the items were incremented.
But just by looking at the before and after, there’s no way to know which happened, and that before and after view is all Compose knows as well. There needs to be some additional information used for tracking what happened.Alexander Maryanovsky
08/08/2022, 4:34 PMAlex Vanyo
08/08/2022, 4:38 PMUUID.randomUUID()
around with your items, and using that as your key
. Removing an item would cause a UUID
to be deleted, whereas updating an item would keep the old UUID
, but with a new value.Alexander Maryanovsky
08/08/2022, 4:59 PM