summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-04-08 10:27:49 -0700
committerWinson Chung <winsonc@google.com>2015-04-09 13:18:31 -0700
commit0f785720667ab8afe4b4620a6c333d382d8659ed (patch)
tree9bd5ddba76c5df2c700e05c7a1829e2fb4d14d92 /src/com/android/launcher3/DeviceProfile.java
parent3f471440a8b6b71d4c15501a96befd3b715c9e8f (diff)
downloadandroid_packages_apps_Trebuchet-0f785720667ab8afe4b4620a6c333d382d8659ed.tar.gz
android_packages_apps_Trebuchet-0f785720667ab8afe4b4620a6c333d382d8659ed.tar.bz2
android_packages_apps_Trebuchet-0f785720667ab8afe4b4620a6c333d382d8659ed.zip
Initial changes to support a fixed all-apps layout.
- Dynamically update padding and background depending on fixed bounds and searchbar - Fixes issue with drag layer bg getting clobbered when rotating launcher - Tapping outside the bounds of all apps should close all apps - Fixing typo causing widgets to not show in sw720dp devices Bug: 20127840 Change-Id: I29c3f905bdee940f938ffe054f58434887073092
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index ea2852080..786f2ce03 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -423,13 +423,21 @@ public class DeviceProfile {
allAppsNumCols = Math.max(minEdgeCellCount, Math.min(maxCols, allAppsNumCols));
}
- int appsContainerViewPx = res.getDimensionPixelSize(R.dimen.apps_container_width);
+ int appsContainerViewWidthPx = res.getDimensionPixelSize(R.dimen.apps_container_width);
+ updateAppsViewNumCols(res, appsContainerViewWidthPx);
+ }
+
+ public boolean updateAppsViewNumCols(Resources res, int containerWidth) {
int appsViewLeftMarginPx =
res.getDimensionPixelSize(R.dimen.apps_grid_view_start_margin);
- int availableAppsWidthPx = (appsContainerViewPx > 0) ? appsContainerViewPx :
- availableWidthPx;
- appsViewNumCols = (availableAppsWidthPx - appsViewLeftMarginPx) /
+ int availableAppsWidthPx = (containerWidth > 0) ? containerWidth : availableWidthPx;
+ int numCols = (availableAppsWidthPx - appsViewLeftMarginPx) /
(allAppsCellWidthPx + 2 * allAppsCellPaddingPx);
+ if (numCols != appsViewNumCols) {
+ appsViewNumCols = numCols;
+ return true;
+ }
+ return false;
}
void updateFromConfiguration(Context context, Resources resources, int wPx, int hPx,