Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea0f2aee authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Fix PopupWindow of overflow menu is not RTL(Right to Left) issue"

parents 3d8515a0 7525b6ee
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -1067,6 +1067,17 @@ public class PopupWindow {
        }
    }

    private boolean isNeedSetLayoutDirectionFromAnchor() {
        if (mPopupViewInitialLayoutDirectionInherited && mPopupView != null && mAnchor != null) {
            View anchor = mAnchor.get();
            if (anchor != null
                    && (mPopupView.getLayoutDirection() != anchor.getLayoutDirection())) {
                return true;
            }
        }
        return false;
    }

    /**
     * <p>Generate the layout parameters for the popup window.</p>
     *
@@ -1405,6 +1416,10 @@ public class PopupWindow {
            update = true;
        }

        if (isNeedSetLayoutDirectionFromAnchor()) {
            update = true;
        }

        if (update) {
            setLayoutDirectionFromAnchor();
            mWindowManager.updateViewLayout(mPopupView, p);
@@ -1506,6 +1521,10 @@ public class PopupWindow {
            update = true;
        }

        if (isNeedSetLayoutDirectionFromAnchor()) {
            update = true;
        }

        if (update) {
            setLayoutDirectionFromAnchor();
            mWindowManager.updateViewLayout(mPopupView, p);