summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewCellLayout.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-02-23 11:48:32 -0800
committerMichael Jurka <mikejurka@google.com>2011-03-23 11:34:39 -0700
commit7ef959b9177e1e715b0afe010904455a3d961fc4 (patch)
tree271602f6c6c508a9275519eae373903c32dc8d54 /src/com/android/launcher2/PagedViewCellLayout.java
parent26976d9b53161f80faf822d482ac771b8621cf31 (diff)
downloadandroid_packages_apps_Trebuchet-7ef959b9177e1e715b0afe010904455a3d961fc4.tar.gz
android_packages_apps_Trebuchet-7ef959b9177e1e715b0afe010904455a3d961fc4.tar.bz2
android_packages_apps_Trebuchet-7ef959b9177e1e715b0afe010904455a3d961fc4.zip
Setting tab bar widths automatically
- will make launcher adapt better to different screen sizes - also, moved customization tray tab setup code from Launcher to CustomizeTrayTabHost Change-Id: I27a1acdacd231150bf191548d155c0e94d855796
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r--src/com/android/launcher2/PagedViewCellLayout.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 28bb78b9a..53657e5cb 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -243,6 +243,15 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
setMeasuredDimension(newWidth, newHeight);
}
+ int getContentWidth() {
+ // Return the distance from the left edge of the content of the leftmost icon to
+ // the right edge of the content of the rightmost icon
+
+ // icons are centered within cells, find out how much offset that accounts for
+ int iconHorizontalOffset = (mCellWidth - Utilities.getIconContentSize());
+ return mCellCountX * mCellWidth + (mCellCountX - 1) * mWidthGap - iconHorizontalOffset;
+ }
+
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int count = getChildCount();
@@ -281,17 +290,6 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
mHolographicChildren.setGap(widthGap, heightGap);
}
- public void setCellDimensions(int width, int height) {
- mCellWidth = width;
- mCellHeight = height;
- mChildren.setCellDimensions(width, height);
- mHolographicChildren.setCellDimensions(width, height);
- }
-
- public int getDefaultCellDimensions() {
- return sDefaultCellDimensions;
- }
-
public int[] getCellCountForDimensions(int width, int height) {
// Always assume we're working with the smallest span to make sure we
// reserve enough space in both orientations