Removing crosshairs

Bug: 6380576

Change-Id: I26f248fa375ae9ad24417bc55401a08bf4f479a5
This commit is contained in:
Michael Jurka
2012-04-26 12:05:05 -07:00
parent c9b5d2b980
commit af9504dc00
5 changed files with 0 additions and 68 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

-2
View File
@@ -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>
-66
View File
@@ -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