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

Commit d10a5767 authored by Romain Guy's avatar Romain Guy
Browse files

Fixes 2017393. Correctly apply gravity in RelativeLayout.

RL was applying a horizontal offset to its children even when the gravity was only
specified for the vertical axis (and vice-versa.)

Also fix the ExpandableListView icons.
parent cdb9e971
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -486,14 +486,18 @@ public class RelativeLayout extends ViewGroup {
                    View child = getChildAt(i);
                    if (child.getVisibility() != GONE && child != ignore) {
                        LayoutParams params = (LayoutParams) child.getLayoutParams();
                        if (horizontalGravity) {
                            params.mLeft += horizontalOffset;
                            params.mRight += horizontalOffset;
                        }
                        if (verticalGravity) {
                            params.mTop += verticalOffset;
                            params.mBottom += verticalOffset;
                        }
                    }
                }
            }
        }

        setMeasuredDimension(width, height);
    }
+1 B (1.12 KiB)
Loading image diff...
−5 B (1.14 KiB)
Loading image diff...