How would I implement a monochrome icon like other google apps so that it matches the dynamic colours picked by Material You?
How to implement a themed monochrome icon for Material You
Open your app icon and add the monochrome android:drawable attribute to the <adaptive-icon>
element. For example, in res/mipmap-anydpi-v26/ic_launcher.xml:
<adaptive-icon >
<background android:drawable="..." />
<foreground android:drawable="..." />
<monochrome android:drawable="@drawable/mymonochromeicon" />
</adaptive-icon>
If your try this and it does not work then you need to remove the android:roundIcon
element from your AndroidManifest.xml
, or, alternatively, also add the <monochrome android:drawable="@drawable/mymonochromeicon"/>
tag to your round icon.
Android Studio might give a warning saying Element monochrome is not allowed here
however we can ignore this.
Will it work in Android 12, targeting SDK version 31? No. –
Castanon
Because Google opened it up for other developers from Android 13 –
Crescentic
© 2022 - 2024 — McMap. All rights reserved.