97 questions
0
votes
0
answers
16
views
Animating Svg path in the desktop compose app flickers without actually rendering anything. Why?
I am trying to create a path animation of Svg in the desktop compose app.
fun SvgDocument.drawCompletedFills(buildPaths: List<BuildPath>, drawScope: DrawScope, canvas: Canvas, targetLength: ...
3
votes
1
answer
4k
views
Animate Linear Gradient (Brush) infinitely and reversely in Compose
Initial State looks like this (animatedOffset = 0f)
at 1f I want to get the reversed gradient:
Current code:
val transition = rememberInfiniteTransition(label = "NavIconGradientAnim")
val ...
4
votes
2
answers
635
views
How to animate button width changes smoothly when showing/hiding another button in Jetpack Compose?
I want to create an animation where there’s a button that occupies the full width of the row. When a second button appears (its width depends on its text), the width of the first button should ...
8
votes
5
answers
12k
views
Animation in Jetpack Compose (AnimatedVisibility) not working at all for me?
I want to animate some text's visibility to not just appear/disappear but to slide in/out in Jetpack Compose Android app that I'm building.
I just literally copy-pasted that little code snippet from ...
0
votes
0
answers
26
views
InfiniteTransitions causing a ton of allocations in Android Studio Profiler
I have a kiosk app with a continuous infiniteTransition. The app sits on the same screen sometimes hours on end, does this eventually cause strain on memory or does Jetpack Compose handle this? I'm ...
0
votes
1
answer
58
views
Why animation is not working as expected?
I had tried to make a simple animation using Jetpack Compose that when the button click the text must be displayed. The button will move from left-right with rotation and text will get visible coming ...
0
votes
1
answer
73
views
How to interrupt and restart a Compose AnimatedVisibility animation
Given an animation showing an Int value where the composable starts small and gets bigger (using scaleIn) how can the animation be immediately interrupted and restarted?
In the following example we ...
0
votes
1
answer
434
views
How to animate visibility of Compose Row with horizontal scroll?
I hava Row with .horizontalScroll(scrollState) and I need to implement show and hide Row items animation.
I need it so that when it is necessary to hide elements, they all collapse into one element ...
1
vote
1
answer
134
views
How to implement bounce effect for row with horizontal scroll?
I have Row with .horizontalScroll() and I need bounce animation effect. That is, when the list appears, it scrolls forward a little, and then returns back. At the same time, I need a spring effect ...
3
votes
2
answers
652
views
Swipe right to navigate back in compose
In my Android app, I am displaying data in the lazy column, when the user clicks on one of the items in the list, it navigates to a new screen ("B") and when the user presses back it ...
3
votes
2
answers
1k
views
How do I animate the visibility of a weighted composable?
I have this composable here with a history, an input/output, and a button to show/hide the history (I have removed the parameters unnecessary to my concern):
@Composable
fun MainWindow(
...
3
votes
3
answers
4k
views
Jetpack compose - how to use a value animation to directly control other animations
I have a case in which it would be useful to use a single animated float value to control the animations of other elements, including fading between two colors. Is there a suggested way of doing this ...
2
votes
1
answer
512
views
Can't achieve smooth animation in container when using AnimatedVisibility
I need some advice on my code written in Jetpack Compose.
I am trying to implement a simple composable with a simple animation. Let's say I have a container with two horizontally arranged buttons ...
0
votes
1
answer
160
views
SharedElementTransition not recognising declarations
Why do these 2 errors appear despite using the correct imports and dependenices?
Unresolved reference: rememberSharedElementFor
Unresolved reference: sharedElement
MainActivity.kt
import android.os....
1
vote
1
answer
200
views
How to use correctly animateIntAsState?
I just want a simple one-time animation where the numbers 0-10 are displayed for 10 seconds.
I expected that for such a simple task it would be enough to use animateIntAsState, but I can't seem to get ...
4
votes
2
answers
3k
views
Is it possible to change the size of the Image composable without triggering recomposition
I have an animateDpAsState(..), whenever this animation is triggered it changes the Modifier.size(value) of an Image(...) thus causing recomposition.
Is there a way to skip composition phase for this ...
4
votes
1
answer
727
views
Jetpack Compose Ripple effect on expanding content adapts wrongly
I have a surface in Jetpack Compose which expands on click.
var expanded by remember { mutableStateOf(false) }
Column(modifier = Modifier.fillMaxSize()) {
Surface(color = Color.Gray, onClick = { ...
0
votes
1
answer
364
views
Jetpack compose. Animation duration is incorrect on some devices
I'm using Animatable to implement linear progress animation.
Here is my code:
val progress = remember(currStory) { Animatable(0f) }
progress.animateTo(
targetValue = 1f,
...
0
votes
1
answer
832
views
Infinite color animation sequentially in Jetpack Compose
I've just learned how to animate a color from an initial value to a target value indefinitely. Now I want that animation to go through more colors.
This is what I've got so far:
@Preview(heightDp = 30,...
4
votes
1
answer
2k
views
How to check which arc or pie chart segment clicked in Jetpack Compose?
This is a share your knowledge, Q&A-style question inspired by this question to detect which section of arc segment or degree of touch inside a circle or semi-circle as in gif and image below. ...
3
votes
0
answers
344
views
Animate LazyColumn items content size in Compose
I have a LazyColumn with items that have subsections, that appear and disappear on click.
I want to animate the items content size change: when I click on an item, I want to reveal its subsection (or ...
1
vote
1
answer
480
views
Applying Brush Effect to Whole Word While Animating Each Letter Individually in Jetpack Compose
I am trying to create a text effect in Jetpack Compose where the text uses a brush that looks like a set of colors smoothly changing diagonally. The individual letters in the text should move up and ...
0
votes
1
answer
815
views
Can AnimatedContent work correctly if the identical target state is issued multiple times?
I'm implementing AnimatedContent and I'm noticing that when my state issues the same target as is currently displaying (when new paged results for a list are issued from the view model) ...
3
votes
1
answer
1k
views
Animation with increasing sizes in Jetpack Compose
I want to make an animation of a button, when clicked, its sizes increase and go beyond the size of the Box(). I wrote an animation with a custom Shape, it works, but where it is used, you have to ...
7
votes
1
answer
5k
views
Android Compose create shake animation
I am trying to make shaking animation of shape in Jetpack Compose. I want to use this animation to show error when user enters invalid Pin code. But all I can find is slide in, slide out animations ...