Merge "Removed warning icons and use friendlier locale names" into nyc-dev

am: 86ee2c0235

* commit '86ee2c0235402826b17db8d9b35f700954ba669b':
  Removed warning icons and use friendlier locale names
This commit is contained in:
Mihai Niță
2016-02-23 21:40:07 +00:00
committed by android-build-merger
5 changed files with 20 additions and 48 deletions

View File

@@ -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;
@@ -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;
}
@@ -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;
}
@@ -155,7 +156,7 @@ public class LocaleHelper {
}
ListFormatter lfn = ListFormatter.getInstance(dispLocale);
return lfn.format(localeNames);
return lfn.format((Object[]) localeNames);
}
/**

View File

@@ -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;
@@ -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());
}
text.setTextLocale(item.getLocale());
if (mCountryMode) {
int layoutDir = TextUtils.getLayoutDirectionFromLocale(item.getParent());
//noinspection ResourceType

View File

@@ -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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
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>
<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: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" />

View File

@@ -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"/>

View File

@@ -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" />