diff options
author | Winson Chung <winsonc@google.com> | 2011-06-15 19:51:24 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-06-24 10:49:03 -0700 |
commit | fd3385fe9e0f034b04f99d5d59a58d74fe040da4 (patch) | |
tree | 6ea22637ec38883c8cef8318d4a6e312f32b8656 /src/com/android/launcher2/PagedViewGridLayout.java | |
parent | 4e076545e4ccdbd3c045a3fa33869a2b7519a0cc (diff) | |
download | android_packages_apps_Trebuchet-fd3385fe9e0f034b04f99d5d59a58d74fe040da4.tar.gz android_packages_apps_Trebuchet-fd3385fe9e0f034b04f99d5d59a58d74fe040da4.tar.bz2 android_packages_apps_Trebuchet-fd3385fe9e0f034b04f99d5d59a58d74fe040da4.zip |
Using GridLayout in AppsCustomize widgets tab.
- Starting to implement new widgets design
- Hiding outlines in phone ui while dragging
- Making the tab bar show only when we have items as well
Change-Id: Ic027f9ba83fc0982f2f92a90412f050a8e248f9c
Diffstat (limited to 'src/com/android/launcher2/PagedViewGridLayout.java')
-rw-r--r-- | src/com/android/launcher2/PagedViewGridLayout.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/launcher2/PagedViewGridLayout.java b/src/com/android/launcher2/PagedViewGridLayout.java index c6d39fd5f..a2ab7634c 100644 --- a/src/com/android/launcher2/PagedViewGridLayout.java +++ b/src/com/android/launcher2/PagedViewGridLayout.java @@ -19,14 +19,13 @@ package com.android.launcher2; import android.content.Context; import android.view.MotionEvent; import android.view.View; -import android.view.View.MeasureSpec; import android.widget.FrameLayout; -import android.widget.LinearLayout; +import android.widget.GridLayout; /** * The grid based layout used strictly for the widget/wallpaper tab of the AppsCustomize pane */ -public class PagedViewGridLayout extends FrameLayout implements Page { +public class PagedViewGridLayout extends GridLayout implements Page { static final String TAG = "PagedViewGridLayout"; private int mCellCountX; @@ -36,6 +35,7 @@ public class PagedViewGridLayout extends FrameLayout implements Page { super(context, null, 0); mCellCountX = cellCountX; mCellCountY = cellCountY; + setColumnCount(mCellCountX); } int getCellCountX() { @@ -50,9 +50,9 @@ public class PagedViewGridLayout extends FrameLayout implements Page { // offset of each page to scroll to before it updates the actual size of each page // (which can change depending on the content if the contents aren't a fixed size). // We work around this by having a minimum size on each widget page). - int widthSpecSize = Math.max(getSuggestedMinimumWidth(), + int widthSpecSize = Math.min(getSuggestedMinimumWidth(), MeasureSpec.getSize(widthMeasureSpec)); - int widthSpecMode = MeasureSpec.AT_MOST; + int widthSpecMode = MeasureSpec.EXACTLY; super.onMeasure(MeasureSpec.makeMeasureSpec(widthSpecSize, widthSpecMode), heightMeasureSpec); } |