97 questions
0
votes
0
answers
14
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: ...
1
vote
0
answers
31
views
Fast back navigation doesn't reset custom animation
What I'm trying to do:
I'm using AnimatedVisibility to add an additional slideOutVertically exit animation to a single red Box in Screen1, ontop of the default fadeOut exit animation of the NavHost ...
4
votes
2
answers
167
views
Compose animation to move a Box across a Row
I have this design that I am trying to follow:
When the user selects a duration I am trying to use a white box (not sure if that is the best way) to highlight the selection. The box shouldn't move ...
0
votes
1
answer
123
views
Shared element transition: renderInSharedTransitionScopeOverlay().animateEnterExit() - Unresolved reference: animateEnterExit
From the docs I found the following sample code:
Sometimes you might want your non-shared composable to animate away as
well as remain on top of the other composables before the transition.
In such ...
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 ...
0
votes
1
answer
288
views
Is it possible to track the end of animation in AnimatedVisibility and, if it is completed, change the visibility of nested components?
I'm trying to make it so that when I click a button, an element disappears and then appears. I've looked for different ways to implement it, but none of them work.
I tried to implement such animation ...
1
vote
0
answers
67
views
In Android Studio's Compose Animation Preview screen, how can I save the initial and target preview values of an animation?
Android Studio's Compose Animation Preview lets you visualize how an animation will look in a timeline. I'm using animateFloatAsState in this example and my usage will go from -1.0f to 1.0f. The thing ...
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 ...
-1
votes
1
answer
282
views
How to get LazyColumn click position
I have a LazyColumn, click one item to navigate to a new screen. I want the Animation transition to be similar to the Gmail app to open a mail to the detail page. I don't need to use the ...
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,
...
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
828
views
Creating a wave-like text animation in jetpack compose: sequence disruption issue
I am currently developing an application using Kotlin and Jetpack Compose. My task is to create an animation where each letter in a given word alternately increases and decreases in size, creating a ...
4
votes
1
answer
478
views
How can I determine whether a 2D Point is within a Polygon or Complex Path with Jetpack Compose?
This is a share your knowledge, Q&A-style to explain how to detect whether a polygon or a complex shapes such as some section of path is touched as in gif below. Also it contains how to animate ...
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 ...
2
votes
3
answers
723
views
How to reduce recompositions when animating text color?
Current code
@Composable
fun TextDemo() {
var selectedIndex by remember {
mutableIntStateOf(0)
}
Row {
TabText(
text = "First",
isSelected ...
2
votes
0
answers
373
views
Compose drawWithContent modifier and MotionLayout bizarre bug
I built a screen with Compose MotionLayout.
My dependencies are:
androidx.constraintlayout:constraintlayout-compose:1.0.1
Platform dev.chrisbanes.compose:compose-bom:2023.02.00-beta03
androidx....
2
votes
1
answer
2k
views
Jetpack Compose: run enter and exit transitions sequentially in AnimatedContent
When customizing the transition of the AnimatedContent composable, one may use the function togetherWith that runs both enter and exit transitions simultaneously.
AnimatedContent(
targetState = ...
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
1
answer
986
views
Animate Column from Arrangement.Center to Arrangement.Top
I am using Jetpack Compose native animations to create a complex transition with some steps. The issue is that the original Column has the arrangement set to Center and after the inclusion of some ...
2
votes
0
answers
1k
views
How to correctly use BottomBar (NavigationBar) for top level destination screens?
So I had such UI structure at app top level composable (Scaffold to add bottom bar)
Scaffold(
contentWindowInsets = WindowInsets(0, 0, 0, 0),
bottomBar = {
if (appState....
1
vote
1
answer
721
views
Rotate icon vertically animation
I'm trying to achieve the animation which is shown on the following GIF (mb I should name it differently, instead of "rotate vertically"):
I found the following example https://blog....
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. ...