Loading core/java/com/android/internal/app/LocaleHelper.java +5 −4 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package com.android.internal.app; import android.icu.util.ULocale; import android.icu.text.ListFormatter; import android.icu.util.ULocale; import android.util.LocaleList; import java.text.Collator; Loading Loading @@ -99,7 +99,7 @@ public class LocaleHelper { * @return the localized name of the locale. */ public static String getDisplayName(Locale locale, Locale displayLocale, boolean sentenceCase) { String result = ULocale.getDisplayName(locale.toLanguageTag(), String result = ULocale.getDisplayNameWithDialect(locale.toLanguageTag(), ULocale.forLocale(displayLocale)); return sentenceCase ? toSentenceCase(result, displayLocale) : result; } Loading @@ -112,7 +112,8 @@ public class LocaleHelper { * @return the localized name of the locale. */ public static String getDisplayName(Locale locale, boolean sentenceCase) { String result = ULocale.getDisplayName(locale.toLanguageTag(), ULocale.getDefault()); String result = ULocale.getDisplayNameWithDialect(locale.toLanguageTag(), ULocale.getDefault()); return sentenceCase ? toSentenceCase(result, Locale.getDefault()) : result; } Loading Loading @@ -155,7 +156,7 @@ public class LocaleHelper { } ListFormatter lfn = ListFormatter.getInstance(dispLocale); return lfn.format(localeNames); return lfn.format((Object[]) localeNames); } /** Loading core/java/com/android/internal/app/SuggestedLocaleAdapter.java +1 −9 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Filter; import android.widget.Filterable; import android.widget.ImageView; import android.widget.TextView; import com.android.internal.R; Loading Loading @@ -156,16 +155,9 @@ public class SuggestedLocaleAdapter extends BaseAdapter implements Filterable { } TextView text = (TextView) convertView.findViewById(R.id.locale); ImageView localized = (ImageView) convertView.findViewById(R.id.l10nWarn); LocaleStore.LocaleInfo item = (LocaleStore.LocaleInfo) getItem(position); text.setText(item.getLabel()); if (item.isTranslated() || mCountryMode) { localized.setVisibility(View.GONE); text.setTextLocale(item.getLocale()); } else { localized.setVisibility(View.VISIBLE); text.setTextLocale(Locale.getDefault()); } if (mCountryMode) { int layoutDir = TextUtils.getLayoutDirectionFromLocale(item.getParent()); //noinspection ResourceType Loading core/res/res/layout/language_picker_item.xml +13 −34 Original line number Diff line number Diff line Loading @@ -14,37 +14,16 @@ limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/locale" android:gravity="center_vertical" android:orientation="horizontal" android:minHeight="?android:attr/listPreferredItemHeight" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:textAppearance="?android:attr/textAppearanceListItem" android:layoutDirection="locale" android:textDirection="locale" android:paddingBottom="8dp" android:paddingTop="8dp"> <TextView android:id="@+id/locale" android:layout_width="0dp" android:layout_height="wrap_content" tools:text="France" android:layout_weight="1" android:padding="12dp" android:paddingStart="18dp" android:paddingEnd="18dp" android:textAppearance="?android:attr/textAppearanceListItem"/> <ImageView android:id="@+id/l10nWarn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/stat_sys_warning" android:focusableInTouchMode="false" android:focusable="false" android:paddingStart="12dp" android:paddingEnd="12dp" android:tint="?android:attr/colorAccent"/> </LinearLayout> android:paddingTop="8dp" /> core/res/res/layout/language_picker_section_header.xml +1 −0 Original line number Diff line number Diff line Loading @@ -23,4 +23,5 @@ android:paddingStart="18dp" android:paddingEnd="18dp" android:textColor="?android:attr/colorAccent" android:textStyle="bold" tools:text="@string/language_picker_section_all"/> core/res/res/values/symbols.xml +0 −1 Original line number Diff line number Diff line Loading @@ -2486,7 +2486,6 @@ <java-symbol type="string" name="status_bar_clock" /> <!-- Locale picker --> <java-symbol type="id" name="l10nWarn" /> <java-symbol type="id" name="locale_search_menu" /> <java-symbol type="layout" name="language_picker_item" /> <java-symbol type="layout" name="language_picker_section_header" /> Loading Loading
core/java/com/android/internal/app/LocaleHelper.java +5 −4 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ package com.android.internal.app; import android.icu.util.ULocale; import android.icu.text.ListFormatter; import android.icu.util.ULocale; import android.util.LocaleList; import java.text.Collator; Loading Loading @@ -99,7 +99,7 @@ public class LocaleHelper { * @return the localized name of the locale. */ public static String getDisplayName(Locale locale, Locale displayLocale, boolean sentenceCase) { String result = ULocale.getDisplayName(locale.toLanguageTag(), String result = ULocale.getDisplayNameWithDialect(locale.toLanguageTag(), ULocale.forLocale(displayLocale)); return sentenceCase ? toSentenceCase(result, displayLocale) : result; } Loading @@ -112,7 +112,8 @@ public class LocaleHelper { * @return the localized name of the locale. */ public static String getDisplayName(Locale locale, boolean sentenceCase) { String result = ULocale.getDisplayName(locale.toLanguageTag(), ULocale.getDefault()); String result = ULocale.getDisplayNameWithDialect(locale.toLanguageTag(), ULocale.getDefault()); return sentenceCase ? toSentenceCase(result, Locale.getDefault()) : result; } Loading Loading @@ -155,7 +156,7 @@ public class LocaleHelper { } ListFormatter lfn = ListFormatter.getInstance(dispLocale); return lfn.format(localeNames); return lfn.format((Object[]) localeNames); } /** Loading
core/java/com/android/internal/app/SuggestedLocaleAdapter.java +1 −9 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Filter; import android.widget.Filterable; import android.widget.ImageView; import android.widget.TextView; import com.android.internal.R; Loading Loading @@ -156,16 +155,9 @@ public class SuggestedLocaleAdapter extends BaseAdapter implements Filterable { } TextView text = (TextView) convertView.findViewById(R.id.locale); ImageView localized = (ImageView) convertView.findViewById(R.id.l10nWarn); LocaleStore.LocaleInfo item = (LocaleStore.LocaleInfo) getItem(position); text.setText(item.getLabel()); if (item.isTranslated() || mCountryMode) { localized.setVisibility(View.GONE); text.setTextLocale(item.getLocale()); } else { localized.setVisibility(View.VISIBLE); text.setTextLocale(Locale.getDefault()); } if (mCountryMode) { int layoutDir = TextUtils.getLayoutDirectionFromLocale(item.getParent()); //noinspection ResourceType Loading
core/res/res/layout/language_picker_item.xml +13 −34 Original line number Diff line number Diff line Loading @@ -14,37 +14,16 @@ limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/locale" android:gravity="center_vertical" android:orientation="horizontal" android:minHeight="?android:attr/listPreferredItemHeight" android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:textAppearance="?android:attr/textAppearanceListItem" android:layoutDirection="locale" android:textDirection="locale" android:paddingBottom="8dp" android:paddingTop="8dp"> <TextView android:id="@+id/locale" android:layout_width="0dp" android:layout_height="wrap_content" tools:text="France" android:layout_weight="1" android:padding="12dp" android:paddingStart="18dp" android:paddingEnd="18dp" android:textAppearance="?android:attr/textAppearanceListItem"/> <ImageView android:id="@+id/l10nWarn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/stat_sys_warning" android:focusableInTouchMode="false" android:focusable="false" android:paddingStart="12dp" android:paddingEnd="12dp" android:tint="?android:attr/colorAccent"/> </LinearLayout> android:paddingTop="8dp" />
core/res/res/layout/language_picker_section_header.xml +1 −0 Original line number Diff line number Diff line Loading @@ -23,4 +23,5 @@ android:paddingStart="18dp" android:paddingEnd="18dp" android:textColor="?android:attr/colorAccent" android:textStyle="bold" tools:text="@string/language_picker_section_all"/>
core/res/res/values/symbols.xml +0 −1 Original line number Diff line number Diff line Loading @@ -2486,7 +2486,6 @@ <java-symbol type="string" name="status_bar_clock" /> <!-- Locale picker --> <java-symbol type="id" name="l10nWarn" /> <java-symbol type="id" name="locale_search_menu" /> <java-symbol type="layout" name="language_picker_item" /> <java-symbol type="layout" name="language_picker_section_header" /> Loading