diff options
| author | Selim Cinek <cinek@google.com> | 2015-06-02 17:33:09 +0200 |
|---|---|---|
| committer | Selim Cinek <cinek@google.com> | 2015-06-09 18:33:19 +0000 |
| commit | 78528b22c29f570469fe3c75328042f83a5a24c3 (patch) | |
| tree | c14cd8f65aaa12fd95e748cb08fd77a5c5c861a9 /core/java/android/widget/LinearLayout.java | |
| parent | 7b7e1f97aac70b47b5faae5aa1db142275ee0518 (diff) | |
| download | frameworks_base-78528b22c29f570469fe3c75328042f83a5a24c3.zip frameworks_base-78528b22c29f570469fe3c75328042f83a5a24c3.tar.gz frameworks_base-78528b22c29f570469fe3c75328042f83a5a24c3.tar.bz2 | |
Fixed a RTL layouting bug with LinearLayout
When the RTL properties of a horizontal LinearLayout
changed, nobody enforced the view to be layouted anew,
even though its layout is dependent on the layout
direction. This could lead to stale layouts being
temporarily layouted the wrong way.
Bug: 20495301
Change-Id: I979c8d86ee711626b2901b65ebdf007c1eb1c0fa
Diffstat (limited to 'core/java/android/widget/LinearLayout.java')
| -rw-r--r-- | core/java/android/widget/LinearLayout.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java index f153ce5..9d14254 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -185,6 +185,8 @@ public class LinearLayout extends ViewGroup { private int mShowDividers; private int mDividerPadding; + private int mLayoutDirection = View.LAYOUT_DIRECTION_UNDEFINED; + public LinearLayout(Context context) { this(context, null); } @@ -1567,6 +1569,17 @@ public class LinearLayout extends ViewGroup { } } + @Override + public void onRtlPropertiesChanged(@ResolvedLayoutDir int layoutDirection) { + super.onRtlPropertiesChanged(layoutDirection); + if (layoutDirection != mLayoutDirection) { + mLayoutDirection = layoutDirection; + if (mOrientation == HORIZONTAL) { + requestLayout(); + } + } + } + /** * Position the children during a layout pass if the orientation of this * LinearLayout is set to {@link #HORIZONTAL}. |
