总述
Android 7.1<API=25>增加Round Icon Resources,对应Manifest中attribute
android:roundIcon="@mipmap/ic_launcher_round"
复制代码
Android 8.0<API=26>增加Adaptive Icons,可自动适配不同厂商OEM。 效果如下:
Round Icon
属于Icon 过度阶段,Android 7.1引入。 详请参考:developer.android.com/about/versi…
Adaptive Icons
详情参考:developer.android.com/guide/pract… 遵从自由开放的原则,用于规范不同厂商OEM效果。 图标由三层组成,background layor、foreground layor、mask。 background layor、foreground layor由App指定,mask由OEM决定,可实现效果为圆形、圆角矩形等。 适配8.0,Icon资源放于mipmap-anydpi-v26文件夹中。
- Both layers must be sized at 108 x 108 dp.
- The inner 72 x 72 dp of the icon appears within the masked viewport.
- The system reserves the outer 18 dp on each of the 4 sides to create interesting visual effects, such as parallax or pulsing.
针对Shortcuts:
If you want to apply the same mask and visual effect to your shortcuts as regular adaptive launcher icons, use one of the following techniques:
- For static shortcuts, use the element.
- For dynamic shortcuts, call the createWithAdaptiveBitmap() method when you create them.
For more information on shortcuts, see App Shortcuts.