Fixed
Status Update
Comments
ma...@google.com <ma...@google.com> #2
Over to Nader to take a look if we should support it at the ui
layer
al...@gmail.com <al...@gmail.com> #3
I can create a CL if Nader agrees it is a bug. :)
nj...@google.com <nj...@google.com>
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 9590f8c79100ea4afc084bb577ebde48f18e2d9f
Author: Nader Jawad <njawad@google.com>
Date: Tue Oct 27 20:38:49 2020
Added support to render an icon without a tint
Relnote: "Updated Icon API to take in Color.Unspecified
as a possible tint color which will draw the provided
asset or painter without a ColorFilter. Previously
attempts to ignore tinting with Color.Unspecified
would tint with a transparent color ending up
with nothing rendered at all."
Fixes: 171624632
Test: Added test to IconTest
Change-Id: I049e2b7464204f1fd8965d31d6dfba811b30a2bb
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Icon.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Icon.kt
https://android-review.googlesource.com/1477167
Branch: androidx-master-dev
commit 9590f8c79100ea4afc084bb577ebde48f18e2d9f
Author: Nader Jawad <njawad@google.com>
Date: Tue Oct 27 20:38:49 2020
Added support to render an icon without a tint
Relnote: "Updated Icon API to take in Color.Unspecified
as a possible tint color which will draw the provided
asset or painter without a ColorFilter. Previously
attempts to ignore tinting with Color.Unspecified
would tint with a transparent color ending up
with nothing rendered at all."
Fixes: 171624632
Test: Added test to IconTest
Change-Id: I049e2b7464204f1fd8965d31d6dfba811b30a2bb
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Icon.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Icon.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 4bb6e2852628c5152e17ce7d45e110d873fd4b55
Author: Nader Jawad <njawad@google.com>
Date: Wed Oct 28 14:11:09 2020
Updated documentation on Icon tinting
Updated kdocs on Icon tinting to
link to Color.Unspecified.
Updated test case on to indicate
a tint color is specified.
Bug: 171624632
Test: N/A
Change-Id: Ifac2cb2c67355477786e3362997d6ea0a02ff4ea
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Icon.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Icon.kt
https://android-review.googlesource.com/1479019
Branch: androidx-master-dev
commit 4bb6e2852628c5152e17ce7d45e110d873fd4b55
Author: Nader Jawad <njawad@google.com>
Date: Wed Oct 28 14:11:09 2020
Updated documentation on Icon tinting
Updated kdocs on Icon tinting to
link to Color.Unspecified.
Updated test case on to indicate
a tint color is specified.
Bug: 171624632
Test: N/A
Change-Id: Ifac2cb2c67355477786e3362997d6ea0a02ff4ea
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Icon.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/IconTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Icon.kt
Description
When using Icon.kt, I personally would expect that passing
Color.Unspecified
as the tint would result in no tint being applied to the icon at all (in other words, anull
color filter would be passed to thePainter
and the colors that are rendered would just be whatever theVectorAsset
orImageAsset
internally draws).This is currently not the case, as passing
Color.Unspecified
results in a transparent color filter being applied (meaning the icon is not rendered at all).This behavior is particularly important to support multi-colored icons, where you need to avoid a tint being applied all together.
The code in question at the time this bug was filed is here:https://cs.android.com/androidx/platform/frameworks/support/+/androidx-master-dev:compose/material/material/src/commonMain/kotlin/androidx/compose/material/Icon.kt;l=96;drc=989981f1b2a64419ed599cb82e2c589b6b41e46d