OSDN Git Service

Fixed RTL alignment issue in suggested language list
authorsusanta.patra <susanta.patra@lge.com>
Fri, 8 Dec 2017 04:53:13 +0000 (10:23 +0530)
committerFan Zhang <zhfan@google.com>
Fri, 22 Dec 2017 17:41:30 +0000 (09:41 -0800)
Suggested language list alignment should be as per the default locale.

Test: 1. RTL language
      2. Settings>System>Languages & input>Languages>Add a language>English
      3. Check the alignment
Bug: 70360392

Change-Id: I934b1061fb897ac69270a493562defba4a5a1a35
Signed-off-by: susanta.patra <susanta.patra@lge.com>
core/java/com/android/internal/app/SuggestedLocaleAdapter.java

index 46f47a3..d138241 100644 (file)
@@ -199,7 +199,7 @@ public class SuggestedLocaleAdapter extends BaseAdapter implements Filterable {
                 text.setTextLocale(item.getLocale());
                 text.setContentDescription(item.getContentDescription(mCountryMode));
                 if (mCountryMode) {
-                    int layoutDir = TextUtils.getLayoutDirectionFromLocale(item.getParent());
+                    int layoutDir = TextUtils.getLayoutDirectionFromLocale(Locale.getDefault());
                     //noinspection ResourceType
                     convertView.setLayoutDirection(layoutDir);
                     text.setTextDirection(layoutDir == View.LAYOUT_DIRECTION_RTL