summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewCellLayout.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-04-18 14:23:14 -0700
committerMichael Jurka <mikejurka@google.com>2012-04-25 16:24:03 -0700
commit8b805b17158886035b38261eb611d8641701ae43 (patch)
tree4244eabd560747196743f85b8c49f1c0202ccf1a /src/com/android/launcher2/PagedViewCellLayout.java
parent58039d634cb36da561501ccfafc266e1d83d0b4f (diff)
downloadandroid_packages_apps_Trebuchet-8b805b17158886035b38261eb611d8641701ae43.tar.gz
android_packages_apps_Trebuchet-8b805b17158886035b38261eb611d8641701ae43.tar.bz2
android_packages_apps_Trebuchet-8b805b17158886035b38261eb611d8641701ae43.zip
Remove use of private APIs
Change-Id: I3e28763075f8e92391796dc009214c9fa8f50008
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r--src/com/android/launcher2/PagedViewCellLayout.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 9e5452be3..6f73e6341 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -193,8 +193,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
int numHeightGaps = mCellCountY - 1;
if (mOriginalWidthGap < 0 || mOriginalHeightGap < 0) {
- int hSpace = widthSpecSize - mPaddingLeft - mPaddingRight;
- int vSpace = heightSpecSize - mPaddingTop - mPaddingBottom;
+ int hSpace = widthSpecSize - getPaddingLeft() - getPaddingRight();
+ int vSpace = heightSpecSize - getPaddingTop() - getPaddingBottom();
int hFreeSpace = hSpace - (mCellCountX * mOriginalCellWidth);
int vFreeSpace = vSpace - (mCellCountY * mOriginalCellHeight);
mWidthGap = Math.min(mMaxGap, numWidthGaps > 0 ? (hFreeSpace / numWidthGaps) : 0);
@@ -210,9 +210,9 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
int newWidth = widthSpecSize;
int newHeight = heightSpecSize;
if (widthSpecMode == MeasureSpec.AT_MOST) {
- newWidth = mPaddingLeft + mPaddingRight + (mCellCountX * mCellWidth) +
+ newWidth = getPaddingLeft() + getPaddingRight() + (mCellCountX * mCellWidth) +
((mCellCountX - 1) * mWidthGap);
- newHeight = mPaddingTop + mPaddingBottom + (mCellCountY * mCellHeight) +
+ newHeight = getPaddingTop() + getPaddingBottom() + (mCellCountY * mCellHeight) +
((mCellCountY - 1) * mHeightGap);
setMeasuredDimension(newWidth, newHeight);
}
@@ -221,11 +221,11 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
int childWidthMeasureSpec =
- MeasureSpec.makeMeasureSpec(newWidth - mPaddingLeft -
- mPaddingRight, MeasureSpec.EXACTLY);
+ MeasureSpec.makeMeasureSpec(newWidth - getPaddingLeft() -
+ getPaddingRight(), MeasureSpec.EXACTLY);
int childheightMeasureSpec =
- MeasureSpec.makeMeasureSpec(newHeight - mPaddingTop -
- mPaddingBottom, MeasureSpec.EXACTLY);
+ MeasureSpec.makeMeasureSpec(newHeight - getPaddingTop() -
+ getPaddingBottom(), MeasureSpec.EXACTLY);
child.measure(childWidthMeasureSpec, childheightMeasureSpec);
}
@@ -233,7 +233,7 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
}
int getContentWidth() {
- return getWidthBeforeFirstLayout() + mPaddingLeft + mPaddingRight;
+ return getWidthBeforeFirstLayout() + getPaddingLeft() + getPaddingRight();
}
int getContentHeight() {
@@ -255,8 +255,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
int count = getChildCount();
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
- child.layout(mPaddingLeft, mPaddingTop,
- r - l - mPaddingRight, b - t - mPaddingBottom);
+ child.layout(getPaddingLeft(), getPaddingTop(),
+ r - l - getPaddingRight(), b - t - getPaddingBottom());
}
}
@@ -327,7 +327,7 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
public int estimateCellHSpan(int width) {
// We don't show the next/previous pages any more, so we use the full width, minus the
// padding
- int availWidth = width - (mPaddingLeft + mPaddingRight);
+ int availWidth = width - (getPaddingLeft() + getPaddingRight());
// We know that we have to fit N cells with N-1 width gaps, so we just juggle to solve for N
int n = Math.max(1, (availWidth + mWidthGap) / (mCellWidth + mWidthGap));
@@ -342,7 +342,7 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
public int estimateCellVSpan(int height) {
// The space for a page is the height - top padding (current page) - bottom padding (current
// page)
- int availHeight = height - (mPaddingTop + mPaddingBottom);
+ int availHeight = height - (getPaddingTop() + getPaddingBottom());
// We know that we have to fit N cells with N-1 height gaps, so we juggle to solve for N
int n = Math.max(1, (availHeight + mHeightGap) / (mCellHeight + mHeightGap));
@@ -354,8 +354,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
/** 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)
+ getPaddingLeft() + (x * mCellWidth) + (x * mWidthGap) + (mCellWidth / 2),
+ getPaddingTop() + (y * mCellHeight) + (y * mHeightGap) + (mCellHeight / 2)
};
}