Skip to content

Commit dd6bb24

Browse files
amirzaidiSirRGB
authored andcommitted
Launcher3: Keep spring adaptive icon hidden until drag starts
1 parent ce83c37 commit dd6bb24

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/com/android/launcher3/dragndrop/DragView.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public class DragView extends View implements LauncherStateManager.StateListener
109109
private Path mScaledMaskPath;
110110
private Drawable mBadge;
111111
private ColorMatrixColorFilter mBaseFilter;
112+
private boolean mShowSpringIcon;
112113

113114
/**
114115
* Construct the drag view.
@@ -397,7 +398,7 @@ protected void onDraw(Canvas canvas) {
397398
}
398399
}
399400

400-
if (mScaledMaskPath != null) {
401+
if (mScaledMaskPath != null && mShowSpringIcon) {
401402
int cnt = canvas.save();
402403
canvas.clipPath(mScaledMaskPath);
403404
mBgSpringDrawable.draw(canvas);
@@ -516,6 +517,9 @@ public void cancelAnimation() {
516517
public void move(int touchX, int touchY) {
517518
if (touchX > 0 && touchY > 0 && mLastTouchX > 0 && mLastTouchY > 0
518519
&& mScaledMaskPath != null) {
520+
if (mLastTouchX != touchX || mLastTouchY != touchY) {
521+
mShowSpringIcon = true;
522+
}
519523
mTranslateX.animateToPos(mLastTouchX - touchX);
520524
mTranslateY.animateToPos(mLastTouchY - touchY);
521525
}

0 commit comments

Comments
 (0)