Merge "Add RichInputMethodSubtype.getKeyboardLayoutSetName"
commit
63e076764b
|
@ -294,7 +294,7 @@ public final class KeyboardLayoutSet {
|
|||
: subtype;
|
||||
mParams.mSubtype = keyboardSubtype;
|
||||
mParams.mKeyboardLayoutSetName = KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX
|
||||
+ SubtypeLocaleUtils.getKeyboardLayoutSetName(keyboardSubtype);
|
||||
+ keyboardSubtype.getKeyboardLayoutSetName();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -648,7 +648,7 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
|
|||
try {
|
||||
final boolean keyboardLayoutSetMatched = matchString(caseAttr,
|
||||
R.styleable.Keyboard_Case_keyboardLayoutSet,
|
||||
SubtypeLocaleUtils.getKeyboardLayoutSetName(id.mSubtype));
|
||||
id.mSubtype.getKeyboardLayoutSetName());
|
||||
final boolean keyboardLayoutSetElementMatched = matchTypedValue(caseAttr,
|
||||
R.styleable.Keyboard_Case_keyboardLayoutSetElement, id.mElementId,
|
||||
KeyboardId.elementIdToName(id.mElementId));
|
||||
|
|
|
@ -52,7 +52,7 @@ public final class LanguageOnSpacebarHelper {
|
|||
return FORMAT_TYPE_MULTIPLE;
|
||||
}
|
||||
final String keyboardLanguage = locales[0].getLanguage();
|
||||
final String keyboardLayout = SubtypeLocaleUtils.getKeyboardLayoutSetName(subtype);
|
||||
final String keyboardLayout = subtype.getKeyboardLayoutSetName();
|
||||
int sameLanguageAndLayoutCount = 0;
|
||||
for (final InputMethodSubtype ims : mEnabledSubtypes) {
|
||||
final String language = SubtypeLocaleUtils.getSubtypeLocale(ims).getLanguage();
|
||||
|
|
|
@ -142,6 +142,11 @@ public final class RichInputMethodSubtype {
|
|||
@Nonnull
|
||||
public InputMethodSubtype getRawSubtype() { return mSubtype; }
|
||||
|
||||
@Nonnull
|
||||
public String getKeyboardLayoutSetName() {
|
||||
return SubtypeLocaleUtils.getKeyboardLayoutSetName(mSubtype);
|
||||
}
|
||||
|
||||
// Dummy no language QWERTY subtype. See {@link R.xml.method}.
|
||||
private static final int SUBTYPE_ID_OF_DUMMY_NO_LANGUAGE_SUBTYPE = 0xdde0bfd3;
|
||||
private static final String EXTRA_VALUE_OF_DUMMY_NO_LANGUAGE_SUBTYPE =
|
||||
|
|
|
@ -328,10 +328,6 @@ public final class SubtypeLocaleUtils {
|
|||
}
|
||||
|
||||
@Nonnull
|
||||
public static String getKeyboardLayoutSetName(@Nonnull final RichInputMethodSubtype subtype) {
|
||||
return getKeyboardLayoutSetName(subtype.getRawSubtype());
|
||||
}
|
||||
|
||||
public static String getKeyboardLayoutSetName(final InputMethodSubtype subtype) {
|
||||
String keyboardLayoutSet = subtype.getExtraValueOf(KEYBOARD_LAYOUT_SET);
|
||||
if (keyboardLayoutSet == null) {
|
||||
|
|
Loading…
Reference in New Issue