diff options
author | Michael Jurka <mikejurka@google.com> | 2011-02-23 11:48:32 -0800 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2011-03-23 11:34:39 -0700 |
commit | 7ef959b9177e1e715b0afe010904455a3d961fc4 (patch) | |
tree | 271602f6c6c508a9275519eae373903c32dc8d54 /src/com/android/launcher2/CustomizePagedView.java | |
parent | 26976d9b53161f80faf822d482ac771b8621cf31 (diff) | |
download | android_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/CustomizePagedView.java')
-rw-r--r-- | src/com/android/launcher2/CustomizePagedView.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java index 332f6e437..3dfa7c267 100644 --- a/src/com/android/launcher2/CustomizePagedView.java +++ b/src/com/android/launcher2/CustomizePagedView.java @@ -140,6 +140,8 @@ public class CustomizePagedView extends PagedViewWithDraggableItems private int[] mDragViewOrigin = new int[2]; + private int mPageContentWidth; + public CustomizePagedView(Context context) { this(context, null, 0); } @@ -172,6 +174,11 @@ public class CustomizePagedView extends PagedViewWithDraggableItems r.getInteger(R.integer.config_customizationDrawerDragSlopeThreshold) / 100.0f); mMinPageWidth = r.getDimensionPixelSize(R.dimen.customization_drawer_content_min_width); + // Create a dummy page and set it up to find out the content width (used by our parent) + PagedViewCellLayout layout = new PagedViewCellLayout(getContext()); + setupPage(layout); + mPageContentWidth = layout.getContentWidth(); + setVisibility(View.GONE); setSoundEffectsEnabled(false); setupWorkspaceLayout(); @@ -1163,6 +1170,10 @@ public class CustomizePagedView extends PagedViewWithDraggableItems } } + int getPageContentWidth() { + return mPageContentWidth; + } + @Override protected int getAssociatedLowerPageBound(int page) { return 0; |