From 7c786f75d131addf849551a8cbc084c7c4ed0730 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Wed, 1 Jun 2016 14:08:21 -0700 Subject: 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 --- src/com/android/launcher3/CellLayout.java | 32 ++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'src/com/android/launcher3/CellLayout.java') 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(); } /** @@ -915,16 +931,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { return getMeasuredWidth() - getPaddingLeft() - getPaddingRight() - (mCountX * mCellWidth); } - @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); -- cgit v1.2.3