Fixed
Status Update
Comments
ma...@google.com <ma...@google.com>
ah...@gmail.com <ah...@gmail.com> #2
This occurs even with Google generated vectors (i.e. right click in Android Studio, new, vector asset, and choose something (ex the back button) and enabled auto mirroring).
aa...@blockchain.com <aa...@blockchain.com> #3
// TODO (njawad) handle mirroring here
// state.mAutoMirrored = TypedArrayUtils.getNamedBoolean(a, parser, "autoMirrored",
// AndroidVectorResources.STYLEABLE_VECTOR_DRAWABLE_AUTO_MIRRORED, state.mAutoMirrored)
lmao so close yet so far :(
// state.mAutoMirrored = TypedArrayUtils.getNamedBoolean(a, parser, "autoMirrored",
// AndroidVectorResources.STYLEABLE_VECTOR_DRAWABLE_AUTO_MIRRORED, state.mAutoMirrored)
lmao so close yet so far :(
[Deleted User] <[Deleted User]> #4
same here
si...@gmail.com <si...@gmail.com> #5
I feel your pain. We need to provide icons and the only way to workaround is by doing this:
val iconModifier = if (isRtl) Modifier.scale(-1f, 1f) else Modifier
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit b57727219e2f370935663fca0898e5b5d5fc18b8
Author: Nader Jawad <njawad@google.com>
Date: Mon Mar 07 20:54:31 2022
Add support for VectorPainter auto mirroring
Relnote: "Updated parsing of vector drawables
to support auto mirroring to flip the content
of a VectorPainter if the current layout
direction is RTL."
Fixes: 185760237
Test: Added tests to ImageVectorTest and VectorTest
Change-Id: I79cd946811e9b06ff4186180c4f8eaa0dcdbc879
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/graphics/vector/compat/XmlVectorParser.android.kt
M compose/ui/ui/api/restricted_current.ignore
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/DrawModifierSample.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/VectorGraphicsDemo.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/current.ignore
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt
M compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/AnimatedVectorGraphicsDemo.kt
M compose/ui/ui/api/restricted_current.txt
M compose/animation/animation-graphics/src/androidMain/kotlin/androidx/compose/animation/graphics/res/AnimatedVectorPainterResources.android.kt
M compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsTest.kt
M compose/ui/ui-graphics/benchmark/test/src/androidTest/java/androidx/compose/ui/graphics/benchmark/test/ImageVectorTest.kt
A compose/ui/ui-graphics/benchmark/src/main/res/drawable/ic_auto_mirror.xml
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/ImageVector.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/VectorPainter.kt
https://android-review.googlesource.com/2014676
Branch: androidx-main
commit b57727219e2f370935663fca0898e5b5d5fc18b8
Author: Nader Jawad <njawad@google.com>
Date: Mon Mar 07 20:54:31 2022
Add support for VectorPainter auto mirroring
Relnote: "Updated parsing of vector drawables
to support auto mirroring to flip the content
of a VectorPainter if the current layout
direction is RTL."
Fixes: 185760237
Test: Added tests to ImageVectorTest and VectorTest
Change-Id: I79cd946811e9b06ff4186180c4f8eaa0dcdbc879
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/graphics/vector/compat/XmlVectorParser.android.kt
M compose/ui/ui/api/restricted_current.ignore
M compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/DrawModifierSample.kt
M compose/ui/ui/integration-tests/ui-demos/src/main/java/androidx/compose/ui/demos/VectorGraphicsDemo.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/current.ignore
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt
M compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/AnimatedVectorGraphicsDemo.kt
M compose/ui/ui/api/restricted_current.txt
M compose/animation/animation-graphics/src/androidMain/kotlin/androidx/compose/animation/graphics/res/AnimatedVectorPainterResources.android.kt
M compose/foundation/foundation-layout/src/androidAndroidTest/kotlin/androidx/compose/foundation/layout/BoxWithConstraintsTest.kt
M compose/ui/ui-graphics/benchmark/test/src/androidTest/java/androidx/compose/ui/graphics/benchmark/test/ImageVectorTest.kt
A compose/ui/ui-graphics/benchmark/src/main/res/drawable/ic_auto_mirror.xml
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/ImageVector.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/VectorPainter.kt
Description
It is used by painterResource()
After switching locale to RTL icon isn't mirrored