diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java index 5a34d2a74f..15915e5380 100644 --- a/src/com/android/launcher3/popup/ArrowPopup.java +++ b/src/com/android/launcher3/popup/ArrowPopup.java @@ -164,7 +164,9 @@ public abstract class ArrowPopup extends Abstrac reverseOrder(viewsToFlip); } onInflationComplete(reverseOrder); - addArrow(); + if (shouldAddArrow()) { + addArrow(); + } animateOpen(); } @@ -174,7 +176,9 @@ public abstract class ArrowPopup extends Abstrac protected void show() { setupForDisplay(); onInflationComplete(false); - addArrow(); + if (shouldAddArrow()) { + addArrow(); + } animateOpen(); } @@ -232,6 +236,13 @@ public abstract class ArrowPopup extends Abstrac mArrow.setPivotY(mIsAboveIcon ? mArrowHeight : 0); } + /** + * Returns whether or not we should add the arrow. + */ + protected boolean shouldAddArrow() { + return true; + } + /** * Provide the location of the target object relative to the dragLayer. */ @@ -392,13 +403,18 @@ public abstract class ArrowPopup extends Abstrac return getChildCount() > 0 ? getChildAt(0) : this; } + private int getArrowDuration() { + return shouldAddArrow() + ? getResources().getInteger(R.integer.config_popupArrowOpenCloseDuration) + : 0; + } private void animateOpen() { setVisibility(View.VISIBLE); final AnimatorSet openAnim = new AnimatorSet(); final Resources res = getResources(); final long revealDuration = (long) res.getInteger(R.integer.config_popupOpenCloseDuration); - final long arrowDuration = res.getInteger(R.integer.config_popupArrowOpenCloseDuration); + final long arrowDuration = getArrowDuration(); final TimeInterpolator revealInterpolator = ACCEL_DEACCEL; // Rectangular reveal. @@ -460,7 +476,7 @@ public abstract class ArrowPopup extends Abstrac final Resources res = getResources(); final TimeInterpolator revealInterpolator = ACCEL_DEACCEL; final long revealDuration = res.getInteger(R.integer.config_popupOpenCloseDuration); - final long arrowDuration = res.getInteger(R.integer.config_popupArrowOpenCloseDuration); + final long arrowDuration = getArrowDuration(); // Hide the arrow Animator scaleArrow = ObjectAnimator.ofFloat(mArrow, LauncherAnimUtils.SCALE_PROPERTY, 0) diff --git a/src/com/android/launcher3/views/OptionsPopupView.java b/src/com/android/launcher3/views/OptionsPopupView.java index 899dcf702b..1a114f3ce7 100644 --- a/src/com/android/launcher3/views/OptionsPopupView.java +++ b/src/com/android/launcher3/views/OptionsPopupView.java @@ -113,6 +113,11 @@ public class OptionsPopupView extends ArrowPopup return (type & TYPE_OPTIONS_POPUP) != 0; } + @Override + protected boolean shouldAddArrow() { + return false; + } + @Override protected void getTargetObjectLocation(Rect outPos) { mTargetRect.roundOut(outPos);