Status Update
Comments
ma...@google.com <ma...@google.com>
nj...@google.com <nj...@google.com> #2
Checking with UX team they also want to update the Chip with gradient background as well. Currently specified with the gradient as compositeOver(MaterialTheme.color.surface.copy(0.75f)) for enabled - they want this to change to 1.0f.
lc...@gmail.com <lc...@gmail.com> #3
Branch: androidx-main
commit b7674378db62c194c8a8b4fd496631f9a82d9113
Author: John Nichol <jnichol@google.com>
Date: Tue Jun 14 16:21:44 2022
Update the backgrounds behind Wear Chip gradients.
Wear Chips/ToggleChips with gradiant backgrounds are missing a solid background behind the gradient.
Bug: 235937657
RelNote: "We have added a background color (MaterialTheme.color.surface) behind Chip/ToggleChips that have gradient backgrounds in order to ensure that they are properly visible in the unlikely event that a light color is used behind them."
Test: ./gradlew :wear:compose:compose-material:connectedCheck --info --daemon
Change-Id: Ibe1a442812a48a6d39912b4bbf399a2f4b11ae5b
M wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/Chip.kt
M wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/ToggleChip.kt
lc...@gmail.com <lc...@gmail.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.wear.compose:compose-material:1.4.0-rc01
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.