Loading packages/SettingsLib/AdaptiveIcon/src/com/android/settingslib/widget/AdaptiveOutlineDrawable.java +10 −12 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.settingslib.widget; import static com.android.settingslib.widget.AdaptiveOutlineDrawable.AdaptiveOutlineIconType.TYPE_ADVANCED; import static com.android.settingslib.widget.AdaptiveOutlineDrawable.AdaptiveOutlineIconType.TYPE_DEFAULT; import android.annotation.ColorInt; import android.content.res.Resources; import android.graphics.Bitmap; Loading Loading @@ -48,11 +45,12 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { private static final float ADVANCED_ICON_CENTER = 50f; private static final float ADVANCED_ICON_RADIUS = 48f; public static final int ICON_TYPE_DEFAULT = 0; public static final int ICON_TYPE_ADVANCED = 1; @Retention(RetentionPolicy.SOURCE) @IntDef({TYPE_DEFAULT, TYPE_ADVANCED}) @IntDef({ICON_TYPE_DEFAULT, ICON_TYPE_ADVANCED}) public @interface AdaptiveOutlineIconType { int TYPE_DEFAULT = 0; int TYPE_ADVANCED = 1; } @VisibleForTesting Loading @@ -66,7 +64,7 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { public AdaptiveOutlineDrawable(Resources resources, Bitmap bitmap) { super(new AdaptiveIconShapeDrawable(resources)); init(resources, bitmap, TYPE_DEFAULT); init(resources, bitmap, ICON_TYPE_DEFAULT); } public AdaptiveOutlineDrawable(Resources resources, Bitmap bitmap, Loading Loading @@ -96,10 +94,10 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { private @ColorInt int getColor(Resources resources, @AdaptiveOutlineIconType int type) { int resId; switch (type) { case TYPE_ADVANCED: case ICON_TYPE_ADVANCED: resId = R.color.advanced_outline_color; break; case TYPE_DEFAULT: case ICON_TYPE_DEFAULT: default: resId = R.color.bt_outline_color; break; Loading @@ -110,10 +108,10 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { private int getDimensionPixelSize(Resources resources, @AdaptiveOutlineIconType int type) { int resId; switch (type) { case TYPE_ADVANCED: case ICON_TYPE_ADVANCED: resId = R.dimen.advanced_dashboard_tile_foreground_image_inset; break; case TYPE_DEFAULT: case ICON_TYPE_DEFAULT: default: resId = R.dimen.dashboard_tile_foreground_image_inset; break; Loading @@ -133,7 +131,7 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { final int count = canvas.save(); canvas.scale(scaleX, scaleY); // Draw outline if (mType == TYPE_DEFAULT) { if (mType == ICON_TYPE_DEFAULT) { canvas.drawPath(mPath, mOutlinePaint); } else { canvas.drawCircle(ADVANCED_ICON_CENTER, ADVANCED_ICON_CENTER, ADVANCED_ICON_RADIUS, Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java +2 −2 Original line number Diff line number Diff line package com.android.settingslib.bluetooth; import static com.android.settingslib.widget.AdaptiveOutlineDrawable.AdaptiveOutlineIconType.TYPE_ADVANCED; import static com.android.settingslib.widget.AdaptiveOutlineDrawable.ICON_TYPE_ADVANCED; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; Loading Loading @@ -238,7 +238,7 @@ public class BluetoothUtils { final Bitmap resizedBitmap = Bitmap.createScaledBitmap(bitmap, iconSize, iconSize, false); bitmap.recycle(); return new AdaptiveOutlineDrawable(resources, resizedBitmap, TYPE_ADVANCED); return new AdaptiveOutlineDrawable(resources, resizedBitmap, ICON_TYPE_ADVANCED); } return drawable; Loading Loading
packages/SettingsLib/AdaptiveIcon/src/com/android/settingslib/widget/AdaptiveOutlineDrawable.java +10 −12 Original line number Diff line number Diff line Loading @@ -16,9 +16,6 @@ package com.android.settingslib.widget; import static com.android.settingslib.widget.AdaptiveOutlineDrawable.AdaptiveOutlineIconType.TYPE_ADVANCED; import static com.android.settingslib.widget.AdaptiveOutlineDrawable.AdaptiveOutlineIconType.TYPE_DEFAULT; import android.annotation.ColorInt; import android.content.res.Resources; import android.graphics.Bitmap; Loading Loading @@ -48,11 +45,12 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { private static final float ADVANCED_ICON_CENTER = 50f; private static final float ADVANCED_ICON_RADIUS = 48f; public static final int ICON_TYPE_DEFAULT = 0; public static final int ICON_TYPE_ADVANCED = 1; @Retention(RetentionPolicy.SOURCE) @IntDef({TYPE_DEFAULT, TYPE_ADVANCED}) @IntDef({ICON_TYPE_DEFAULT, ICON_TYPE_ADVANCED}) public @interface AdaptiveOutlineIconType { int TYPE_DEFAULT = 0; int TYPE_ADVANCED = 1; } @VisibleForTesting Loading @@ -66,7 +64,7 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { public AdaptiveOutlineDrawable(Resources resources, Bitmap bitmap) { super(new AdaptiveIconShapeDrawable(resources)); init(resources, bitmap, TYPE_DEFAULT); init(resources, bitmap, ICON_TYPE_DEFAULT); } public AdaptiveOutlineDrawable(Resources resources, Bitmap bitmap, Loading Loading @@ -96,10 +94,10 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { private @ColorInt int getColor(Resources resources, @AdaptiveOutlineIconType int type) { int resId; switch (type) { case TYPE_ADVANCED: case ICON_TYPE_ADVANCED: resId = R.color.advanced_outline_color; break; case TYPE_DEFAULT: case ICON_TYPE_DEFAULT: default: resId = R.color.bt_outline_color; break; Loading @@ -110,10 +108,10 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { private int getDimensionPixelSize(Resources resources, @AdaptiveOutlineIconType int type) { int resId; switch (type) { case TYPE_ADVANCED: case ICON_TYPE_ADVANCED: resId = R.dimen.advanced_dashboard_tile_foreground_image_inset; break; case TYPE_DEFAULT: case ICON_TYPE_DEFAULT: default: resId = R.dimen.dashboard_tile_foreground_image_inset; break; Loading @@ -133,7 +131,7 @@ public class AdaptiveOutlineDrawable extends DrawableWrapper { final int count = canvas.save(); canvas.scale(scaleX, scaleY); // Draw outline if (mType == TYPE_DEFAULT) { if (mType == ICON_TYPE_DEFAULT) { canvas.drawPath(mPath, mOutlinePaint); } else { canvas.drawCircle(ADVANCED_ICON_CENTER, ADVANCED_ICON_CENTER, ADVANCED_ICON_RADIUS, Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java +2 −2 Original line number Diff line number Diff line package com.android.settingslib.bluetooth; import static com.android.settingslib.widget.AdaptiveOutlineDrawable.AdaptiveOutlineIconType.TYPE_ADVANCED; import static com.android.settingslib.widget.AdaptiveOutlineDrawable.ICON_TYPE_ADVANCED; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; Loading Loading @@ -238,7 +238,7 @@ public class BluetoothUtils { final Bitmap resizedBitmap = Bitmap.createScaledBitmap(bitmap, iconSize, iconSize, false); bitmap.recycle(); return new AdaptiveOutlineDrawable(resources, resizedBitmap, TYPE_ADVANCED); return new AdaptiveOutlineDrawable(resources, resizedBitmap, ICON_TYPE_ADVANCED); } return drawable; Loading