summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorWinson <winsonc@google.com>2016-07-22 16:35:37 -0700
committerWinson Chung <winsonc@google.com>2016-07-23 01:15:08 +0000
commitfadbe8ffbd90eb36c782a76a8b1a76a26dba288e (patch)
treec614e187e4b29b1466688d58d5ac17e999d1b34e /src/com/android/launcher3/DeviceProfile.java
parent68f98ac102a2719203883d87add6483797b516da (diff)
downloadandroid_packages_apps_Trebuchet-fadbe8ffbd90eb36c782a76a8b1a76a26dba288e.tar.gz
android_packages_apps_Trebuchet-fadbe8ffbd90eb36c782a76a8b1a76a26dba288e.tar.bz2
android_packages_apps_Trebuchet-fadbe8ffbd90eb36c782a76a8b1a76a26dba288e.zip
Fixing regression in folder positioning.
- When we had the search bar, the workspace padding always accounted for the search bar (and therefor drop target bar) height when the folder opened. Now that there is no padding on the top, we should offset the bar whenever possible to ensure that the drop target bar is visible. Bug: 30110595 Change-Id: Ia9a8581981c777f2507b6bd880994a3dcfd52c39
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index c9d5cff2e..15f47b4fc 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -378,12 +378,32 @@ public class DeviceProfile {
padding.set(desiredWorkspaceLeftRightMarginPx,
topWorkspacePadding,
desiredWorkspaceLeftRightMarginPx,
- hotseatBarHeightPx + pageIndicatorHeightPx);
+ paddingBottom);
}
}
return padding;
}
+ /**
+ * @return the bounds for which the open folders should be contained within
+ */
+ public Rect getAbsoluteOpenFolderBounds() {
+ if (isVerticalBarLayout()) {
+ // Folders should only appear right of the drop target bar and left of the hotseat
+ return new Rect(mInsets.left + dropTargetBarSizePx + edgeMarginPx,
+ mInsets.top,
+ mInsets.left + availableWidthPx - hotseatBarHeightPx - edgeMarginPx,
+ mInsets.top + availableHeightPx);
+ } else {
+ // Folders should only appear below the drop target bar and above the hotseat
+ return new Rect(mInsets.left,
+ mInsets.top + dropTargetBarSizePx + edgeMarginPx,
+ mInsets.left + availableWidthPx,
+ mInsets.top + availableHeightPx - hotseatBarHeightPx - pageIndicatorHeightPx -
+ edgeMarginPx);
+ }
+ }
+
private int getWorkspacePageSpacing() {
if (isVerticalBarLayout() || isLargeTablet) {
// In landscape mode the page spacing is set to the default.