Merge branch 'master' into honeycomb-release
diff --git a/res/drawable-hdpi/tab_unselected_holo.9.png b/res/drawable-hdpi/tab_unselected_holo.9.png
new file mode 100644
index 0000000..db6fc14
--- /dev/null
+++ b/res/drawable-hdpi/tab_unselected_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/add_button.png b/res/drawable-mdpi/add_button.png
new file mode 100644
index 0000000..2f939d7
--- /dev/null
+++ b/res/drawable-mdpi/add_button.png
Binary files differ
diff --git a/res/drawable-mdpi/default_widget_preview.9.png b/res/drawable-mdpi/default_widget_preview.9.png
new file mode 100644
index 0000000..0d3af8b
--- /dev/null
+++ b/res/drawable-mdpi/default_widget_preview.9.png
Binary files differ
diff --git a/res/drawable-mdpi/pressed_application_background.9.png b/res/drawable-mdpi/pressed_application_background.9.png
new file mode 100644
index 0000000..b79536a
--- /dev/null
+++ b/res/drawable-mdpi/pressed_application_background.9.png
Binary files differ
diff --git a/res/drawable-mdpi/rounded_rect_green.9.png b/res/drawable-mdpi/rounded_rect_green.9.png
new file mode 100644
index 0000000..11e2114
--- /dev/null
+++ b/res/drawable-mdpi/rounded_rect_green.9.png
Binary files differ
diff --git a/res/drawable-mdpi/rounded_rect_red.9.png b/res/drawable-mdpi/rounded_rect_red.9.png
new file mode 100644
index 0000000..c3ca2f4
--- /dev/null
+++ b/res/drawable-mdpi/rounded_rect_red.9.png
Binary files differ
diff --git a/res/drawable-mdpi/wallpaper_nexuswallpaper1.png b/res/drawable-mdpi/wallpaper_nexuswallpaper1.png
new file mode 100644
index 0000000..2cc6e00
--- /dev/null
+++ b/res/drawable-mdpi/wallpaper_nexuswallpaper1.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/all_apps_button_normal.9.png b/res/drawable-xlarge-hdpi/all_apps_button_normal.9.png
new file mode 100644
index 0000000..9893ca8
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/all_apps_button_normal.9.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/all_apps_button_pressed.9.png b/res/drawable-xlarge-hdpi/all_apps_button_pressed.9.png
new file mode 100644
index 0000000..e2ba861
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/all_apps_button_pressed.9.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/app_market_generic.png b/res/drawable-xlarge-hdpi/app_market_generic.png
new file mode 100644
index 0000000..f2738f7
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/app_market_generic.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/configure_button_normal.png b/res/drawable-xlarge-hdpi/configure_button_normal.png
new file mode 100644
index 0000000..068f84d
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/configure_button_normal.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/configure_button_pressed.png b/res/drawable-xlarge-hdpi/configure_button_pressed.png
new file mode 100644
index 0000000..348a04f
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/configure_button_pressed.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/home_screen_bg.9.png b/res/drawable-xlarge-hdpi/home_screen_bg.9.png
new file mode 100644
index 0000000..9f98252
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/home_screen_bg.9.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/home_screen_bg_hover.9.png b/res/drawable-xlarge-hdpi/home_screen_bg_hover.9.png
new file mode 100644
index 0000000..e03b440
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/home_screen_bg_hover.9.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/ic_no_applications.png b/res/drawable-xlarge-hdpi/ic_no_applications.png
new file mode 100644
index 0000000..5592e6e
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/ic_no_applications.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/info_button.png b/res/drawable-xlarge-hdpi/info_button.png
new file mode 100644
index 0000000..1707a4f
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/info_button.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/mini_home_screen_bg.9.png b/res/drawable-xlarge-hdpi/mini_home_screen_bg.9.png
new file mode 100644
index 0000000..65db5f5
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/mini_home_screen_bg.9.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/mini_home_screen_bg_accepts_drops.9.png b/res/drawable-xlarge-hdpi/mini_home_screen_bg_accepts_drops.9.png
new file mode 100644
index 0000000..f56bbeb
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/mini_home_screen_bg_accepts_drops.9.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/mini_home_screen_bg_hover.9.png b/res/drawable-xlarge-hdpi/mini_home_screen_bg_hover.9.png
new file mode 100644
index 0000000..f5036fc
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/mini_home_screen_bg_hover.9.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/rotate_button_normal.png b/res/drawable-xlarge-hdpi/rotate_button_normal.png
new file mode 100644
index 0000000..3772018
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/rotate_button_normal.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/rotate_button_pressed.png b/res/drawable-xlarge-hdpi/rotate_button_pressed.png
new file mode 100644
index 0000000..7ceb996
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/rotate_button_pressed.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/search_button_normal.png b/res/drawable-xlarge-hdpi/search_button_normal.png
new file mode 100644
index 0000000..f201b65
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/search_button_normal.png
Binary files differ
diff --git a/res/drawable-xlarge-hdpi/search_button_pressed.png b/res/drawable-xlarge-hdpi/search_button_pressed.png
new file mode 100644
index 0000000..0fbb6c2
--- /dev/null
+++ b/res/drawable-xlarge-hdpi/search_button_pressed.png
Binary files differ
diff --git a/res/drawable-xlarge-mdpi/glow_wallpaper.png b/res/drawable-xlarge-nodpi/glow_wallpaper.png
similarity index 100%
rename from res/drawable-xlarge-mdpi/glow_wallpaper.png
rename to res/drawable-xlarge-nodpi/glow_wallpaper.png
Binary files differ
diff --git a/res/drawable-xlarge-mdpi/glow_wallpaper_small.png b/res/drawable-xlarge-nodpi/glow_wallpaper_small.png
similarity index 100%
rename from res/drawable-xlarge-mdpi/glow_wallpaper_small.png
rename to res/drawable-xlarge-nodpi/glow_wallpaper_small.png
Binary files differ
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f26dfc8..a8a9969 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -79,9 +79,13 @@
<!-- External-drop widget pick label format string [CHAR_LIMIT=25] -->
<string name="external_drop_widget_pick_format" translatable="false">%1$s (%2$d x %3$d)</string>
- <!-- External-drop widget error string -->
- <string name="external_drop_widget_error">Could not install clipboard item</string>
- <!-- External-drop widget pick title -->
+ <!-- External-drop widget error string. This is the error that is shown
+ when you drag and item into the homescreen and it is unable to fit,
+ or an error is encountered. [CHAR_LIMIT=50] -->
+ <string name="external_drop_widget_error">Could not drop item onto this homescreen</string>
+ <!-- External-drop widget pick title. This is shown as the title of the
+ dialog which allows you to pick which widgets to handle a particular
+ drop if there are multiple choices. [CHAR_LIMIT=35] -->
<string name="external_drop_widget_pick_title">Select widget to create</string>
<!-- Folders -->
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java
index 076f574..f4a3d44 100644
--- a/src/com/android/launcher2/BubbleTextView.java
+++ b/src/com/android/launcher2/BubbleTextView.java
@@ -39,6 +39,7 @@
private final RectF mRect = new RectF();
private Paint mPaint;
+ private int mPrevAlpha = -1;
private boolean mBackgroundSizeChanged;
private Drawable mBackground;
@@ -147,7 +148,11 @@
@Override
protected boolean onSetAlpha(int alpha) {
- mPaint.setAlpha(alpha);
- return super.onSetAlpha(alpha);
+ if (mPrevAlpha != alpha) {
+ mPrevAlpha = alpha;
+ mPaint.setAlpha(alpha);
+ super.onSetAlpha(alpha);
+ }
+ return true;
}
}
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java
index 1763a00..6dfa4e5 100644
--- a/src/com/android/launcher2/CustomizePagedView.java
+++ b/src/com/android/launcher2/CustomizePagedView.java
@@ -303,9 +303,10 @@
@Override
public void onClick(View v) {
- if (!v.isInTouchMode()) {
- return;
- }
+ // Return early if this is not initiated from a touch
+ if (!v.isInTouchMode()) return;
+ // Return early if we are still animating the pages
+ if (mNextPage != INVALID_PAGE) return;
// On certain pages, we allow single tap to mark items as selected so that they can be
// dropped onto the mini workspaces
@@ -368,9 +369,10 @@
@Override
public boolean onLongClick(View v) {
- if (!v.isInTouchMode()) {
- return false;
- }
+ // Return early if this is not initiated from a touch
+ if (!v.isInTouchMode()) return false;
+ // Return early if we are still animating the pages
+ if (mNextPage != INVALID_PAGE) return false;
// End the current choice mode before we start dragging anything
if (isChoiceMode(CHOICE_MODE_SINGLE)) {
@@ -604,17 +606,9 @@
layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
- // Temporary change to prevent the last page from being too small (and items bleeding
- // onto it). We can remove this once we properly fix the fading algorithm
- if (i < numPages - 1) {
- addView(layout, new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.MATCH_PARENT));
- } else {
- addView(layout, new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.MATCH_PARENT));
- }
+ addView(layout, new LinearLayout.LayoutParams(
+ LinearLayout.LayoutParams.WRAP_CONTENT,
+ LinearLayout.LayoutParams.MATCH_PARENT));
}
}
@@ -665,17 +659,9 @@
layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
- // Temporary change to prevent the last page from being too small (and items bleeding
- // onto it). We can remove this once we properly fix the fading algorithm
- if (i < numPages - 1) {
- addView(layout, new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.WRAP_CONTENT,
- LinearLayout.LayoutParams.MATCH_PARENT));
- } else {
- addView(layout, new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.MATCH_PARENT));
- }
+ addView(layout, new LinearLayout.LayoutParams(
+ LinearLayout.LayoutParams.WRAP_CONTENT,
+ LinearLayout.LayoutParams.MATCH_PARENT));
}
}
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 109696c..caa1e12 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -57,7 +57,7 @@
// The min drag distance to trigger a page shift (regardless of velocity)
private static final int MIN_LENGTH_FOR_MOVE = 200;
- private static final int PAGE_SNAP_ANIMATION_DURATION = 1000;
+ private static final int PAGE_SNAP_ANIMATION_DURATION = 750;
protected static final float NANOTIME_DIV = 1000000000.0f;
// the velocity at which a fling gesture will cause us to snap to the next page
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index 50ba8d4..b9b9b37 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -52,7 +52,7 @@
private Object mIconCacheKey;
private PagedViewIconCache mIconCache;
- private int mAlpha;
+ private int mAlpha = -1;
private int mHolographicAlpha;
private boolean mIsChecked;
@@ -162,9 +162,13 @@
public void setAlpha(float alpha) {
final float viewAlpha = sHolographicOutlineHelper.viewAlphaInterpolator(alpha);
final float holographicAlpha = sHolographicOutlineHelper.highlightAlphaInterpolator(alpha);
- mAlpha = (int) (viewAlpha * 255);
- mHolographicAlpha = (int) (holographicAlpha * 255);
- super.setAlpha(viewAlpha);
+ int newViewAlpha = (int) (viewAlpha * 255);
+ int newHolographicAlpha = (int) (holographicAlpha * 255);
+ if ((mAlpha != newViewAlpha) || (mHolographicAlpha != newHolographicAlpha)) {
+ mAlpha = newViewAlpha;
+ mHolographicAlpha = newHolographicAlpha;
+ super.setAlpha(viewAlpha);
+ }
}
public void invalidateCheckedImage() {
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index eac9ebd..82fd362 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -848,17 +848,21 @@
if (animated) {
final int duration = res.getInteger(R.integer.config_workspaceShrinkTime);
ObjectAnimator anim = ObjectAnimator.ofPropertyValuesHolder(cl,
+ PropertyValuesHolder.ofFloat("backgroundAlpha", finalAlpha),
+ PropertyValuesHolder.ofFloat("alpha", finalAlpha),
+ PropertyValuesHolder.ofFloat("rotationY", rotation));
+ anim.setDuration(duration);
+
+ ObjectAnimator animWithInterpolator = ObjectAnimator.ofPropertyValuesHolder(cl,
PropertyValuesHolder.ofFloat("x", newX),
PropertyValuesHolder.ofFloat("y", newY),
PropertyValuesHolder.ofFloat("scaleX",
SHRINK_FACTOR * rotationScaleX * extraShrinkFactor),
PropertyValuesHolder.ofFloat("scaleY",
- SHRINK_FACTOR * rotationScaleY * extraShrinkFactor),
- PropertyValuesHolder.ofFloat("backgroundAlpha", finalAlpha),
- PropertyValuesHolder.ofFloat("alpha", finalAlpha),
- PropertyValuesHolder.ofFloat("rotationY", rotation));
- anim.setDuration(duration);
- mAnimator.playTogether(anim);
+ SHRINK_FACTOR * rotationScaleY * extraShrinkFactor));
+ animWithInterpolator.setDuration(duration);
+ animWithInterpolator.setInterpolator(mZInterpolator);
+ mAnimator.playTogether(anim, animWithInterpolator);
} else {
cl.setX((int)newX);
cl.setY((int)newY);
@@ -877,12 +881,27 @@
setChildrenDrawnWithCacheEnabled(true);
}
+ private class ZInterpolator implements TimeInterpolator {
+ private final float focalLength = 0.2f;
+ public float getInterpolation(float input) {
+ return (1.0f - focalLength / (focalLength + input)) /
+ (1.0f - focalLength / (focalLength + 1.0f));
+ }
+ }
+
+ private class InverseZInterpolator implements TimeInterpolator {
+ public float getInterpolation(float input) {
+ return 1 - mZInterpolator.getInterpolation(1 - input);
+ }
+ }
+
+ private final ZInterpolator mZInterpolator = new ZInterpolator();
+ private final InverseZInterpolator mInverseZInterpolator = new InverseZInterpolator();
private void updateWhichPagesAcceptDrops(ShrinkPosition state) {
updateWhichPagesAcceptDropsHelper(state, false, 1, 1);
}
-
private void updateWhichPagesAcceptDropsDuringDrag(ShrinkPosition state, int spanX, int spanY) {
updateWhichPagesAcceptDropsHelper(state, true, spanX, spanY);
}
@@ -1007,14 +1026,20 @@
}
if (animated) {
- mAnimator.playTogether(
- ObjectAnimator.ofFloat(cl, "translationX", 0.0f).setDuration(duration),
- ObjectAnimator.ofFloat(cl, "translationY", 0.0f).setDuration(duration),
- ObjectAnimator.ofFloat(cl, "scaleX", 1.0f).setDuration(duration),
- ObjectAnimator.ofFloat(cl, "scaleY", 1.0f).setDuration(duration),
- ObjectAnimator.ofFloat(cl, "backgroundAlpha", 0.0f).setDuration(duration),
- ObjectAnimator.ofFloat(cl, "alpha", finalAlphaValue).setDuration(duration),
- ObjectAnimator.ofFloat(cl, "rotationY", rotation).setDuration(duration));
+ ObjectAnimator anim = ObjectAnimator.ofPropertyValuesHolder(cl,
+ PropertyValuesHolder.ofFloat("backgroundAlpha", 0.0f),
+ PropertyValuesHolder.ofFloat("alpha", finalAlphaValue),
+ PropertyValuesHolder.ofFloat("rotationY", rotation));
+ anim.setDuration(duration);
+
+ ObjectAnimator animWithInterpolator = ObjectAnimator.ofPropertyValuesHolder(cl,
+ PropertyValuesHolder.ofFloat("translationX", 0.0f),
+ PropertyValuesHolder.ofFloat("translationY", 0.0f),
+ PropertyValuesHolder.ofFloat("scaleX", 1.0f),
+ PropertyValuesHolder.ofFloat("scaleY", 1.0f));
+ animWithInterpolator.setDuration(duration);
+ animWithInterpolator.setInterpolator(mInverseZInterpolator);
+ mAnimator.playTogether(anim, animWithInterpolator);
} else {
cl.setTranslationX(0.0f);
cl.setTranslationY(0.0f);