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

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

am 36fb0166: Merge "Fix bug #8200928 ExpandableListView should be RTL-aware" into jb-mr2-dev

* commit '36fb0166':
  Fix bug #8200928 ExpandableListView should be RTL-aware
parents 506694e6 36fb0166
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -288,6 +288,9 @@ public class ExpandableListView extends ListView {
            // Get more expandable list-related info for this item
            pos = mConnector.getUnflattenedPos(childFlPos);

            final boolean isLayoutRtl = isLayoutRtl();
            final int width = getWidth();

            // If this item type and the previous item type are different, then we need to change
            // the left & right bounds
            if (pos.position.type != lastItemType) {
@@ -301,8 +304,17 @@ public class ExpandableListView extends ListView {
                    indicatorRect.right = mIndicatorRight;
                }

                if (isLayoutRtl) {
                    final int temp = indicatorRect.left;
                    indicatorRect.left = width - indicatorRect.right;
                    indicatorRect.right = width - temp;

                    indicatorRect.left -= mPaddingRight;
                    indicatorRect.right -= mPaddingRight;
                } else {
                    indicatorRect.left += mPaddingLeft;
                    indicatorRect.right += mPaddingLeft;
                }

                lastItemType = pos.position.type; 
            }
+1 −0
Original line number Diff line number Diff line
@@ -21,4 +21,5 @@
    android:paddingStart="?android:attr/expandableListPreferredItemPaddingLeft"
    android:textAppearance="?android:attr/textAppearanceListItem"
    android:gravity="center_vertical"
    android:textAlignment="viewStart"
/>
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
        android:layout_height="wrap_content"
        android:layout_marginTop="6dip"
        android:textAppearance="?android:attr/textAppearanceListItem"
        android:textAlignment="viewStart"
    />

    <TextView android:id="@android:id/text2"
@@ -36,6 +37,7 @@
        android:layout_below="@android:id/text1"
        android:layout_alignStart="@android:id/text1"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textAlignment="viewStart"
    />

</TwoLineListItem>