summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/allapps/AllAppsContainerView.java
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2016-07-12 11:14:41 -0700
committerHyunyoung Song <hyunyoungs@google.com>2016-07-12 15:37:15 -0700
commitca7f30f7cfdbea155cbef701485718fa5dd86f46 (patch)
treeddfe325ca83937787c5cc814e39baebbd790894c /src/com/android/launcher3/allapps/AllAppsContainerView.java
parent7ed42af3398c1764424ebbf2dd6e2a51e05eaf5f (diff)
downloadandroid_packages_apps_Trebuchet-ca7f30f7cfdbea155cbef701485718fa5dd86f46.tar.gz
android_packages_apps_Trebuchet-ca7f30f7cfdbea155cbef701485718fa5dd86f46.tar.bz2
android_packages_apps_Trebuchet-ca7f30f7cfdbea155cbef701485718fa5dd86f46.zip
Fix all apps becoming clipped when screen is rotated with all apps opened.
b/30040068 Change-Id: I5e89a82310fddd5aa89a8f5d855b2efa526f8244
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsContainerView.java')
-rw-r--r--src/com/android/launcher3/allapps/AllAppsContainerView.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 717ce74c7..c7e08db70 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -397,14 +397,13 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- updatePaddingsAndMargins();
- mContentBounds.set(mHorizontalPadding, 0,
- MeasureSpec.getSize(widthMeasureSpec) - mHorizontalPadding,
- MeasureSpec.getSize(heightMeasureSpec));
+ int widthPx = MeasureSpec.getSize(widthMeasureSpec);
+ int heightPx = MeasureSpec.getSize(heightMeasureSpec);
+ updatePaddingsAndMargins(widthPx, heightPx);
+ mContentBounds.set(mHorizontalPadding, 0, widthPx - mHorizontalPadding, heightPx);
DeviceProfile grid = mLauncher.getDeviceProfile();
- int availableWidth = (!mContentBounds.isEmpty() ? mContentBounds.width() :
- MeasureSpec.getSize(widthMeasureSpec))
+ int availableWidth = (!mContentBounds.isEmpty() ? mContentBounds.width() : widthPx)
- 2 * mAppsRecyclerView.getMaxScrollbarWidth();
grid.updateAppsViewNumCols(getResources(), availableWidth);
if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) {
@@ -470,7 +469,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
* container view, we inset the background and padding of the recycler view to allow for the
* recycler view to handle touch events (for fast scrolling) all the way to the edge.
*/
- private void updatePaddingsAndMargins() {
+ private void updatePaddingsAndMargins(int widthPx, int heightPx) {
Rect bgPadding = new Rect();
getRevealView().getBackground().getPadding(bgPadding);
@@ -497,11 +496,7 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
// Clip the view to the left and right edge of the background to
// to prevent shadows from rendering beyond the edges
final Rect newClipBounds = new Rect(
- bgPadding.left,
- 0,
- getWidth() - bgPadding.right,
- getHeight()
- );
+ bgPadding.left, 0, widthPx - bgPadding.right, heightPx);
setClipBounds(newClipBounds);
// Allow the overscroll effect to reach the edges of the view