Make customization drawer deal better with a small height

This commit is contained in:
Michael Jurka committed 2011-05-13 14:39:42 -07:00
1 parent d82b5817d4
commit 54a4ac2689
3 files changed
+11 -2

No files matched your search

+7
View File
@@ -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();