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

Commit b4a80baa authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android Git Automerger
Browse files

am 5e5169b0: am 33c36895: Merge "Fix bug #7282594 EditText does not allow to...

am 5e5169b0: am 33c36895: Merge "Fix bug #7282594 EditText does not allow to move the cursor when typing RTL text and if gravity is set to LEFT" into jb-mr1-dev

* commit '5e5169b0':
  Fix bug #7282594 EditText does not allow to move the cursor when typing RTL text and if gravity is set to LEFT
parents 0681e755 5e5169b0
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -475,10 +475,14 @@ public abstract class Layout {
        Alignment align = getParagraphAlignment(line);
        int dir = getParagraphDirection(line);

        int x;
        if (align == Alignment.ALIGN_LEFT) {
            x = left;
        } else if (align == Alignment.ALIGN_NORMAL) {
            align = (dir == DIR_LEFT_TO_RIGHT) ? Alignment.ALIGN_NORMAL : Alignment.ALIGN_OPPOSITE;
        } else if (align == Alignment.ALIGN_RIGHT) {
            align = (dir == DIR_LEFT_TO_RIGHT) ? Alignment.ALIGN_OPPOSITE : Alignment.ALIGN_NORMAL;
        }

        int x;
        if (align == Alignment.ALIGN_NORMAL) {
            if (dir == DIR_LEFT_TO_RIGHT) {
                x = left;
            } else {
@@ -498,12 +502,11 @@ public abstract class Layout {
                }
            }
            int max = (int)getLineExtent(line, tabStops, false);
            if (align == Alignment.ALIGN_RIGHT) {
                x = right - max;
            } else if (align == Alignment.ALIGN_OPPOSITE) {
            if (align == Alignment.ALIGN_OPPOSITE) {
                if (dir == DIR_LEFT_TO_RIGHT) {
                    x = right - max;
                } else {
                    // max is negative here
                    x = left - max;
                }
            } else { // Alignment.ALIGN_CENTER