Android P Launcher APP替换图标不随系统固定格式而改变

--- a/vendor/mediatek/proprietary/packages/apps/Launcher3/src/com/android/launcher3/graphics/LauncherIcons.java
+++ b/vendor/mediatek/proprietary/packages/apps/Launcher3/src/com/android/launcher3/graphics/LauncherIcons.java
@@ -195,7 +195,8 @@ public class LauncherIcons implements AutoCloseable {
         float[] scale = new float[1];
         icon = normalizeAndWrapToAdaptiveIcon(icon, iconAppTargetSdk, null, scale);
         Bitmap bitmap = createIconBitmap(icon, scale[0]);
-        if (Utilities.ATLEAST_OREO && icon instanceof AdaptiveIconDrawable) {
+        if (/*Utilities.ATLEAST_OREO*/false && icon instanceof AdaptiveIconDrawable) {
             mCanvas.setBitmap(bitmap);
             getShadowGenerator().recreateIcon(Bitmap.createBitmap(bitmap), mCanvas);
             mCanvas.setBitmap(null);
@@ -241,7 +242,8 @@ public class LauncherIcons implements AutoCloseable {
     private Drawable normalizeAndWrapToAdaptiveIcon(Drawable icon, int iconAppTargetSdk,
             RectF outIconBounds, float[] outScale) {
         float scale = 1f;
-        if (Utilities.ATLEAST_OREO && iconAppTargetSdk >= Build.VERSION_CODES.O) {
+        if (/*Utilities.ATLEAST_OREO*/false && iconAppTargetSdk >= Build.VERSION_CODES.O) {
             boolean[] outShape = new boolean[1];
             if (mWrapperIcon == null) {
                 mWrapperIcon = mContext.getDrawable(R.drawable.adaptive_icon_drawable_wrapper)
@@ -250,7 +252,8 @@ public class LauncherIcons implements AutoCloseable {
             AdaptiveIconDrawable dr = (AdaptiveIconDrawable) mWrapperIcon;
             dr.setBounds(0, 0, 1, 1);
             scale = getNormalizer().getScale(icon, outIconBounds, dr.getIconMask(), outShape);
-            if (Utilities.ATLEAST_OREO && !outShape[0] && !(icon instanceof AdaptiveIconDrawable)) {
+            if (/*Utilities.ATLEAST_OREO*/false && !outShape[0] && !(icon instanceof AdaptiveIconDrawable)) {
                 FixedScaleDrawable fsd = ((FixedScaleDrawable) dr.getForeground());
                 fsd.setDrawable(icon);
                 fsd.setScale(scale);
@@ -329,7 +332,8 @@ public class LauncherIcons implements AutoCloseable {
         final int top = (textureHeight-height) / 2;
 
         mOldBounds.set(icon.getBounds());
-        if (Utilities.ATLEAST_OREO && icon instanceof AdaptiveIconDrawable) {
+        if (/*Utilities.ATLEAST_OREO*/false && icon instanceof AdaptiveIconDrawable) {
             int offset = Math.max((int) Math.ceil(BLUR_FACTOR * textureWidth), Math.max(left, top));
             int size = Math.max(width, height);
             icon.setBounds(offset, offset, offset + size, offset + size);

猜你喜欢

转载自blog.csdn.net/jydzm/article/details/88367964