diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2019-05-25 22:15:48 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2019-06-03 14:05:20 -0700 |
commit | f69426c4845f35206ad370889cb489d2f4af0135 (patch) | |
tree | 5e31c1b2498506114edb645ebc2e8efed11d0f09 /src/com/android/launcher3/icons/LauncherIcons.java | |
parent | ebd5e88164ef3a59cfe5f75a9eaeb95222ded7fa (diff) | |
download | packages_apps_Trebuchet-f69426c4845f35206ad370889cb489d2f4af0135.tar.gz packages_apps_Trebuchet-f69426c4845f35206ad370889cb489d2f4af0135.tar.bz2 packages_apps_Trebuchet-f69426c4845f35206ad370889cb489d2f4af0135.zip |
Add shape detection logic only for circle icons
b/119330044
Change-Id: I93042effa8417167d844f073275e8b941e861e60
Diffstat (limited to 'src/com/android/launcher3/icons/LauncherIcons.java')
-rw-r--r-- | src/com/android/launcher3/icons/LauncherIcons.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/launcher3/icons/LauncherIcons.java b/src/com/android/launcher3/icons/LauncherIcons.java index 5c4af1fe6..3b74307db 100644 --- a/src/com/android/launcher3/icons/LauncherIcons.java +++ b/src/com/android/launcher3/icons/LauncherIcons.java @@ -30,6 +30,7 @@ import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.ItemInfoWithIcon; import com.android.launcher3.LauncherAppState; import com.android.launcher3.R; +import com.android.launcher3.graphics.IconShape; import com.android.launcher3.model.PackageItemInfo; import com.android.launcher3.shortcuts.DeepShortcutManager; import com.android.launcher3.util.Themes; @@ -50,11 +51,15 @@ public class LauncherIcons extends BaseIconFactory implements AutoCloseable { private static LauncherIcons sPool; private static int sPoolId = 0; + public static LauncherIcons obtain(Context context) { + return obtain(context, IconShape.getShape().enableShapeDetection()); + } + /** * Return a new Message instance from the global pool. Allows us to * avoid allocating new objects in many cases. */ - public static LauncherIcons obtain(Context context) { + public static LauncherIcons obtain(Context context, boolean shapeDetection) { int poolId; synchronized (sPoolSync) { if (sPool != null) { @@ -67,7 +72,8 @@ public class LauncherIcons extends BaseIconFactory implements AutoCloseable { } InvariantDeviceProfile idp = LauncherAppState.getIDP(context); - return new LauncherIcons(context, idp.fillResIconDpi, idp.iconBitmapSize, poolId); + return new LauncherIcons(context, idp.fillResIconDpi, idp.iconBitmapSize, poolId, + shapeDetection); } public static void clearPool() { @@ -81,8 +87,9 @@ public class LauncherIcons extends BaseIconFactory implements AutoCloseable { private LauncherIcons next; - private LauncherIcons(Context context, int fillResIconDpi, int iconBitmapSize, int poolId) { - super(context, fillResIconDpi, iconBitmapSize); + private LauncherIcons(Context context, int fillResIconDpi, int iconBitmapSize, int poolId, + boolean shapeDetection) { + super(context, fillResIconDpi, iconBitmapSize, shapeDetection); mPoolId = poolId; } |