Changing the format for device profile definition
Device profiles are defined such that the grid size is fixed
and only the icon and text sizes change. For every grid size option
there are multiple display configurations.
Bug: 118758696
Change-Id: I54aac9106c576324b02530913c447e849b4ae1da
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java
index 65f0703..a0f005c 100644
--- a/src/com/android/launcher3/Utilities.java
+++ b/src/com/android/launcher3/Utilities.java
@@ -31,6 +31,7 @@
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.Paint;
+import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build;
@@ -587,6 +588,21 @@
handler.sendMessage(msg);
}
+ /**
+ * Parses a string encoded using {@link #getPointString(int, int)}
+ */
+ public static Point parsePoint(String point) {
+ String[] split = point.split(",");
+ return new Point(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
+ }
+
+ /**
+ * Encodes a point to string to that it can be persisted atomically.
+ */
+ public static String getPointString(int x, int y) {
+ return String.format(Locale.ENGLISH, "%d,%d", x, y);
+ }
+
public interface Consumer<T> {
void accept(T var1);
}