Lines Matching defs:LocaleList

33  * LocaleList is an immutable list of Locales, typically used to keep an ordered list of user
36 public final class LocaleList implements Parcelable {
38 // This is a comma-separated list of the locales in the LocaleList created at construction time,
45 private static final LocaleList sEmptyLocaleList = new LocaleList();
58 * Returns whether the {@link LocaleList} contains no {@link Locale} items.
60 * @return {@code true} if this {@link LocaleList} has no {@link Locale} items, {@code false}
68 * Returns the number of {@link Locale} items in this {@link LocaleList}.
76 * Searches this {@link LocaleList} for the specified {@link Locale} and returns the index of
97 if (!(other instanceof LocaleList))
99 final Locale[] otherList = ((LocaleList) other).mList;
151 * Creates a new {@link LocaleList}.
159 public LocaleList(@NonNull Locale... list) {
194 public LocaleList(@NonNull Locale topLocale, LocaleList otherLocales) {
237 public static final Parcelable.Creator<LocaleList> CREATOR
238 = new Parcelable.Creator<LocaleList>() {
240 public LocaleList createFromParcel(Parcel source) {
241 return LocaleList.forLanguageTags(source.readString());
245 public LocaleList[] newArray(int size) {
246 return new LocaleList[size];
251 * Retrieve an empty instance of {@link LocaleList}.
254 public static LocaleList getEmptyLocaleList() {
259 * Generates a new LocaleList with the given language tags.
265 public static LocaleList forLanguageTags(@Nullable String list) {
274 return new LocaleList(localeArray);
353 // Try English first, so we can return early if it's in the LocaleList
392 * {@code null} if the {@link LocaleList} is empty.
460 private static LocaleList sLastExplicitlySetLocaleList = null;
462 private static LocaleList sDefaultLocaleList = null;
464 private static LocaleList sDefaultAdjustedLocaleList = null;
475 * <p>Note that the default LocaleList would change if Locale.setDefault() is called. This
477 * recalculating the default LocaleList if needed.</p>
480 public static LocaleList getDefault() {
494 sDefaultLocaleList = new LocaleList(defaultLocale, sLastExplicitlySetLocaleList);
498 // LocaleList.setDefault(), and if getDefault() is called before a call to
510 public static LocaleList getAdjustedDefault() {
524 public static void setDefault(@NonNull @Size(min=1) LocaleList locales) {
536 public static void setDefault(@NonNull @Size(min=1) LocaleList locales, int localeIndex) {
551 sDefaultAdjustedLocaleList = new LocaleList(