summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-04-26 12:05:05 -0700
committerMichael Jurka <mikejurka@google.com>2012-04-26 13:55:09 -0700
commitaf9504dc00a1e8060567854c2428f8a00d949693 (patch)
tree7a84d44a9a24e74b57e0cd6d81ca6edcfbe665d4
parentc9b5d2b9808653a94a4d830d5fb2f0ecda958f1e (diff)
downloadandroid_packages_apps_Trebuchet-af9504dc00a1e8060567854c2428f8a00d949693.tar.gz
android_packages_apps_Trebuchet-af9504dc00a1e8060567854c2428f8a00d949693.tar.bz2
android_packages_apps_Trebuchet-af9504dc00a1e8060567854c2428f8a00d949693.zip
Removing crosshairs
Bug: 6380576 Change-Id: I26f248fa375ae9ad24417bc55401a08bf4f479a5
-rw-r--r--res/drawable-hdpi/gardening_crosshairs.pngbin605 -> 0 bytes
-rw-r--r--res/drawable-mdpi/gardening_crosshairs.pngbin498 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/gardening_crosshairs.pngbin766 -> 0 bytes
-rw-r--r--res/values/config.xml2
-rw-r--r--src/com/android/launcher2/CellLayout.java66
5 files changed, 0 insertions, 68 deletions
diff --git a/res/drawable-hdpi/gardening_crosshairs.png b/res/drawable-hdpi/gardening_crosshairs.png
deleted file mode 100644
index d2d263c00..000000000
--- 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 9d9f3c15e..000000000
--- a/res/drawable-mdpi/gardening_crosshairs.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 3168463f2..000000000
--- 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 18901255b..bfd2bf5a9 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/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index a19cceacf..10eb8f8a4 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -122,10 +122,6 @@ public class CellLayout extends ViewGroup {
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 @@ public class CellLayout extends ViewGroup {
// 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 @@ public class CellLayout extends ViewGroup {
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 @@ public class CellLayout extends ViewGroup {
}
if (dragOutline == null && v == null) {
- if (mCrosshairsDrawable != null) {
- invalidate();
- }
return;
}
@@ -1262,11 +1212,6 @@ public class CellLayout extends ViewGroup {
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 @@ public class CellLayout extends ViewGroup {
*/
void onDragEnter() {
mDragEnforcer.onDragEnter();
- if (!mDragging) {
- // Fade in the drag indicators
- if (mCrosshairsAnimator != null) {
- mCrosshairsAnimator.animateIn();
- }
- }
mDragging = true;
}
@@ -2564,11 +2503,6 @@ public class CellLayout extends ViewGroup {
// Guard against that case.
if (mDragging) {
mDragging = false;
-
- // Fade out the drag indicators
- if (mCrosshairsAnimator != null) {
- mCrosshairsAnimator.animateOut();
- }
}
// Invalidate the drag data