Updating Clings. (5057945, 5056643)

Change-Id: Ifb2d37e92495aeddf9d4b3277eb8d2a846f4aa99
This commit is contained in:
Winson Chung
2011-09-16 20:14:36 -07:00
parent 23409c2a12
commit 7d7541e7b4
54 changed files with 515 additions and 334 deletions

View File

@@ -352,6 +352,14 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
return n;
}
/** Returns an estimated center position of the cell at the specified index */
public int[] estimateCellPosition(int x, int y) {
return new int[] {
mPaddingLeft + (x * mCellWidth) + (x * mWidthGap) + (mCellWidth / 2),
mPaddingTop + (y * mCellHeight) + (y * mHeightGap) + (mCellHeight / 2)
};
}
public void calculateCellCount(int width, int height, int maxCellCountX, int maxCellCountY) {
mCellCountX = Math.min(maxCellCountX, estimateCellHSpan(width));
mCellCountY = Math.min(maxCellCountY, estimateCellVSpan(height));