[Manifest]关于icon

总述

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文件夹中。

可使用Android Studio提供的Image Asset工具实现图标适配及预览效果, 详情参考: developer.android.com/studio/writ…
Adaptive launcher icons are also used in shortcuts(快捷方式,类似Ios 3D-touch), the Settings app, sharing dialogs, and the overview screen(最近任务预览). 注意:

  • 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.

icon apperence需要在黑圈内,黑圈外部分可能被mask覆盖。

针对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.

转载于:https://juejin.im/post/5c643b90f265da2d84106801

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值