Merge "Fix NPE" into jb-dev
diff --git a/res/drawable-hdpi/gardening_crosshairs.png b/res/drawable-hdpi/gardening_crosshairs.png
deleted file mode 100644
index d2d263c..0000000
--- a/res/drawable-hdpi/gardening_crosshairs.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/gardening_crosshairs.png b/res/drawable-mdpi/gardening_crosshairs.png
deleted file mode 100644
index 9d9f3c1..0000000
--- a/res/drawable-mdpi/gardening_crosshairs.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/ic_no_applications.png b/res/drawable-sw600dp-hdpi/ic_no_applications.png
deleted file mode 100644
index 933d091..0000000
--- a/res/drawable-sw600dp-hdpi/ic_no_applications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/tab_selected_focused_holo.9.png b/res/drawable-sw600dp-hdpi/tab_selected_focused_holo.9.png
deleted file mode 100644
index 1ba35d5..0000000
--- a/res/drawable-sw600dp-hdpi/tab_selected_focused_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/tab_selected_holo.9.png b/res/drawable-sw600dp-hdpi/tab_selected_holo.9.png
deleted file mode 100644
index ef913cc..0000000
--- a/res/drawable-sw600dp-hdpi/tab_selected_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/tab_selected_pressed_focused_holo.9.png b/res/drawable-sw600dp-hdpi/tab_selected_pressed_focused_holo.9.png
deleted file mode 100644
index d7e9688..0000000
--- a/res/drawable-sw600dp-hdpi/tab_selected_pressed_focused_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/tab_selected_pressed_holo.9.png b/res/drawable-sw600dp-hdpi/tab_selected_pressed_holo.9.png
deleted file mode 100644
index b8b1fcf..0000000
--- a/res/drawable-sw600dp-hdpi/tab_selected_pressed_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/ic_home_add_holo_dark.png b/res/drawable-sw600dp-mdpi/ic_home_add_holo_dark.png
deleted file mode 100644
index 7f04589..0000000
--- a/res/drawable-sw600dp-mdpi/ic_home_add_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/ic_no_applications.png b/res/drawable-sw600dp-mdpi/ic_no_applications.png
deleted file mode 100644
index a4f695a..0000000
--- a/res/drawable-sw600dp-mdpi/ic_no_applications.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/tab_selected_focused_holo.9.png b/res/drawable-sw600dp-mdpi/tab_selected_focused_holo.9.png
deleted file mode 100644
index 782ae35..0000000
--- a/res/drawable-sw600dp-mdpi/tab_selected_focused_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/tab_selected_holo.9.png b/res/drawable-sw600dp-mdpi/tab_selected_holo.9.png
deleted file mode 100644
index 255d072..0000000
--- a/res/drawable-sw600dp-mdpi/tab_selected_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/tab_selected_pressed_focused_holo.9.png b/res/drawable-sw600dp-mdpi/tab_selected_pressed_focused_holo.9.png
deleted file mode 100644
index 10152bb..0000000
--- a/res/drawable-sw600dp-mdpi/tab_selected_pressed_focused_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/tab_selected_pressed_holo.9.png b/res/drawable-sw600dp-mdpi/tab_selected_pressed_holo.9.png
deleted file mode 100644
index 822ed51..0000000
--- a/res/drawable-sw600dp-mdpi/tab_selected_pressed_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/gardening_crosshairs.png b/res/drawable-xhdpi/gardening_crosshairs.png
deleted file mode 100644
index 3168463..0000000
--- a/res/drawable-xhdpi/gardening_crosshairs.png
+++ /dev/null
Binary files differ
diff --git a/res/values/config.xml b/res/values/config.xml
index 1890125..bfd2bf5 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -42,8 +42,6 @@
<!-- The transition duration for the background of the drop targets -->
<integer name="config_dropTargetBgTransitionDuration">0</integer>
- <integer name="config_crosshairsFadeInTime">600</integer>
-
<!-- The duration (in ms) of the fade animation on the object outlines, used when
we are dragging objects around on the home screen. -->
<integer name="config_dragOutlineFadeTime">900</integer>
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 00a35a5..7b71ff4 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -1421,7 +1421,7 @@
float alpha;
- if (!LauncherApplication.isScreenLarge() || scrollProgress < 0) {
+ if (scrollProgress < 0) {
alpha = scrollProgress < 0 ? mAlphaInterpolator.getInterpolation(
1 - Math.abs(scrollProgress)) : 1.0f;
} else {
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index a19ccea..10eb8f8 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -122,10 +122,6 @@
private BubbleTextView mPressedOrFocusedIcon;
- private Drawable mCrosshairsDrawable = null;
- private InterruptibleInOutAnimator mCrosshairsAnimator = null;
- private float mCrosshairsVisibility = 0.0f;
-
private HashMap<CellLayout.LayoutParams, Animator> mReorderAnimators = new
HashMap<CellLayout.LayoutParams, Animator>();
private HashMap<View, ReorderHintAnimation>
@@ -227,19 +223,8 @@
// Initialize the data structures used for the drag visualization.
- mCrosshairsDrawable = res.getDrawable(R.drawable.gardening_crosshairs);
mEaseOutInterpolator = new DecelerateInterpolator(2.5f); // Quint ease out
- // Set up the animation for fading the crosshairs in and out
- int animDuration = res.getInteger(R.integer.config_crosshairsFadeInTime);
- mCrosshairsAnimator = new InterruptibleInOutAnimator(animDuration, 0.0f, 1.0f);
- mCrosshairsAnimator.getAnimator().addUpdateListener(new AnimatorUpdateListener() {
- public void onAnimationUpdate(ValueAnimator animation) {
- mCrosshairsVisibility = ((Float) animation.getAnimatedValue()).floatValue();
- invalidate();
- }
- });
- mCrosshairsAnimator.getAnimator().setInterpolator(mEaseOutInterpolator);
mDragCell[0] = mDragCell[1] = -1;
for (int i = 0; i < mDragOutlines.length; i++) {
@@ -422,38 +407,6 @@
bg.draw(canvas);
}
- if (mCrosshairsVisibility > 0.0f) {
- final int countX = mCountX;
- final int countY = mCountY;
-
- final float MAX_ALPHA = 0.4f;
- final int MAX_VISIBLE_DISTANCE = 600;
- final float DISTANCE_MULTIPLIER = 0.002f;
-
- final Drawable d = mCrosshairsDrawable;
- final int width = d.getIntrinsicWidth();
- final int height = d.getIntrinsicHeight();
-
- int x = getPaddingLeft() - (mWidthGap / 2) - (width / 2);
- for (int col = 0; col <= countX; col++) {
- int y = getPaddingTop() - (mHeightGap / 2) - (height / 2);
- for (int row = 0; row <= countY; row++) {
- mTmpPointF.set(x - mDragCenter.x, y - mDragCenter.y);
- float dist = mTmpPointF.length();
- // Crosshairs further from the drag point are more faint
- float alpha = Math.min(MAX_ALPHA,
- DISTANCE_MULTIPLIER * (MAX_VISIBLE_DISTANCE - dist));
- if (alpha > 0.0f) {
- d.setBounds(x, y, x + width, y + height);
- d.setAlpha((int) (alpha * 255 * mCrosshairsVisibility));
- d.draw(canvas);
- }
- y += mCellHeight + mHeightGap;
- }
- x += mCellWidth + mWidthGap;
- }
- }
-
final Paint paint = mDragOutlinePaint;
for (int i = 0; i < mDragOutlines.length; i++) {
final float alpha = mDragOutlineAlphas[i];
@@ -1205,9 +1158,6 @@
}
if (dragOutline == null && v == null) {
- if (mCrosshairsDrawable != null) {
- invalidate();
- }
return;
}
@@ -1262,11 +1212,6 @@
mDragOutlineAnims[mDragOutlineCurrent].setTag(dragOutline);
mDragOutlineAnims[mDragOutlineCurrent].animateIn();
}
-
- // If we are drawing crosshairs, the entire CellLayout needs to be invalidated
- if (mCrosshairsDrawable != null) {
- invalidate();
- }
}
public void clearDragOutlines() {
@@ -2545,12 +2490,6 @@
*/
void onDragEnter() {
mDragEnforcer.onDragEnter();
- if (!mDragging) {
- // Fade in the drag indicators
- if (mCrosshairsAnimator != null) {
- mCrosshairsAnimator.animateIn();
- }
- }
mDragging = true;
}
@@ -2564,11 +2503,6 @@
// Guard against that case.
if (mDragging) {
mDragging = false;
-
- // Fade out the drag indicators
- if (mCrosshairsAnimator != null) {
- mCrosshairsAnimator.animateOut();
- }
}
// Invalidate the drag data
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index dd2ced0..8be002c 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -174,7 +174,7 @@
private final int[] mTempXY = new int[2];
private float mOverscrollFade = 0;
private boolean mOverscrollTransformsSet;
- public static final int DRAG_BITMAP_PADDING = 0;
+ public static final int DRAG_BITMAP_PADDING = 2;
// Camera and Matrix used to determine the final position of a neighboring CellLayout
private final Matrix mMatrix = new Matrix();