当前位置: 代码迷 >> 综合 >> Android8.1去掉 Launcher3 默认给 icon 增加的APK图标白边
  详细解决方案

Android8.1去掉 Launcher3 默认给 icon 增加的APK图标白边

热度:24   发布时间:2023-12-15 14:15:15.0

icon 增加的APK图标白边介绍:http://blog.csdn.net/guolin_blog/article/details/79417483
源码修改的路径:packages\apps\Launcher3\src\com\android\launcher3\graphics\LauncherIcons.java
if 部分直接注释,默认走 else 部分,不添加白边

    /*if (Utilities.ATLEAST_OREO && iconAppTargetSdk >= Build.VERSION_CODES.O) {boolean[] outShape = new boolean[1];AdaptiveIconDrawable dr = (AdaptiveIconDrawable)context.getDrawable(R.drawable.adaptive_icon_drawable_wrapper).mutate();dr.setBounds(0, 0, 1, 1);scale = normalizer.getScale(icon, null, dr.getIconMask(), outShape);if (FeatureFlags.LEGACY_ICON_TREATMENT &&!outShape[0]){Drawable wrappedIcon = wrapToAdaptiveIconDrawable(context, icon, scale);if (wrappedIcon != icon) {icon = wrappedIcon;scale = normalizer.getScale(icon, null, null, null);}}} else {scale = normalizer.getScale(icon, null, null, null);}*/scale = normalizer.getScale(icon, null, null, null);

编译安卓部分,下载镜像结果如下:
修改前:
在这里插入图片描述
修改后:
在这里插入图片描述

  相关解决方案