am 8b46c595: Merge "Clean SubtypeLocaleUtils a bit"
* commit '8b46c595dc54f3f858116428855592bc8b67018a': Clean SubtypeLocaleUtils a bitmain
commit
2103f795fa
|
@ -346,8 +346,10 @@ final class CustomInputStylePreference extends DialogPreference
|
||||||
super(context, android.R.layout.simple_spinner_item);
|
super(context, android.R.layout.simple_spinner_item);
|
||||||
setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
|
||||||
|
final String[] predefinedKeyboardLayoutSet = context.getResources().getStringArray(
|
||||||
|
R.array.predefined_layouts);
|
||||||
// TODO: Should filter out already existing combinations of locale and layout.
|
// TODO: Should filter out already existing combinations of locale and layout.
|
||||||
for (final String layout : SubtypeLocaleUtils.getPredefinedKeyboardLayoutSet()) {
|
for (final String layout : predefinedKeyboardLayoutSet) {
|
||||||
// This is a dummy subtype with NO_LANGUAGE, only for display.
|
// This is a dummy subtype with NO_LANGUAGE, only for display.
|
||||||
final InputMethodSubtype subtype =
|
final InputMethodSubtype subtype =
|
||||||
AdditionalSubtypeUtils.createDummyAdditionalSubtype(
|
AdditionalSubtypeUtils.createDummyAdditionalSubtype(
|
||||||
|
|
|
@ -56,7 +56,6 @@ public final class SubtypeLocaleUtils {
|
||||||
private static volatile boolean sInitialized = false;
|
private static volatile boolean sInitialized = false;
|
||||||
private static final Object sInitializeLock = new Object();
|
private static final Object sInitializeLock = new Object();
|
||||||
private static Resources sResources;
|
private static Resources sResources;
|
||||||
private static String[] sPredefinedKeyboardLayoutSet;
|
|
||||||
// Keyboard layout to its display name map.
|
// Keyboard layout to its display name map.
|
||||||
private static final HashMap<String, String> sKeyboardLayoutToDisplayNameMap = new HashMap<>();
|
private static final HashMap<String, String> sKeyboardLayoutToDisplayNameMap = new HashMap<>();
|
||||||
// Keyboard layout to subtype name resource id map.
|
// Keyboard layout to subtype name resource id map.
|
||||||
|
@ -103,7 +102,6 @@ public final class SubtypeLocaleUtils {
|
||||||
sResources = res;
|
sResources = res;
|
||||||
|
|
||||||
final String[] predefinedLayoutSet = res.getStringArray(R.array.predefined_layouts);
|
final String[] predefinedLayoutSet = res.getStringArray(R.array.predefined_layouts);
|
||||||
sPredefinedKeyboardLayoutSet = predefinedLayoutSet;
|
|
||||||
final String[] layoutDisplayNames = res.getStringArray(
|
final String[] layoutDisplayNames = res.getStringArray(
|
||||||
R.array.predefined_layout_display_names);
|
R.array.predefined_layout_display_names);
|
||||||
for (int i = 0; i < predefinedLayoutSet.length; i++) {
|
for (int i = 0; i < predefinedLayoutSet.length; i++) {
|
||||||
|
@ -152,10 +150,6 @@ public final class SubtypeLocaleUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] getPredefinedKeyboardLayoutSet() {
|
|
||||||
return sPredefinedKeyboardLayoutSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isExceptionalLocale(final String localeString) {
|
public static boolean isExceptionalLocale(final String localeString) {
|
||||||
return sExceptionalLocaleToNameIdsMap.containsKey(localeString);
|
return sExceptionalLocaleToNameIdsMap.containsKey(localeString);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue