Loading src/com/android/launcher3/popup/ArrowPopup.java +38 −20 Original line number Diff line number Diff line Loading @@ -151,13 +151,34 @@ public abstract class ArrowPopup<T extends BaseDraggingActivity> extends Abstrac * @param viewsToFlip number of views from the top to to flip in case of reverse order */ protected void reorderAndShow(int viewsToFlip) { setupForDisplay(); boolean reverseOrder = mIsAboveIcon; if (reverseOrder) { reverseOrder(viewsToFlip); } onInflationComplete(reverseOrder); addArrow(); animateOpen(); } /** * Shows the popup at the desired location. */ protected void show() { setupForDisplay(); onInflationComplete(false); addArrow(); animateOpen(); } private void setupForDisplay() { setVisibility(View.INVISIBLE); mIsOpen = true; getPopupContainer().addView(this); orientAboutObject(); } boolean reverseOrder = mIsAboveIcon; if (reverseOrder) { private void reverseOrder(int viewsToFlip) { int count = getChildCount(); ArrayList<View> allViews = new ArrayList<>(count); for (int i = 0; i < count; i++) { Loading @@ -174,9 +195,8 @@ public abstract class ArrowPopup<T extends BaseDraggingActivity> extends Abstrac orientAboutObject(); } onInflationComplete(reverseOrder); // Add the arrow. private void addArrow() { final Resources res = getResources(); final int arrowCenterOffset = res.getDimensionPixelSize(isAlignedWithStart() ? R.dimen.popup_arrow_horizontal_center_start Loading Loading @@ -214,8 +234,6 @@ public abstract class ArrowPopup<T extends BaseDraggingActivity> extends Abstrac mArrow.setPivotX(arrowLp.width / 2); mArrow.setPivotY(mIsAboveIcon ? arrowLp.height : 0); animateOpen(); } protected boolean isAlignedWithStart() { Loading src/com/android/launcher3/views/OptionsPopupView.java +1 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ public class OptionsPopupView extends ArrowPopup view.setOnLongClickListener(popup); popup.mItemMap.put(view, item); } popup.reorderAndShow(popup.getChildCount()); popup.show(); } @VisibleForTesting Loading Loading
src/com/android/launcher3/popup/ArrowPopup.java +38 −20 Original line number Diff line number Diff line Loading @@ -151,13 +151,34 @@ public abstract class ArrowPopup<T extends BaseDraggingActivity> extends Abstrac * @param viewsToFlip number of views from the top to to flip in case of reverse order */ protected void reorderAndShow(int viewsToFlip) { setupForDisplay(); boolean reverseOrder = mIsAboveIcon; if (reverseOrder) { reverseOrder(viewsToFlip); } onInflationComplete(reverseOrder); addArrow(); animateOpen(); } /** * Shows the popup at the desired location. */ protected void show() { setupForDisplay(); onInflationComplete(false); addArrow(); animateOpen(); } private void setupForDisplay() { setVisibility(View.INVISIBLE); mIsOpen = true; getPopupContainer().addView(this); orientAboutObject(); } boolean reverseOrder = mIsAboveIcon; if (reverseOrder) { private void reverseOrder(int viewsToFlip) { int count = getChildCount(); ArrayList<View> allViews = new ArrayList<>(count); for (int i = 0; i < count; i++) { Loading @@ -174,9 +195,8 @@ public abstract class ArrowPopup<T extends BaseDraggingActivity> extends Abstrac orientAboutObject(); } onInflationComplete(reverseOrder); // Add the arrow. private void addArrow() { final Resources res = getResources(); final int arrowCenterOffset = res.getDimensionPixelSize(isAlignedWithStart() ? R.dimen.popup_arrow_horizontal_center_start Loading Loading @@ -214,8 +234,6 @@ public abstract class ArrowPopup<T extends BaseDraggingActivity> extends Abstrac mArrow.setPivotX(arrowLp.width / 2); mArrow.setPivotY(mIsAboveIcon ? arrowLp.height : 0); animateOpen(); } protected boolean isAlignedWithStart() { Loading
src/com/android/launcher3/views/OptionsPopupView.java +1 −1 Original line number Diff line number Diff line Loading @@ -133,7 +133,7 @@ public class OptionsPopupView extends ArrowPopup view.setOnLongClickListener(popup); popup.mItemMap.put(view, item); } popup.reorderAndShow(popup.getChildCount()); popup.show(); } @VisibleForTesting Loading