Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 1652cd11b6ad696fb6be6de4cfaf834e773bd8c0
Author: Nader Jawad <njawad@google.com>
Date: Mon Nov 02 18:14:17 2020
Add support for non-uniform scaling
Relnote: "Introduced ScaleFactor
inline class to represent scale
factors for the horizontal and vertical
axes independent of one another in order
to support non-uniform scaling use cases.
--Added computeScaleFactor method to
ContentScale
--Added ContentScale.FillBounds to perform
non-uniform scaling to stretch the src
bounds to fully occupy the destination.
--Added operator methods to compute
ScaleFactor parameters with Size parameters."
Fixes: 172291582
Test: Added new tests to PainterModifierTest
and ImageTest to verify non-uniform scaling
Added ScaleFactorTest
Change-Id: Ic96a6eb421cda5550c817ceca23ab50fde337778
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ImageTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/draw/PainterModifier.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ContentScale.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ScaleFactor.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/layout/ContentScaleTest.kt
A compose/ui/ui/src/test/kotlin/androidx/compose/ui/layout/ScaleFactorTest.kt
https://android-review.googlesource.com/1485057
Branch: androidx-master-dev
commit 1652cd11b6ad696fb6be6de4cfaf834e773bd8c0
Author: Nader Jawad <njawad@google.com>
Date: Mon Nov 02 18:14:17 2020
Add support for non-uniform scaling
Relnote: "Introduced ScaleFactor
inline class to represent scale
factors for the horizontal and vertical
axes independent of one another in order
to support non-uniform scaling use cases.
--Added computeScaleFactor method to
ContentScale
--Added ContentScale.FillBounds to perform
non-uniform scaling to stretch the src
bounds to fully occupy the destination.
--Added operator methods to compute
ScaleFactor parameters with Size parameters."
Fixes: 172291582
Test: Added new tests to PainterModifierTest
and ImageTest to verify non-uniform scaling
Added ScaleFactorTest
Change-Id: Ic96a6eb421cda5550c817ceca23ab50fde337778
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ImageTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/graphics/vector/VectorTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/draw/PainterModifier.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ContentScale.kt
A compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/ScaleFactor.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/layout/ContentScaleTest.kt
A compose/ui/ui/src/test/kotlin/androidx/compose/ui/layout/ScaleFactorTest.kt
Description
Image and Painter APIs in compose consume a ContentScale parameter to determine how to scale the drawing contents uniformly about the size of the composable they are drawing within.
However, there have been some feature requests to scale content in a non-uniform manner similar to the framework API's ScaleType.FIT_XY API. We should come up with a way to support non-uniform scaling.
Following feature requests: