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

Commit 66104119 authored by Yigit Boyar's avatar Yigit Boyar
Browse files

Fix RTL horizontal spacing in Gridview

Bug: 16659566
Change-Id: I0e7c834c6fedf39562fe880284373eda43412563
parent 0a4ea30c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -351,6 +351,7 @@ public class GridView extends AbsListView {
        final int selectedPosition = mSelectedPosition;

        View child = null;
        final int nextChildDir = isLayoutRtl ? -1 : +1;
        for (int pos = startPos; pos < last; pos++) {
            // is this the selected item?
            boolean selected = pos == selectedPosition;
@@ -359,9 +360,9 @@ public class GridView extends AbsListView {
            final int where = flow ? -1 : pos - startPos;
            child = makeAndAddView(pos, y, flow, nextLeft, selected, where);

            nextLeft += (isLayoutRtl ? -1 : +1) * columnWidth;
            nextLeft += nextChildDir * columnWidth;
            if (pos < last - 1) {
                nextLeft += horizontalSpacing;
                nextLeft += nextChildDir * horizontalSpacing;
            }

            if (selected && (hasFocus || inClick)) {