From 54a4ac26898ea318f434443458680cb3014bf6fa Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Wed, 6 Apr 2011 17:08:58 -0700 Subject: [PATCH] Make customization drawer deal better with a small height --- res/layout-xlarge/customization_drawer.xml | 5 +++-- res/values/attrs.xml | 1 + src/com/android/launcher2/PagedView.java | 7 +++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/res/layout-xlarge/customization_drawer.xml b/res/layout-xlarge/customization_drawer.xml index 98fc9d9632..a8f6ce09ea 100644 --- a/res/layout-xlarge/customization_drawer.xml +++ b/res/layout-xlarge/customization_drawer.xml @@ -32,7 +32,7 @@ + android:layout_height="match_parent"> + launcher:pageLayoutPaddingRight="20dp" + launcher:pageLayoutMaxHeight="@dimen/customization_drawer_content_height" /> \ No newline at end of file diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 2be5999550..4f4425311a 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -104,6 +104,7 @@ + diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index e7ecb9914e..a6ae0e1b98 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -110,6 +110,7 @@ public abstract class PagedView extends ViewGroup { protected int mPageLayoutPaddingRight; protected int mPageLayoutWidthGap; protected int mPageLayoutHeightGap; + protected int mPageLayoutMaxHeight; protected int mCellCountX; protected int mCellCountY; protected boolean mCenterPagesVertically; @@ -189,6 +190,8 @@ public abstract class PagedView extends ViewGroup { R.styleable.PagedView_pageLayoutWidthGap, -1); mPageLayoutHeightGap = a.getDimensionPixelSize( R.styleable.PagedView_pageLayoutHeightGap, -1); + mPageLayoutMaxHeight = a.getDimensionPixelSize( + R.styleable.PagedView_pageLayoutMaxHeight, -1); a.recycle(); setHapticFeedbackEnabled(false); @@ -384,6 +387,10 @@ public abstract class PagedView extends ViewGroup { final int verticalPadding = mPaddingTop + mPaddingBottom; + if (mPageLayoutMaxHeight != -1) { + heightSize = Math.min(mPageLayoutMaxHeight, heightSize); + } + // The children are given the same width and height as the workspace // unless they were set to WRAP_CONTENT final int childCount = getChildCount();