Fixed
Status Update
Comments
nj...@google.com <nj...@google.com> #2
Project: platform/frameworks/support
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: b/161809385
Bug: b/161807956
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
https://android-review.googlesource.com/1394868
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
tr...@gmail.com <tr...@gmail.com> #3
Thank you for the very prompt response. I tested it and it solves my problem nicely!
lp...@google.com <lp...@google.com> #4
Thanks for the request! Using Modifier.size
with Icon
should also work for simpler cases when you do not need to provide a custom ColorFilter
or similar, so we should definitely support this functionality in Icon
too. Re-opening this bug to track.
lp...@google.com <lp...@google.com> #5
This has now been fixed, so in the next release of Compose writing just:
Icon(vectorResource(R.drawable.ic_icon), modifier = Modifier.size(100.dp))
should make the icon 100x100dp, and draw to fit the space.
Description
Android Studio Build: Arctic Fix 2020.3.1 Canary 5
Alpha 11 lost the ability for us to change the default size of an icon loaded with vectorResource. In Alpha 10 I could do this by using:
Icon(vectorResource(R.drawable.ic_icon).copy(defaultWidth = 100.dp, defaultHeight = 100.dp))
This no longer works in Alpha 11. I did sort of find a way around this using the following:
Icon(vectorResource(R.drawable.ic_icon), modifier = Modifier.size(100.dp).scale(4f))
But this causes the vector to become pixelated. I thought the whole point of using vector resources is to be able to easily scale to any size and avoid pixelation?