From 8b678206cfa2ffc7ac3a3815b836ae8e6a792e54 Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Tue, 28 Sep 2021 19:53:11 -0400 Subject: [PATCH] Only set arrow color once when below icon. We were setting it again for the first child in any recursive call, which could cause the color to be incorrect. Test: Arrow always matches menu item below icon. Fix: 201537864 Change-Id: I8f344bb7bdec4ebc51f8b8de118bec678d71e649 --- src/com/android/launcher3/popup/ArrowPopup.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/com/android/launcher3/popup/ArrowPopup.java b/src/com/android/launcher3/popup/ArrowPopup.java index 117ae4212b..695b2ecd89 100644 --- a/src/com/android/launcher3/popup/ArrowPopup.java +++ b/src/com/android/launcher3/popup/ArrowPopup.java @@ -270,6 +270,15 @@ public abstract class ArrowPopup backgroundColor = colors[numVisibleChild % colors.length]; } + if (!ENABLE_LOCAL_COLOR_POPUPS.get()) { + // Arrow color matches the first child or the last child. + if (!mIsAboveIcon && numVisibleChild == 0 && viewGroup == this) { + mArrowColor = backgroundColor; + } else if (mIsAboveIcon) { + mArrowColor = backgroundColor; + } + } + if (view instanceof ViewGroup && mIterateChildrenTag.equals(view.getTag())) { assignMarginsAndBackgrounds((ViewGroup) view, backgroundColor); numVisibleChild++; @@ -293,12 +302,6 @@ public abstract class ArrowPopup if (!ENABLE_LOCAL_COLOR_POPUPS.get()) { setChildColor(view, backgroundColor, colorAnimator); - // Arrow color matches the first child or the last child. - if (!mIsAboveIcon && numVisibleChild == 0) { - mArrowColor = backgroundColor; - } else if (mIsAboveIcon) { - mArrowColor = backgroundColor; - } } numVisibleChild++;