https://kotlinlang.org logo
#compose
Title
# compose
c

Chase James

03/03/2020, 4:26 AM
Hi. I'm trying to use Icons.Menu as a vector icon for an AppBarIcon, but it's expecting a Painter type for the icon argument. Anyone have any tips?
👍 1
l

Louis Pullen-Freilich [G]

03/03/2020, 2:01 PM
Unfortunately the corresponding
Icon
work did not land in that release, so currently you will need to create your own: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-master-dev:ui/ui-foundation/src/main/java/androidx/ui/foundation/Icon.kt;l=45 This should be available in the next release
🙇‍♂️ 2
s

shikasd

03/03/2020, 2:34 PM
You can pass an instance of
ImagePainter
which accepts
Image
l

Louis Pullen-Freilich [G]

03/03/2020, 2:38 PM
Right, but the
Icons
provided are all
VectorAsset
s, which currently do not have a corresponding
Painter
s

shikasd

03/03/2020, 2:47 PM
Oh, my bad, I was pretty sure vector icons can be represented as
Image
🙂
k

Kazemihabib1996

03/03/2020, 2:55 PM
s

shikasd

03/03/2020, 3:05 PM
First link works for me 🙂
🤔 1