diff options
| author | 2020-06-09 10:27:14 -0400 | |
|---|---|---|
| committer | 2020-06-09 10:27:14 -0400 | |
| commit | 7c9aa465bf3ded7ec3441d284e40b8331c1f52b0 (patch) | |
| tree | 6717345521f4f1bac32dfa271840eda97115ffa5 | |
| parent | 50980050a631c8cab0e52f6805c4be7f40647b33 (diff) | |
Fix RTL in controls and GA
Fix text direction in TextView and offset in popup.
Test: manual
Fixes: 158559238
Change-Id: I6f360e0843bc11d12ebc080c669cbb5bdda1b4bd
3 files changed, 11 insertions, 2 deletions
diff --git a/packages/SystemUI/res/layout/controls_base_item.xml b/packages/SystemUI/res/layout/controls_base_item.xml index 477a70f4c7ad..5f83f45958e9 100644 --- a/packages/SystemUI/res/layout/controls_base_item.xml +++ b/packages/SystemUI/res/layout/controls_base_item.xml @@ -52,6 +52,7 @@ android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit = "marquee_forever" + android:textDirection="locale" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="@+id/icon" app:layout_constraintStart_toEndOf="@+id/icon" /> @@ -67,6 +68,7 @@ android:focusable="false" android:maxLines="1" android:ellipsize="end" + android:textDirection="locale" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toTopOf="@id/barrier"/> @@ -90,6 +92,7 @@ android:focusable="false" android:maxLines="1" android:ellipsize="end" + android:textDirection="locale" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toStartOf="@id/favorite" app:layout_constraintTop_toTopOf="@id/favorite" diff --git a/packages/SystemUI/res/layout/controls_more_item.xml b/packages/SystemUI/res/layout/controls_more_item.xml index df03787d567c..da9c43ccc1e9 100644 --- a/packages/SystemUI/res/layout/controls_more_item.xml +++ b/packages/SystemUI/res/layout/controls_more_item.xml @@ -20,5 +20,6 @@ android:layout_height="wrap_content" android:layout_gravity="start" android:paddingStart="@dimen/control_menu_horizontal_padding" - android:paddingEnd="@dimen/control_menu_horizontal_padding"/> + android:paddingEnd="@dimen/control_menu_horizontal_padding" + android:textDirection="locale"/> diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsPopupMenu.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsPopupMenu.java index 6b71f1e9d86f..1dbbb4d69493 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsPopupMenu.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsPopupMenu.java @@ -19,6 +19,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.content.res.Resources; +import android.util.LayoutDirection; import android.view.View; import android.view.View.MeasureSpec; import android.view.WindowManager; @@ -106,7 +107,11 @@ public class GlobalActionsPopupMenu extends ListPopupWindow { listView.setPadding(0, mMenuVerticalPadding, 0, mMenuVerticalPadding); setWidth(width); - setHorizontalOffset(getAnchorView().getWidth() - mGlobalActionsSidePadding - width); + if (getAnchorView().getLayoutDirection() == LayoutDirection.LTR) { + setHorizontalOffset(getAnchorView().getWidth() - mGlobalActionsSidePadding - width); + } else { + setHorizontalOffset(mGlobalActionsSidePadding); + } } super.show(); |