diff options
Diffstat (limited to 'src/com/android/launcher3/icons/LauncherIcons.java')
-rw-r--r-- | src/com/android/launcher3/icons/LauncherIcons.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/com/android/launcher3/icons/LauncherIcons.java b/src/com/android/launcher3/icons/LauncherIcons.java index 5508c49410..bf7897e8cc 100644 --- a/src/com/android/launcher3/icons/LauncherIcons.java +++ b/src/com/android/launcher3/icons/LauncherIcons.java @@ -21,7 +21,6 @@ import android.content.Context; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.graphics.IconShape; import com.android.launcher3.graphics.LauncherPreviewRenderer; -import com.android.launcher3.util.Themes; /** * Wrapper class to provide access to {@link BaseIconFactory} and also to provide pool of this class @@ -33,13 +32,18 @@ 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) { if (context instanceof LauncherPreviewRenderer.PreviewContext) { - return ((LauncherPreviewRenderer.PreviewContext) context).newLauncherIcons(context); + return ((LauncherPreviewRenderer.PreviewContext) context).newLauncherIcons(context, + shapeDetection); } int poolId; @@ -54,7 +58,8 @@ public class LauncherIcons extends BaseIconFactory implements AutoCloseable { } InvariantDeviceProfile idp = InvariantDeviceProfile.INSTANCE.get(context); - return new LauncherIcons(context, idp.fillResIconDpi, idp.iconBitmapSize, poolId); + return new LauncherIcons(context, idp.fillResIconDpi, idp.iconBitmapSize, poolId, + shapeDetection); } public static void clearPool() { @@ -68,9 +73,9 @@ public class LauncherIcons extends BaseIconFactory implements AutoCloseable { private LauncherIcons next; - protected LauncherIcons(Context context, int fillResIconDpi, int iconBitmapSize, int poolId) { - super(context, fillResIconDpi, iconBitmapSize, IconShape.getShape().enableShapeDetection()); - mMonoIconEnabled = Themes.isThemedIconEnabled(context); + protected LauncherIcons(Context context, int fillResIconDpi, int iconBitmapSize, int poolId, + boolean shapeDetection) { + super(context, fillResIconDpi, iconBitmapSize, shapeDetection); mPoolId = poolId; } |