summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-03-05 18:07:04 -0800
committerAdam Cohen <adamcohen@google.com>2014-12-05 16:18:41 -0800
commit5940042d39b576553c2499bcf3d0641281e6ad52 (patch)
tree45eb331399dc9f0fd86f4a3dc58dada50fb9ec46 /src/com/android/launcher3/DeviceProfile.java
parente64b0dfcd0d4113e9259b6270cff734089f4cd3f (diff)
downloadandroid_packages_apps_Trebuchet-5940042d39b576553c2499bcf3d0641281e6ad52.tar.gz
android_packages_apps_Trebuchet-5940042d39b576553c2499bcf3d0641281e6ad52.tar.bz2
android_packages_apps_Trebuchet-5940042d39b576553c2499bcf3d0641281e6ad52.zip
Supporting custom widgets provided by launcher
-> This change provides integration for widgets provided by the launcher package which can run arbitrary code. Change-Id: I6052da5c4afed7ee72e3b44d045b9c46f2d84c42
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index d6aadcee1..34e1f3c5f 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -67,8 +67,8 @@ public class DeviceProfile {
String name;
float minWidthDps;
float minHeightDps;
- float numRows;
- float numColumns;
+ public float numRows;
+ public float numColumns;
float numHotseatIcons;
float iconSize;
private float iconTextSize;
@@ -84,13 +84,13 @@ public class DeviceProfile {
boolean transposeLayoutWithOrientation;
int desiredWorkspaceLeftRightMarginPx;
- int edgeMarginPx;
+ public int edgeMarginPx;
Rect defaultWidgetPadding;
int widthPx;
int heightPx;
- int availableWidthPx;
- int availableHeightPx;
+ public int availableWidthPx;
+ public int availableHeightPx;
int defaultPageSpacingPx;
int overviewModeMinIconZoneHeightPx;
@@ -100,11 +100,12 @@ public class DeviceProfile {
float overviewModeIconZoneRatio;
float overviewModeScaleFactor;
+ public int cellWidthPx;
+ public int cellHeightPx;
+
int iconSizePx;
int iconTextSizePx;
int iconDrawablePaddingPx;
- int cellWidthPx;
- int cellHeightPx;
int allAppsIconSizePx;
int allAppsIconTextSizePx;
int allAppsCellWidthPx;
@@ -578,6 +579,16 @@ public class DeviceProfile {
}
}
+ public int getWorkspaceGridHeight() {
+ Rect p = getWorkspacePadding();
+ return availableHeightPx - p.top - p.bottom;
+ }
+
+ public int getWorkspaceGridWidth() {
+ Rect p = getWorkspacePadding();
+ return availableWidthPx - p.left - p.right;
+ }
+
/** Returns the workspace padding in the specified orientation */
Rect getWorkspacePadding() {
return getWorkspacePadding(isLandscape ? CellLayout.LANDSCAPE : CellLayout.PORTRAIT);