summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-07-11 17:30:03 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-07-13 12:37:08 -0700
commit6178f13e2d1f0c1a89cea74538b51993ef3439e3 (patch)
treeea28a996bccd6f022001ab5b1aa5fcedf2de2fbc /src/com/android/launcher3/DeviceProfile.java
parentba162aa7d2a49c09c00ff3184ffda3bea0e55509 (diff)
downloadandroid_packages_apps_Trebuchet-6178f13e2d1f0c1a89cea74538b51993ef3439e3.tar.gz
android_packages_apps_Trebuchet-6178f13e2d1f0c1a89cea74538b51993ef3439e3.tar.bz2
android_packages_apps_Trebuchet-6178f13e2d1f0c1a89cea74538b51993ef3439e3.zip
Moving the QSB out of the cell layout to the Drag layer
This allows better edge matching for the QSB. The QSB position is kept synchronized with the page scroll and all-apps transition. But its not visible in spring loaded and overview mode Change-Id: I4e6723607ea966ee672273a9ca67c792fd6b5661
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 72bb34338..2b130e5a7 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -296,7 +296,7 @@ public class DeviceProfile {
}
public Point getTotalWorkspacePadding() {
- Rect padding = getWorkspacePadding();
+ Rect padding = getWorkspacePadding(null);
return new Point(padding.left + padding.right, padding.top + padding.bottom);
}
@@ -306,8 +306,8 @@ public class DeviceProfile {
* this value is not reliable.
* Use {@link #getTotalWorkspacePadding()} instead.
*/
- public Rect getWorkspacePadding() {
- Rect padding = new Rect();
+ public Rect getWorkspacePadding(Rect recycle) {
+ Rect padding = recycle == null ? new Rect() : recycle;
if (isVerticalBarLayout()) {
// in case of isVerticalBarLayout, the hotseat is always on the right and the drop
// target bar is on the left, independent of the layout direction.
@@ -348,7 +348,7 @@ public class DeviceProfile {
// In portrait, we want the pages spaced such that there is no
// overhang of the previous / next page into the current page viewport.
// We assume symmetrical padding in portrait mode.
- return Math.max(defaultPageSpacingPx, 2 * getWorkspacePadding().left);
+ return Math.max(defaultPageSpacingPx, 2 * getWorkspacePadding(null).left);
}
}
@@ -405,13 +405,15 @@ public class DeviceProfile {
// Layout the workspace
PagedView workspace = (PagedView) launcher.findViewById(R.id.workspace);
- lp = (FrameLayout.LayoutParams) workspace.getLayoutParams();
- lp.gravity = Gravity.CENTER;
- Rect padding = getWorkspacePadding();
- workspace.setLayoutParams(lp);
+ Rect padding = getWorkspacePadding(null);
workspace.setPadding(padding.left, padding.top, padding.right, padding.bottom);
workspace.setPageSpacing(getWorkspacePageSpacing());
+ View qsbContainer = launcher.getQsbContainer();
+ lp = (FrameLayout.LayoutParams) qsbContainer.getLayoutParams();
+ lp.topMargin = padding.top;
+ qsbContainer.setLayoutParams(lp);
+
// Layout the hotseat
View hotseat = launcher.findViewById(R.id.hotseat);
lp = (FrameLayout.LayoutParams) hotseat.getLayoutParams();