Updating folder grid sizes for various devices

Change-Id: Ifd5930a4d6f54428500c0ef61ef21c0fc6a6f5cd
This commit is contained in:
Sunny Goyal
2015-05-11 11:38:19 -07:00
parent 99d96ba6c8
commit fee35bbfac
3 changed files with 29 additions and 27 deletions

View File

@@ -69,8 +69,10 @@ public class DeviceProfile {
String name;
float minWidthDps;
float minHeightDps;
public float numRows;
public float numColumns;
public int numRows;
public int numColumns;
public int numFolderRows;
public int numFolderColumns;
float numHotseatIcons;
float iconSize;
private float iconTextSize;
@@ -138,8 +140,9 @@ public class DeviceProfile {
private ArrayList<DeviceProfileCallbacks> mCallbacks = new ArrayList<DeviceProfileCallbacks>();
DeviceProfile(String n, float w, float h, float r, float c,
float is, float its, float hs, float his, int dlId) {
DeviceProfile(String n, float w, float h,
int r, int c, int fr, int fc,
float is, float its, float hs, float his, int dlId) {
// Ensure that we have an odd number of hotseat items (since we need to place all apps)
if (hs % 2 == 0) {
throw new RuntimeException("All Device Profiles must have an odd number of hotseat spaces");
@@ -148,8 +151,12 @@ public class DeviceProfile {
name = n;
minWidthDps = w;
minHeightDps = h;
numRows = r;
numColumns = c;
numFolderRows = fr;
numFolderColumns = fc;
iconSize = is;
iconTextSize = its;
numHotseatIcons = hs;
@@ -210,6 +217,9 @@ public class DeviceProfile {
// Snap to the closest column count
numColumns = closestProfile.numColumns;
numFolderRows = closestProfile.numFolderRows;
numFolderColumns = closestProfile.numFolderColumns;
// Snap to the closest hotseat size
numHotseatIcons = closestProfile.numHotseatIcons;
hotseatAllAppsRank = (int) (numHotseatIcons / 2);
@@ -266,8 +276,8 @@ public class DeviceProfile {
DeviceProfile partnerDp = p.getDeviceProfileOverride(dm);
if (partnerDp != null) {
if (partnerDp.numRows > 0 && partnerDp.numColumns > 0) {
numRows = partnerDp.numRows;
numColumns = partnerDp.numColumns;
numRows = numFolderRows = partnerDp.numRows;
numColumns = numFolderColumns = partnerDp.numColumns;
}
if (partnerDp.allAppsShortEdgeCount > 0 && partnerDp.allAppsLongEdgeCount > 0) {
allAppsShortEdgeCount = partnerDp.allAppsShortEdgeCount;