Merge "Add dummy Emoji subtype"
commit
c0f81463cb
|
@ -457,6 +457,8 @@ language among those that use the Latin alphabet. This keyboard is laid out in t
|
||||||
disposition that offers additional keys, but smaller keys compared to other common dispositions for
|
disposition that offers additional keys, but smaller keys compared to other common dispositions for
|
||||||
mobile devices. [CHAR LIMIT=25] -->
|
mobile devices. [CHAR LIMIT=25] -->
|
||||||
<string name="subtype_no_language_pcqwerty">Alphabet (PC)</string>
|
<string name="subtype_no_language_pcqwerty">Alphabet (PC)</string>
|
||||||
|
<!-- Description for Emoji keyboard subtype [CHAR LIMIT=25] -->
|
||||||
|
<string name="subtype_emoji">Emoji</string>
|
||||||
|
|
||||||
<!-- Title of the preference settings for custom input styles (language and keyboard layout pairs) [CHAR LIMIT=35]-->
|
<!-- Title of the preference settings for custom input styles (language and keyboard layout pairs) [CHAR LIMIT=35]-->
|
||||||
<string name="custom_input_styles_title">Custom input styles</string>
|
<string name="custom_input_styles_title">Custom input styles</string>
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
vi: Vietnamese/qwerty
|
vi: Vietnamese/qwerty
|
||||||
zu: Zulu/qwerty
|
zu: Zulu/qwerty
|
||||||
zz: QWERTY/qwerty
|
zz: QWERTY/qwerty
|
||||||
|
(zz: Emoji/emoji)
|
||||||
-->
|
-->
|
||||||
<!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. -->
|
<!-- TODO: use <lang>_keyboard icon instead of a common keyboard icon. -->
|
||||||
<!-- Note: SupportTouchPositionCorrection extra value is obsolete and maintained for backward
|
<!-- Note: SupportTouchPositionCorrection extra value is obsolete and maintained for backward
|
||||||
|
@ -510,4 +511,15 @@
|
||||||
android:imeSubtypeMode="keyboard"
|
android:imeSubtypeMode="keyboard"
|
||||||
android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable,EnabledWhenDefaultIsNotAsciiCapable"
|
android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable,EnabledWhenDefaultIsNotAsciiCapable"
|
||||||
/>
|
/>
|
||||||
|
<!-- Emoji subtype has to be an addtional subtype added at boot time because ICS doesn't
|
||||||
|
support Emoji. -->
|
||||||
|
<!--
|
||||||
|
<subtype android:icon="@drawable/ic_subtype_keyboard"
|
||||||
|
android:label="@string/subtype_emoji"
|
||||||
|
android:subtypeId="0xc14d88b2"
|
||||||
|
android:imeSubtypeLocale="zz"
|
||||||
|
android:imeSubtypeMode="keyboard"
|
||||||
|
android:imeSubtypeExtraValue="KeyboardLayoutSet=emoji"
|
||||||
|
/>
|
||||||
|
-->
|
||||||
</input-method>
|
</input-method>
|
||||||
|
|
|
@ -53,12 +53,22 @@ public final class SubtypeSwitcher {
|
||||||
private InputMethodInfo mShortcutInputMethodInfo;
|
private InputMethodInfo mShortcutInputMethodInfo;
|
||||||
private InputMethodSubtype mShortcutSubtype;
|
private InputMethodSubtype mShortcutSubtype;
|
||||||
private InputMethodSubtype mNoLanguageSubtype;
|
private InputMethodSubtype mNoLanguageSubtype;
|
||||||
|
private InputMethodSubtype mEmojiSubtype;
|
||||||
private boolean mIsNetworkConnected;
|
private boolean mIsNetworkConnected;
|
||||||
|
|
||||||
// Dummy no language QWERTY subtype. See {@link R.xml.method}.
|
// Dummy no language QWERTY subtype. See {@link R.xml.method}.
|
||||||
private static final InputMethodSubtype DUMMY_NO_LANGUAGE_SUBTYPE = new InputMethodSubtype(
|
private static final InputMethodSubtype DUMMY_NO_LANGUAGE_SUBTYPE = new InputMethodSubtype(
|
||||||
R.string.subtype_no_language_qwerty, R.drawable.ic_subtype_keyboard, "zz", "keyboard",
|
R.string.subtype_no_language_qwerty, R.drawable.ic_subtype_keyboard,
|
||||||
"KeyboardLayoutSet=qwerty,AsciiCapable,EnabledWhenDefaultIsNotAsciiCapable",
|
SubtypeLocaleUtils.NO_LANGUAGE, "keyboard",
|
||||||
|
"KeyboardLayoutSet=" + SubtypeLocaleUtils.QWERTY
|
||||||
|
+ ",AsciiCapable,EnabledWhenDefaultIsNotAsciiCapable",
|
||||||
|
false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */);
|
||||||
|
// Caveat: We probably should remove this when we add an Emoji subtype in {@link R.xml.method}.
|
||||||
|
// Dummy Emoji subtype. See {@link R.xml.method}.
|
||||||
|
private static final InputMethodSubtype DUMMY_EMOJI_SUBTYPE = new InputMethodSubtype(
|
||||||
|
R.string.subtype_emoji, R.drawable.ic_subtype_keyboard,
|
||||||
|
SubtypeLocaleUtils.NO_LANGUAGE, "keyboard",
|
||||||
|
"KeyboardLayoutSet=" + SubtypeLocaleUtils.EMOJI,
|
||||||
false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */);
|
false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */);
|
||||||
|
|
||||||
static final class NeedsToDisplayLanguage {
|
static final class NeedsToDisplayLanguage {
|
||||||
|
@ -271,4 +281,17 @@ public final class SubtypeSwitcher {
|
||||||
+ DUMMY_NO_LANGUAGE_SUBTYPE);
|
+ DUMMY_NO_LANGUAGE_SUBTYPE);
|
||||||
return DUMMY_NO_LANGUAGE_SUBTYPE;
|
return DUMMY_NO_LANGUAGE_SUBTYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InputMethodSubtype getEmojiSubtype() {
|
||||||
|
if (mEmojiSubtype == null) {
|
||||||
|
mEmojiSubtype = mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
|
||||||
|
SubtypeLocaleUtils.NO_LANGUAGE, SubtypeLocaleUtils.EMOJI);
|
||||||
|
}
|
||||||
|
if (mEmojiSubtype != null) {
|
||||||
|
return mEmojiSubtype;
|
||||||
|
}
|
||||||
|
Log.w(TAG, "Can't find Emoji subtype");
|
||||||
|
Log.w(TAG, "No input method subtype found; return dummy subtype: " + DUMMY_EMOJI_SUBTYPE);
|
||||||
|
return DUMMY_EMOJI_SUBTYPE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ public final class SubtypeLocaleUtils {
|
||||||
// Special language code to represent "no language".
|
// Special language code to represent "no language".
|
||||||
public static final String NO_LANGUAGE = "zz";
|
public static final String NO_LANGUAGE = "zz";
|
||||||
public static final String QWERTY = "qwerty";
|
public static final String QWERTY = "qwerty";
|
||||||
|
public static final String EMOJI = "emoji";
|
||||||
public static final int UNKNOWN_KEYBOARD_LAYOUT = R.string.subtype_generic;
|
public static final int UNKNOWN_KEYBOARD_LAYOUT = R.string.subtype_generic;
|
||||||
|
|
||||||
private static boolean sInitialized = false;
|
private static boolean sInitialized = false;
|
||||||
|
|
Loading…
Reference in New Issue