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

Commit c91b6ca4 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Make ScrollBar widget aware of layout direction

- see bug #5429822 UI should be mirrored for RTL locales (Arabic, Hebrew, farsi)
- also use isLayoutRtl() for being more concise

Change-Id: Ibf861333effdc646398fcd9354d96f2156550607
parent 3a4832aa
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -11293,9 +11293,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                    scrollBar.setParameters(computeVerticalScrollRange(),
                                            computeVerticalScrollOffset(),
                                            computeVerticalScrollExtent(), true);
                    switch (mVerticalScrollbarPosition) {
                    int verticalScrollbarPosition = mVerticalScrollbarPosition;
                    if (verticalScrollbarPosition == SCROLLBAR_POSITION_DEFAULT) {
                        verticalScrollbarPosition = isLayoutRtl() ?
                                SCROLLBAR_POSITION_LEFT : SCROLLBAR_POSITION_RIGHT;
                    }
                    switch (verticalScrollbarPosition) {
                        default:
                        case SCROLLBAR_POSITION_DEFAULT:
                        case SCROLLBAR_POSITION_RIGHT:
                            left = scrollX + width - size - (mUserPaddingRight & inside);
                            break;
@@ -14328,7 +14332,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                        ? 0 : getVerticalScrollbarWidth();
                switch (mVerticalScrollbarPosition) {
                    case SCROLLBAR_POSITION_DEFAULT:
                        if (getResolvedLayoutDirection() == LAYOUT_DIRECTION_RTL) {
                        if (isLayoutRtl()) {
                            left += offset;
                        } else {
                            right += offset;