Creating responsive icons with <maskable-icon>

I am trying to implement this guide:

https://developer.android.com/preview/features/adaptive-icons.html#Creating

for Android O Preview, but the launchpad shows me the default Android icon, and not the two layers specified in my ic_launcher.xml

ic_launcher.xml

<maskable-icon>
   <background android:drawable="@mipmap/layer0"/>
   <foreground android:drawable="@mipmap/layer1"/>
</maskable-icon>

Has anyone tried to implement this? Or not yet available?

(In my manifest, I put the ic_launcher.xml icon in the icon)

UPDATE: Google updates your site and puts adaptive-iconinsteadmaskable-icon

+4
source share
3 answers

I found out the answer when I check the file below.

\android-sdk-windows\platforms\android-O\data\res\drawable\sym_def_app_icon.xml

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@android:color/white" />
    <foreground android:drawable="@mipmap/sym_def_app_icon_maskable" />
</adaptive-icon>

, . ( 1), , , .

+3

?

<application
        ...
        android:icon="@mipmap/ic_launcher"
        ...>

    ...

</application>
+1

You may need to add this to your AndroidManifest.xml file:

android:roundIcon="@mipmap/ic_launcher_round"
0
source

Source: https://habr.com/ru/post/1672977/


All Articles