merge in honeycomb-release history after reset to honeycomb
diff --git a/res/drawable-xlarge-nodpi/city.jpg b/res/drawable-xlarge-nodpi/city.jpg
new file mode 100644
index 0000000..983678e
--- /dev/null
+++ b/res/drawable-xlarge-nodpi/city.jpg
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/city_small.jpg b/res/drawable-xlarge-nodpi/city_small.jpg
new file mode 100644
index 0000000..e267750
--- /dev/null
+++ b/res/drawable-xlarge-nodpi/city_small.jpg
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/city_wallpaper.jpg b/res/drawable-xlarge-nodpi/city_wallpaper.jpg
deleted file mode 100644
index 8d3035e..0000000
--- a/res/drawable-xlarge-nodpi/city_wallpaper.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/city_wallpaper_small.png b/res/drawable-xlarge-nodpi/city_wallpaper_small.png
deleted file mode 100644
index 36d6d74..0000000
--- a/res/drawable-xlarge-nodpi/city_wallpaper_small.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/flowerbot.jpg b/res/drawable-xlarge-nodpi/flowerbot.jpg
new file mode 100644
index 0000000..7adb3d2
--- /dev/null
+++ b/res/drawable-xlarge-nodpi/flowerbot.jpg
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/flowerbot_small.jpg b/res/drawable-xlarge-nodpi/flowerbot_small.jpg
new file mode 100644
index 0000000..54778b9
--- /dev/null
+++ b/res/drawable-xlarge-nodpi/flowerbot_small.jpg
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/geonova.jpg b/res/drawable-xlarge-nodpi/geonova.jpg
deleted file mode 100755
index f9a37cc..0000000
--- a/res/drawable-xlarge-nodpi/geonova.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/geonova_small.jpg b/res/drawable-xlarge-nodpi/geonova_small.jpg
deleted file mode 100755
index 2b6a503..0000000
--- a/res/drawable-xlarge-nodpi/geonova_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/glow_wallpaper.png b/res/drawable-xlarge-nodpi/glow_wallpaper.png
deleted file mode 100644
index eb29449..0000000
--- a/res/drawable-xlarge-nodpi/glow_wallpaper.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/glow_wallpaper_small.png b/res/drawable-xlarge-nodpi/glow_wallpaper_small.png
deleted file mode 100644
index f83fc60..0000000
--- a/res/drawable-xlarge-nodpi/glow_wallpaper_small.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/glowy_hex.jpg b/res/drawable-xlarge-nodpi/glowy_hex.jpg
new file mode 100644
index 0000000..8729fe1
--- /dev/null
+++ b/res/drawable-xlarge-nodpi/glowy_hex.jpg
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/glowy_hex_small.jpg b/res/drawable-xlarge-nodpi/glowy_hex_small.jpg
new file mode 100644
index 0000000..6ac58bd
--- /dev/null
+++ b/res/drawable-xlarge-nodpi/glowy_hex_small.jpg
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/lineofbots.jpg b/res/drawable-xlarge-nodpi/lineofbots.jpg
deleted file mode 100755
index c9f5c79..0000000
--- a/res/drawable-xlarge-nodpi/lineofbots.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/lineofbots_small.jpg b/res/drawable-xlarge-nodpi/lineofbots_small.jpg
deleted file mode 100755
index ecb3942..0000000
--- a/res/drawable-xlarge-nodpi/lineofbots_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/village.jpg b/res/drawable-xlarge-nodpi/village.jpg
new file mode 100644
index 0000000..480a07c
--- /dev/null
+++ b/res/drawable-xlarge-nodpi/village.jpg
Binary files differ
diff --git a/res/drawable-xlarge-nodpi/village_small.jpg b/res/drawable-xlarge-nodpi/village_small.jpg
new file mode 100644
index 0000000..8659904
--- /dev/null
+++ b/res/drawable-xlarge-nodpi/village_small.jpg
Binary files differ
diff --git a/res/values-xlarge/wallpapers.xml b/res/values-xlarge/wallpapers.xml
index 04e3d66..85bb433 100644
--- a/res/values-xlarge/wallpapers.xml
+++ b/res/values-xlarge/wallpapers.xml
@@ -19,10 +19,12 @@
<string-array name="wallpapers" translatable="false">
<item>bluecrystal</item>
<item>bluelinebots</item>
+ <item>glowy_hex</item>
<item>bots</item>
+ <item>flowerbot</item>
<item>bucky</item>
- <item>geonova</item>
- <item>city_wallpaper</item>
<item>lotus</item>
+ <item>city</item>
+ <item>village</item>
</string-array>
</resources>
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java
index f3aa342..d02f597 100644
--- a/src/com/android/launcher2/BubbleTextView.java
+++ b/src/com/android/launcher2/BubbleTextView.java
@@ -31,13 +31,14 @@
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
+import android.widget.TextView;
/**
* TextView that draws a bubble behind the text. We cannot use a LineBackgroundSpan
* because we want to make the bubble taller than the text and TextView's clip is
* too aggressive.
*/
-public class BubbleTextView extends CachedTextView implements VisibilityChangedBroadcaster {
+public class BubbleTextView extends TextView implements VisibilityChangedBroadcaster {
static final float CORNER_RADIUS = 4.0f;
static final float SHADOW_LARGE_RADIUS = 4.0f;
static final float SHADOW_SMALL_RADIUS = 1.75f;
@@ -96,19 +97,8 @@
mFocusedGlowColor = res.getColor(R.color.workspace_item_focused_glow_color);
mPressedOutlineColor = res.getColor(R.color.workspace_item_pressed_outline_color);
mPressedGlowColor = res.getColor(R.color.workspace_item_pressed_glow_color);
- }
- protected int getCacheTopPadding() {
- return (int) PADDING_V;
- }
- protected int getCacheBottomPadding() {
- return (int) (PADDING_V + SHADOW_LARGE_RADIUS + SHADOW_Y_OFFSET);
- }
- protected int getCacheLeftPadding() {
- return (int) (PADDING_H + SHADOW_LARGE_RADIUS);
- }
- protected int getCacheRightPadding() {
- return (int) (PADDING_H + SHADOW_LARGE_RADIUS);
+ setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
}
public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache) {
@@ -269,33 +259,34 @@
mScrollX - padding, mScrollY - padding, mTempPaint);
canvas.restore();
}
- if (isBuildingCache()) {
- // We enhance the shadow by drawing the shadow twice
- this.setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
- super.draw(canvas);
- this.setShadowLayer(SHADOW_SMALL_RADIUS, 0.0f, 0.0f, SHADOW_SMALL_COLOUR);
- super.draw(canvas);
- } else {
- final Drawable background = mBackground;
- if (background != null) {
- final int scrollX = mScrollX;
- final int scrollY = mScrollY;
- if (mBackgroundSizeChanged) {
- background.setBounds(0, 0, mRight - mLeft, mBottom - mTop);
- mBackgroundSizeChanged = false;
- }
+ final Drawable background = mBackground;
+ if (background != null) {
+ final int scrollX = mScrollX;
+ final int scrollY = mScrollY;
- if ((scrollX | scrollY) == 0) {
- background.draw(canvas);
- } else {
- canvas.translate(scrollX, scrollY);
- background.draw(canvas);
- canvas.translate(-scrollX, -scrollY);
- }
+ if (mBackgroundSizeChanged) {
+ background.setBounds(0, 0, mRight - mLeft, mBottom - mTop);
+ mBackgroundSizeChanged = false;
}
- super.draw(canvas);
+
+ if ((scrollX | scrollY) == 0) {
+ background.draw(canvas);
+ } else {
+ canvas.translate(scrollX, scrollY);
+ background.draw(canvas);
+ canvas.translate(-scrollX, -scrollY);
+ }
}
+ // We enhance the shadow by drawing the shadow twice
+ getPaint().setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
+ super.draw(canvas);
+ canvas.save(Canvas.CLIP_SAVE_FLAG);
+ canvas.clipRect(mScrollX, mScrollY + getExtendedPaddingTop(), mScrollX + getWidth(),
+ mScrollY + getHeight(), Region.Op.REPLACE);
+ getPaint().setShadowLayer(SHADOW_SMALL_RADIUS, 0.0f, 0.0f, SHADOW_SMALL_COLOUR);
+ super.draw(canvas);
+ canvas.restore();
}
@Override
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 6767cf1..b27770c 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -50,7 +50,7 @@
import java.util.Arrays;
-public class CellLayout extends CachedViewGroup {
+public class CellLayout extends ViewGroup {
static final String TAG = "CellLayout";
private int mCellWidth;
diff --git a/src/com/android/launcher2/CellLayoutChildren.java b/src/com/android/launcher2/CellLayoutChildren.java
index a6f7f42..76a6900 100644
--- a/src/com/android/launcher2/CellLayoutChildren.java
+++ b/src/com/android/launcher2/CellLayoutChildren.java
@@ -44,6 +44,7 @@
public CellLayoutChildren(Context context) {
super(context);
mWallpaperManager = WallpaperManager.getInstance(context);
+ setLayerType(LAYER_TYPE_HARDWARE, null);
}
public void setCellDimensions(int cellWidth, int cellHeight,
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 92b09f4..6138b86 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -825,11 +825,15 @@
anim.start();
}
+ protected void determineScrollingStart(MotionEvent ev) {
+ determineScrollingStart(ev, 1.0f);
+ }
+
/*
* Determines if we should change the touch state to start scrolling after the
* user moves their touch point too far.
*/
- protected void determineScrollingStart(MotionEvent ev) {
+ protected void determineScrollingStart(MotionEvent ev, float touchSlopScale) {
/*
* Locally do absolute value. mLastMotionX is set to the y value
* of the down event.
@@ -840,12 +844,12 @@
final int xDiff = (int) Math.abs(x - mLastMotionX);
final int yDiff = (int) Math.abs(y - mLastMotionY);
- final int touchSlop = mTouchSlop;
+ final int touchSlop = Math.round(touchSlopScale * mTouchSlop);
boolean xPaged = xDiff > mPagingTouchSlop;
boolean xMoved = xDiff > touchSlop;
boolean yMoved = yDiff > touchSlop;
- if (xMoved || yMoved) {
+ if (xMoved || xPaged || yMoved) {
if (mUsePagingTouchSlop ? xPaged : xMoved) {
// Scroll if the user moved far enough along the X axis
mTouchState = TOUCH_STATE_SCROLLING;
@@ -855,15 +859,19 @@
pageBeginMoving();
}
// Either way, cancel any pending longpress
- if (mAllowLongPress) {
- mAllowLongPress = false;
- // Try canceling the long press. It could also have been scheduled
- // by a distant descendant, so use the mAllowLongPress flag to block
- // everything
- final View currentPage = getPageAt(mCurrentPage);
- if (currentPage != null) {
- currentPage.cancelLongPress();
- }
+ cancelCurrentPageLongPress();
+ }
+ }
+
+ protected void cancelCurrentPageLongPress() {
+ if (mAllowLongPress) {
+ mAllowLongPress = false;
+ // Try canceling the long press. It could also have been scheduled
+ // by a distant descendant, so use the mAllowLongPress flag to block
+ // everything
+ final View currentPage = getPageAt(mCurrentPage);
+ if (currentPage != null) {
+ currentPage.cancelLongPress();
}
}
}
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 890bde8..2800b02 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -217,6 +217,13 @@
private int mLastDragXOffset;
private int mLastDragYOffset;
+ // Variables relating to touch disambiguation (scrolling workspace vs. scrolling a widget)
+ private float mXDown;
+ private float mYDown;
+ final static float START_DAMPING_TOUCH_SLOP_ANGLE = (float) Math.PI / 6;
+ final static float MAX_SWIPE_ANGLE = (float) Math.PI / 3;
+ final static float TOUCH_SLOP_DAMPING_FACTOR = 4;
+
/**
* Used to inflate the Workspace from XML.
*
@@ -281,7 +288,6 @@
@Override
public void onAnimationStart(Animator animation) {
mIsInUnshrinkAnimation = true;
- disableCacheUpdates();
}
@Override
@@ -299,19 +305,13 @@
mDrawCustomizeTrayBackground = false;
}
mWallpaperOffset.setOverrideHorizontalCatchupConstant(false);
- enableCacheUpdates();
mAnimator = null;
}
};
mShrinkAnimationListener = new AnimatorListenerAdapter() {
@Override
- public void onAnimationStart(Animator animation) {
- disableCacheUpdates();
- }
- @Override
public void onAnimationEnd(Animator animation) {
mWallpaperOffset.setOverrideHorizontalCatchupConstant(false);
- enableCacheUpdates();
mAnimator = null;
}
};
@@ -539,6 +539,11 @@
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
+ if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+ mXDown = ev.getX();
+ mYDown = ev.getY();
+ }
+
if (mIsSmall || mIsInUnshrinkAnimation) {
if (mLauncher.isAllAppsVisible() &&
mShrinkState == ShrinkState.BOTTOM_HIDDEN) {
@@ -558,7 +563,34 @@
@Override
protected void determineScrollingStart(MotionEvent ev) {
- if (!mIsSmall && !mIsInUnshrinkAnimation) super.determineScrollingStart(ev);
+ float deltaX = Math.abs(ev.getX() - mXDown);
+ float deltaY = Math.abs(ev.getY() - mYDown);
+
+ if (Float.compare(deltaX, 0f) == 0) return;
+
+ float slope = deltaY / deltaX;
+ float theta = (float) Math.atan(slope);
+
+ if (deltaX > mTouchSlop || deltaY > mTouchSlop) {
+ cancelCurrentPageLongPress();
+ }
+
+ if (theta > MAX_SWIPE_ANGLE) {
+ // Above MAX_SWIPE_ANGLE, we don't want to ever start scrolling the workspace
+ return;
+ } else if (theta > START_DAMPING_TOUCH_SLOP_ANGLE) {
+ // Above START_DAMPING_TOUCH_SLOP_ANGLE and below MAX_SWIPE_ANGLE, we want to increase
+ // the touch slop to make it harder to begin scrolling the workspace. This results
+ // in vertically scrolling widgets to more easily. The higher the angle, the
+ // more we increase touch slop.
+ theta -= START_DAMPING_TOUCH_SLOP_ANGLE;
+ float extraRatio = (float)
+ Math.sqrt((theta / (MAX_SWIPE_ANGLE - START_DAMPING_TOUCH_SLOP_ANGLE)));
+ super.determineScrollingStart(ev, 1 + TOUCH_SLOP_DAMPING_FACTOR * extraRatio);
+ } else {
+ // Below START_DAMPING_TOUCH_SLOP_ANGLE, we don't do anything special
+ super.determineScrollingStart(ev);
+ }
}
protected void onPageBeginMoving() {
@@ -1039,22 +1071,6 @@
}
}
- public void enableCacheUpdates() {
- final int pageCount = getChildCount();
- for (int i = 0; i < pageCount; i++) {
- final CellLayout page = (CellLayout) getChildAt(i);
- page.enableCacheUpdates();
- }
- }
-
- public void disableCacheUpdates() {
- final int pageCount = getChildCount();
- for (int i = 0; i < pageCount; i++) {
- final CellLayout page = (CellLayout) getChildAt(i);
- page.disableCacheUpdates();
- }
- }
-
@Override
protected void onDraw(Canvas canvas) {
updateWallpaperOffsets();