Files
rr3-apk/decompiled/sources/androidx/appcompat/app/LocaleOverlayHelper.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

45 lines
1.7 KiB
Java

package androidx.appcompat.app;
import android.os.LocaleList;
import androidx.annotation.RequiresApi;
import androidx.core.os.LocaleListCompat;
import java.util.LinkedHashSet;
import java.util.Locale;
@RequiresApi(24)
/* loaded from: classes.dex */
final class LocaleOverlayHelper {
private LocaleOverlayHelper() {
}
public static LocaleListCompat combineLocalesIfOverlayExists(LocaleListCompat localeListCompat, LocaleListCompat localeListCompat2) {
if (localeListCompat == null || localeListCompat.isEmpty()) {
return LocaleListCompat.getEmptyLocaleList();
}
return combineLocales(localeListCompat, localeListCompat2);
}
public static LocaleListCompat combineLocalesIfOverlayExists(LocaleList localeList, LocaleList localeList2) {
if (localeList == null || localeList.isEmpty()) {
return LocaleListCompat.getEmptyLocaleList();
}
return combineLocales(LocaleListCompat.wrap(localeList), LocaleListCompat.wrap(localeList2));
}
private static LocaleListCompat combineLocales(LocaleListCompat localeListCompat, LocaleListCompat localeListCompat2) {
Locale locale;
LinkedHashSet linkedHashSet = new LinkedHashSet();
for (int i = 0; i < localeListCompat.size() + localeListCompat2.size(); i++) {
if (i < localeListCompat.size()) {
locale = localeListCompat.get(i);
} else {
locale = localeListCompat2.get(i - localeListCompat.size());
}
if (locale != null) {
linkedHashSet.add(locale);
}
}
return LocaleListCompat.create((Locale[]) linkedHashSet.toArray(new Locale[linkedHashSet.size()]));
}
}