summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-06-01 14:08:21 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-06-06 16:41:57 -0700
commit7c786f75d131addf849551a8cbc084c7c4ed0730 (patch)
tree7885e20d12cd97eb05d6eeab4ccfef097fb94576 /src/com/android/launcher3/CellLayout.java
parent074290b873811365a0ce8be78bc2c3d9335756d4 (diff)
downloadpackages_apps_Trebuchet-7c786f75d131addf849551a8cbc084c7c4ed0730.tar.gz
packages_apps_Trebuchet-7c786f75d131addf849551a8cbc084c7c4ed0730.tar.bz2
packages_apps_Trebuchet-7c786f75d131addf849551a8cbc084c7c4ed0730.zip
Allowing the first screen to expand to the screen edge
This allows the QSB to extend all the way to the edge Change-Id: I43c6e21e44fef7fffe6fb12b7afb95549b68679f
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r--src/com/android/launcher3/CellLayout.java32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index cfaa6a34d..6755ff70a 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -896,14 +896,30 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
if (!isFullscreen) {
left += (int) Math.ceil(getUnusedHorizontalSpace() / 2f);
}
+ int right = r - l - getPaddingRight();
+ if (!isFullscreen) {
+ right -= (int) Math.ceil(getUnusedHorizontalSpace() / 2f);
+ }
+
int top = getPaddingTop();
+ int bottom = b - t - getPaddingBottom();
mTouchFeedbackView.layout(left, top,
left + mTouchFeedbackView.getMeasuredWidth(),
top + mTouchFeedbackView.getMeasuredHeight());
- mShortcutsAndWidgets.layout(left, top,
- left + r - l,
- top + b - t);
+ mShortcutsAndWidgets.layout(left, top, right, bottom);
+
+ // Expand the background drawing bounds by the padding baked into the background drawable
+ mBackground.getPadding(mTempRect);
+ mBackground.setBounds(
+ left - mTempRect.left,
+ top - mTempRect.top,
+ right + mTempRect.right,
+ bottom + mTempRect.bottom);
+ }
+
+ public Rect getBackgroundBounds() {
+ return mBackground.getBounds();
}
/**
@@ -916,16 +932,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
}
@Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- super.onSizeChanged(w, h, oldw, oldh);
-
- // Expand the background drawing bounds by the padding baked into the background drawable
- mBackground.getPadding(mTempRect);
- mBackground.setBounds(-mTempRect.left, -mTempRect.top,
- w + mTempRect.right, h + mTempRect.bottom);
- }
-
- @Override
protected void setChildrenDrawingCacheEnabled(boolean enabled) {
mShortcutsAndWidgets.setChildrenDrawingCacheEnabled(enabled);
}