去掉桌面图标底图

This commit is contained in:
2020-11-04 14:49:53 +08:00
parent a0d3205fbf
commit f9d8c1cb31

View File

@@ -208,27 +208,27 @@ public class BaseIconFactory implements AutoCloseable {
RectF outIconBounds, float[] outScale) { RectF outIconBounds, float[] outScale) {
float scale = 1f; float scale = 1f;
if (shrinkNonAdaptiveIcons && ATLEAST_OREO) { // if (shrinkNonAdaptiveIcons && ATLEAST_OREO) {
if (mWrapperIcon == null) { // if (mWrapperIcon == null) {
mWrapperIcon = mContext.getDrawable(R.drawable.adaptive_icon_drawable_wrapper) // mWrapperIcon = mContext.getDrawable(R.drawable.adaptive_icon_drawable_wrapper)
.mutate(); // .mutate();
} // }
AdaptiveIconDrawable dr = (AdaptiveIconDrawable) mWrapperIcon; // AdaptiveIconDrawable dr = (AdaptiveIconDrawable) mWrapperIcon;
dr.setBounds(0, 0, 1, 1); // dr.setBounds(0, 0, 1, 1);
boolean[] outShape = new boolean[1]; // boolean[] outShape = new boolean[1];
scale = getNormalizer().getScale(icon, outIconBounds, dr.getIconMask(), outShape); // scale = getNormalizer().getScale(icon, outIconBounds, dr.getIconMask(), outShape);
if (!(icon instanceof AdaptiveIconDrawable) && !outShape[0]) { // if (!(icon instanceof AdaptiveIconDrawable) && !outShape[0]) {
FixedScaleDrawable fsd = ((FixedScaleDrawable) dr.getForeground()); // FixedScaleDrawable fsd = ((FixedScaleDrawable) dr.getForeground());
fsd.setDrawable(icon); // fsd.setDrawable(icon);
fsd.setScale(scale); // fsd.setScale(scale);
icon = dr; // icon = dr;
scale = getNormalizer().getScale(icon, outIconBounds, null, null); // scale = getNormalizer().getScale(icon, outIconBounds, null, null);
//
((ColorDrawable) dr.getBackground()).setColor(mWrapperBackgroundColor); // ((ColorDrawable) dr.getBackground()).setColor(mWrapperBackgroundColor);
} // }
} else { // } else {
scale = getNormalizer().getScale(icon, outIconBounds, null, null); scale = getNormalizer().getScale(icon, outIconBounds, null, null);
} // }
outScale[0] = scale; outScale[0] = scale;
return icon; return icon;