Dyanmically lay out overview mode across all orientations and form factors.

Change-Id: I788bbf289717b30b19afc9ad9d611c85715bc623
This commit is contained in:
Winson Chung
2013-11-06 13:23:29 -08:00
parent ebb9ebed64
commit c82d2622bc
15 changed files with 72 additions and 45 deletions

View File

@@ -786,14 +786,14 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
// NOTE: We multiply by 1.5f to account for the fact that depending on the offset of the
// NOTE: We multiply by 2f to account for the fact that depending on the offset of the
// viewport, we can be at most one and a half screens offset once we scale down
DisplayMetrics dm = getResources().getDisplayMetrics();
int maxSize = Math.max(dm.widthPixels + mInsets.left + mInsets.right,
dm.heightPixels + mInsets.top + mInsets.bottom);
int parentWidthSize = (int) (1.5f * maxSize);
int parentHeightSize = maxSize;
int parentWidthSize = (int) (2f * maxSize);
int parentHeightSize = (int) (2f * maxSize);
int scaledWidthSize, scaledHeightSize;
if (mUseMinScale) {
scaledWidthSize = (int) (parentWidthSize / mMinScale);