Uchenna Okoye
02/17/2024, 7:37 PMPablichjenkov
02/17/2024, 7:43 PMUchenna Okoye
02/17/2024, 7:50 PMConstraintLayout
in Compose for this purpose? It offers a lot of flexibility for layering. Here's a quick link for reference: ConstraintLayout in Compose.Pablichjenkov
02/17/2024, 7:58 PMandrew
02/17/2024, 7:58 PMWindowInsets
and PaddingValues
? Especially when it involves modifying the values returned? I’d definitely like a way to just add multiple padding values together. Right now this extension function isn’t idealUchenna Okoye
02/17/2024, 8:19 PMConstraintLayout
that might better meet positional needs .If you ever give ConstraintLayout
in Compose a try, your feedback would be invaluable to us!Uchenna Okoye
02/17/2024, 8:21 PMPablichjenkov
02/17/2024, 8:41 PMSergey Y.
02/17/2024, 10:38 PMAnimatedContainer
, I propose an "Implicit Property Animations" for Jetpack Compose layouts.
This feature would automatically animate changes in size
, color
, and position offsets
, bringing simplicity to adding life to apps. Unlike AnimatedContent
, which animates block transitions, this aims to ease animations for individual elements. It's crucial that this feature be toggleable and turned off by default, allowing developers to opt-in as needed.Sergey Y.
02/17/2024, 10:44 PMfun ImplicitlyAnimatedBox() {
var isExpanded by remember { mutableStateOf(false) }
// Properties that would automatically animate when changed, if implicit animations are enabled
val size = if (isExpanded) 100.dp else 50.dp
val color = if (isExpanded) Color.Red else Color.Blue
val offset = if (isExpanded) IntOffset(20, 0) else IntOffset(0, 0)
Box(
modifier = Modifier
.size { size }
.background { color }
.offset { offset }
.clickable { isExpanded = !isExpanded }
)
So, no explicit animateColorAsState, animateDpAsState, etc used.
This feature would work implicitly, akin to how data diffing and smart recomposition operate for composable functions, automatically detecting and animating changes without explicit developer intervention.efemoney
02/24/2024, 6:33 PMStylianos Gakis
03/05/2024, 3:27 PMfillMaxSize()
which is not what we really want either, since that could mean that it will tell the Column to expand further on its width without us wanting it to.
If the default width was 180.dp for the children too, the existing behavior would be very easily achievable with a wrapContentWidth(Alignment.Start)
, and you have the same behavior super easily if you for some reason want it. But for all other cases I do not remember one time that I was glad that the column behaved in that way.
This behavior becomes even more problematic when you got higher level composables like the material Card contain its content in an internal Column which you do not have access to, and then you are in this ColumnScope where you got this behavior imposed on your without much of a way to fix it without making a custom composable, which is exactly what we had to do to overcome this problem.
I would be very happy to see steps towards changing this behavior.Uchenna Okoye
03/06/2024, 1:05 AM