Status Update
Comments
ma...@google.com <ma...@google.com>
nj...@google.com <nj...@google.com> #2
Branch: androidx-master-dev
commit 23a7d960caf43390a554700d3c56ada189a9d10e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Aug 10 15:11:36 2020
IconButton / IconToggleButton API scrub
Test: ./gradlew updateApi
Bug:
Bug:
Relnote: "Adds enabled parameter to IconButton, and reorders parameters in IconToggleButton"
Change-Id: I0a9419b1a631cadad451395302ad87b7f9214f96
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/IconButton.kt
lc...@gmail.com <lc...@gmail.com> #3
any updates on this issue?
lc...@gmail.com <lc...@gmail.com> #4
New api AnimatedImageVector
from 1.1.0-rc01 still does not support repeat="infinite or -1"
, when all animations in an avd are set to repeat or -1, the total duration reported by the AnimatedImageVector
will become 0.
Would be nice if we can have something like a MutableTransitionState or an animation listener to listen for the end of the animation and restart it. This however does not solve the repeating avd issue.
ya...@google.com <ya...@google.com>
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit 41a75f709cccf2d76c5215db41b2fe9d21ea9dd3
Author: Yuichi Araki <yaraki@google.com>
Date: Mon Jan 17 14:19:12 2022
Implement repeat for AnimatedImageVector
Replaces the internal implementation of AnimatedImageVector. Instead of converting all the animator
keyframes into a keyframes AnimationSpec, it now uses an internal AnimationSpec that combines
multiple FiniteAnimationSpec. Similarly, AnimationSpecs are reversed by wrapping it with a custom
AnimationSpec. This allows us to repeat such AnimationSpecs separately.
Relnote: "AnimatedImageVector now supports repeatCount and repeatMode"
Test: ./gradlew :compose:animation:animation-graphics:connectedCheck
Bug: 199304067
Change-Id: Ia3e75fe74f9552c2a1ce4a0995d781009b7a5257
A compose/animation/animation-graphics/src/androidAndroidTest/kotlin/androidx/compose/animation/graphics/vector/AnimatorAnimationSpecsTest.kt
M compose/animation/animation-graphics/api/restricted_current.txt
M compose/animation/animation-graphics/src/commonMain/kotlin/androidx/compose/animation/graphics/vector/Animator.kt
M compose/animation/animation-graphics/src/androidAndroidTest/kotlin/androidx/compose/animation/graphics/vector/AnimatorTest.kt
M compose/animation/animation-graphics/api/current.txt
M compose/animation/animation-graphics/api/public_plus_experimental_current.txt
A compose/animation/animation-graphics/src/commonMain/kotlin/androidx/compose/animation/graphics/vector/AnimatorAnimationSpecs.kt
lc...@gmail.com <lc...@gmail.com> #6
Am i missing something? I tried compose animation graphics version 1.2.0-beta01. However my avd (in #1) is still not repeating/looping infinitely. Am i doing anything wrong?
val image = AnimatedImageVector.animatedVectorResource(id)
val atEnd = remember { mutableStateOf(false) }
SideEffect {
atEnd.value = true
}
Image(
painter = rememberAnimatedVectorPainter(image, atEnd.value),
modifier = Modifier
.wrapContentSize(align = Alignment.Center),
contentDescription = null
)
lc...@gmail.com <lc...@gmail.com> #7
It seems that compose animatedVectorImage still does not support infinitely repeating animations. I may be wrong but from this piece of code in the androidx.compose.animation.graphics.vector.Animator
class. This function seems to only make the animation repeatable if the repeatCount is > 0.
internal class Timestamp<T>(
val timeMillis: Int,
val durationMillis: Int,
val repeatCount: Int,
val repeatMode: RepeatMode,
val holder: PropertyValuesHolder<T>
) {
fun asAnimationSpec(): FiniteAnimationSpec<T> {
@Suppress("UNCHECKED_CAST")
val spec = when (holder) {
is PropertyValuesHolderFloat -> holder.asKeyframeSpec(durationMillis)
is PropertyValuesHolderColor -> holder.asKeyframeSpec(durationMillis)
else -> throw RuntimeException("Unexpected value type: $holder")
} as KeyframesSpec<T>
return if (repeatCount > 0) {
repeatable(
iterations = repeatCount + 1,
animation = spec,
repeatMode = repeatMode
)
} else {
spec
}
}
}
However for xml avd, repeatcount is infinitely repeatable if the repeatCount is -1 which causes the animation to not repeat at all.
<!-- Defines how many times the animation should repeat. The default value is 0. -->
<attr name="repeatCount" format="integer">
<enum name="infinite" value="-1" />
</attr>
lc...@gmail.com <lc...@gmail.com> #8
created another issue here
Description
Component used: androidx.compose.animation:animation-graphics
Version used: 1.1.0-alpha03
Devices/Android versions reproduced on: all devices and android versions
If this is a bug in the library, we would appreciate if you could attach:
Don't think this is a bug, more like a feature gap?
Code snippet of my avd composable
Avd repeating animations are not repeating, and looks like the current painter api also does not support this use case. Does not seem to respect the avd's
android:repeatCount="-1"
attribute. Avd used to replicate "issue" attached.