Philip Dukhov
08/18/2025, 2:43 PMMaterialPredictiveBackAnimatable
for myself to be closer to what the system settings app has. The current version feels a bit strange in the final disappearing stage to me. Let me know if you're interested in such a contribution.
However, I noticed that you updated the alpha version to eliminate the use of the graphicsLayer
https://github.com/arkivanov/Decompose/issues/877.
Do you know if this issue has been reported? I use graphicsLayer
because I feel it's a performant solution. I'd like to reconsider it, knowing the corner cases where it could fail.Arkadii Ivanov
08/18/2025, 3:09 PMArkadii Ivanov
08/18/2025, 3:11 PMPhilip Dukhov
08/19/2025, 3:23 AMArkadii Ivanov
08/19/2025, 7:30 AMscale
Modifier works. I haven't figured out yet how we can apply some antialiasing. Open to suggestions.Philip Dukhov
08/20/2025, 1:32 AMgraphicsLayer(compositingStrategy = CompositingStrategy.Offscreen)
seems to be solving the issue for me.
I wonder if using the graphicsLayer
with direct parameters instead of block solves your flickering issues. I would expect it to, since Modifier.scale
uses it under the hood anyway.
I used this code to identify the differences.
val scale = remember { Animatable(1f) }
LaunchedEffect(Unit) {
while (true) {
scale.animateTo(
targetValue = if (scale.value == 1f) 0.8f else 1f,
animationSpec = tween(durationMillis = 3000)
)
}
}
Box(
modifier = Modifier
.systemBarsPadding()
) {
BasicText(
LoremIpsum().values.first(),
style = TextStyle(
fontSize = 20.sp,
),
modifier = Modifier
.clip(object : Shape {
override fun createOutline(
size: Size,
layoutDirection: LayoutDirection,
density: Density,
): Outline =
Outline.Rectangle(
Rect(
left = 0f,
top = 0f,
right = size.width / 2,
bottom = size.height
)
)
})
.graphicsLayer(
scaleX = scale.value,
scaleY = scale.value,
compositingStrategy = CompositingStrategy.Offscreen,
)
)
BasicText(
LoremIpsum().values.first(),
style = TextStyle(
fontSize = 20.sp,
),
modifier = Modifier
.clip(object : Shape {
override fun createOutline(
size: Size,
layoutDirection: LayoutDirection,
density: Density,
): Outline =
Outline.Rectangle(
Rect(
left = size.width / 2,
top = 0f,
right = size.width,
bottom = size.height
)
)
})
.graphicsLayer(
scaleX = scale.value,
scaleY = scale.value,
)
)
}
Arkadii Ivanov
08/20/2025, 7:09 AMArkadii Ivanov
08/20/2025, 7:15 AMArkadii Ivanov
08/20/2025, 9:26 AM