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
This commit is contained in:
Winson Chung
2011-06-15 19:51:24 -07:00
parent 4e076545e4
commit fd3385fe9e
12 changed files with 83 additions and 72 deletions

View File

@@ -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);
}