From af9504dc00a1e8060567854c2428f8a00d949693 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 26 Apr 2012 12:05:05 -0700 Subject: [PATCH] Removing crosshairs Bug: 6380576 Change-Id: I26f248fa375ae9ad24417bc55401a08bf4f479a5 --- res/drawable-hdpi/gardening_crosshairs.png | Bin 605 -> 0 bytes res/drawable-mdpi/gardening_crosshairs.png | Bin 498 -> 0 bytes res/drawable-xhdpi/gardening_crosshairs.png | Bin 766 -> 0 bytes res/values/config.xml | 2 - src/com/android/launcher2/CellLayout.java | 66 -------------------- 5 files changed, 68 deletions(-) delete mode 100644 res/drawable-hdpi/gardening_crosshairs.png delete mode 100644 res/drawable-mdpi/gardening_crosshairs.png delete mode 100644 res/drawable-xhdpi/gardening_crosshairs.png diff --git a/res/drawable-hdpi/gardening_crosshairs.png b/res/drawable-hdpi/gardening_crosshairs.png deleted file mode 100644 index d2d263c003e14786770efcb70531c56053ec4901..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 605 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*FB&(dWK42+4ME{-7{$KOuf@5SsWaIAiJ`E>gv2iHJp zc?S`fn&t=z!>Q|&AHI%=&X{~GDtC%Wn3-Cpi*FC-y|)o};w&DiMmo=GV2I3-Y@(Yu$}SEjX#1JOh&8wSq^@B^|ElS=F}+X2H^wcJ70vbR3!OqyvjYl|-!@s9)jNAon5hz6?)fgMRg|K&(UHR$<<4o3gN6kPh3t-5rmbgZgq$HN4 zS|t~y0x1R~14Bby19M#?^AJO0D-#1NLsKBv%D}*T)ulib4Y~O#nQ4`18jLNijLjh$ ztdgBR05wR0YzWRzD=AMbN@Z|N$xljE@XSq2PYp^tUm6Yg1bO#!bByN z*bN(nq~EsgagYuDM@V$-xfA!)Xqz=!zCg!0yoa>Whh)?)7tR_&DW^s$Thc3bk< z?3?)y=38i-v~)QBq1+)~tFFedrpi{{#*Vo?H8yPFuelr(FEL!rWjVEP`?Ld51#9!B z#)Ru1f4iMQQz7!;&8r1p9$3^b4^w}u)=`o8A@TTDF}1(1{N8(W$5E$gMk<}*Ev+qPk|shFep zB7wPwChe`X?|#TUz0JSjsF`rsnaECgrFw^8Hsw-Ku&9=}MwFx^mZVxG7o`Fz1|tJQ zLtO)NT_f`lLt`rw11m#QAlJ&kz%X8O-xS>N=;0uEIgTN160J|>FVdQ&MBb@0C+#NtN;K2 diff --git a/res/drawable-xhdpi/gardening_crosshairs.png b/res/drawable-xhdpi/gardening_crosshairs.png deleted file mode 100644 index 3168463f2d7a5d0a0e6b8259de07f22fa3b9f089..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzwj^(N7l!{JxM1({$v_d#0*}aI zAngIhZYQ(tK!Rljj_E*J0gT&!&6&%oopmCYlH4oLEBT7^{_wnY{PM_MK;$o1l|Jvcs4BrKfukN=y8Nj4RZD;EGsC$c=XtIvy9)Bk60Dw$urElJ1@ok%UT&5{z)HXTeNf? z80WqH`FuiW2&~a znJD#GA@1M-_N4fm`T~<l5c2AE_3OhOH7;TG9V9l8LWKwc0qvxcYdrazQ*UVOt4B&m8^CbW9#K-IpqNZ<` zTiMzOOctsot`Q|Ei6yC4$wjF^iowXh&`{UFT-V4v#L(Ev#K6kX6v(wQFz{Y=DG)_N zZhlH;S|yqWV@oSzbBG43WTy{64U!-mg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h R+5i 0 - 600 - 900 diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java index a19cceacf0..10eb8f8a41 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 mReorderAnimators = new HashMap(); private HashMap @@ -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