summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-05-13 15:45:46 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-13 15:45:46 -0700
commit2168c076780bf43168bee3049fa1fd6b6459b0a5 (patch)
treed790158b8d1b3d9a30419b4993d68d14957d2067
parent8dc4700c9ff64fd3b8d811c1faa2cb5747686f2d (diff)
parent3a534f26d19ab27926dc075db531c1151510ceb7 (diff)
downloadandroid_packages_apps_Trebuchet-2168c076780bf43168bee3049fa1fd6b6459b0a5.tar.gz
android_packages_apps_Trebuchet-2168c076780bf43168bee3049fa1fd6b6459b0a5.tar.bz2
android_packages_apps_Trebuchet-2168c076780bf43168bee3049fa1fd6b6459b0a5.zip
am 3a534f26: am 54a4ac26: Make customization drawer deal better with a small height
* commit '3a534f26d19ab27926dc075db531c1151510ceb7': Make customization drawer deal better with a small height
-rw-r--r--res/layout-xlarge/customization_drawer.xml5
-rw-r--r--res/values/attrs.xml1
-rw-r--r--src/com/android/launcher2/PagedView.java7
3 files changed, 11 insertions, 2 deletions
diff --git a/res/layout-xlarge/customization_drawer.xml b/res/layout-xlarge/customization_drawer.xml
index 98fc9d963..a8f6ce09e 100644
--- a/res/layout-xlarge/customization_drawer.xml
+++ b/res/layout-xlarge/customization_drawer.xml
@@ -32,7 +32,7 @@
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
- android:layout_height="@dimen/customization_drawer_content_height">
+ android:layout_height="match_parent">
<com.android.launcher2.CustomizePagedView
android:id="@+id/customization_drawer_tab_contents"
android:layout_width="match_parent"
@@ -47,7 +47,8 @@
launcher:pageLayoutPaddingTop="40dp"
launcher:pageLayoutPaddingBottom="25dp"
launcher:pageLayoutPaddingLeft="20dp"
- launcher:pageLayoutPaddingRight="20dp" />
+ launcher:pageLayoutPaddingRight="20dp"
+ launcher:pageLayoutMaxHeight="@dimen/customization_drawer_content_height" />
</FrameLayout>
</LinearLayout>
</com.android.launcher2.CustomizeTrayTabHost> \ No newline at end of file
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 2be599955..4f4425311 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -104,6 +104,7 @@
<attr name="pageLayoutPaddingBottom" format="dimension" />
<attr name="pageLayoutPaddingLeft" format="dimension" />
<attr name="pageLayoutPaddingRight" format="dimension" />
+ <attr name="pageLayoutMaxHeight" format="dimension" />
<!-- The space between adjacent pages of the PagedView. -->
<attr name="pageSpacing" format="dimension" />
</declare-styleable>
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index e7ecb9914..a6ae0e1b9 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();