Reputation: 3393
How would I implement a monochrome icon like other google apps so that it matches the dynamic colours picked by Material You?
Upvotes: 15
Views: 8822
Reputation: 3393
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.
Upvotes: 21