Android InputMethodSubtype - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android InputMethodSubtype class.

This code example shows how to use the following methods:getLocale, getMode
        if (DBG) {
            Log.d(TAG, "Update shortcut IME from : "
                    + (mShortcutInputMethodInfo == null
                            ? "<null>" : mShortcutInputMethodInfo.getId()) + ", "
                    + (mShortcutSubtype == null ? "<null>" : (
                            mShortcutSubtype.getLocale() + ", " + mShortcutSubtype.getMode())));
        } 
        // TODO: Update an icon for shortcut IME 
        final Map<InputMethodInfo, List<InputMethodSubtype>> shortcuts =
                mRichImm.getInputMethodManager().getShortcutInputMethodsAndSubtypes();
        mShortcutInputMethodInfo = null;
        mShortcutSubtype = null;
        for (final InputMethodInfo imi : shortcuts.keySet()) {
            final List<InputMethodSubtype> subtypes = shortcuts.get(imi);
            // TODO: Returns the first found IMI for now. Should handle all shortcuts as 
            // appropriate. 
            mShortcutInputMethodInfo = imi;
            // TODO: Pick up the first found subtype for now. Should handle all subtypes 
            // as appropriate. 
            mShortcutSubtype = subtypes.size() > 0 ? subtypes.get(0) : null;
6
CodeRank
This code example shows how to use the following methods:getIconResId
        } 
    } 
 
    void setSubtypeOnSpaceKey(final InputMethodSubtype subtype) {
        final LatinKeyboard keyboard = (LatinKeyboard)getKeyboard();
        keyboard.setSpaceIcon(getResources().getDrawable(subtype.getIconResId()));
        invalidateAllKeys();
    } 
} 
6
CodeRank
This code example shows how to use the following methods:isAuxiliary
        return applicableSubtype;
    } 
 
    public static boolean canAddToLastInputMethod(InputMethodSubtype subtype) {
        if (subtype == null) return true;
        return !subtype.isAuxiliary();
    } 
 
    public static void setNonSelectedSystemImesDisabledUntilUsed( 
            PackageManager packageManager, List<InputMethodInfo> enabledImis) {
        if (DEBUG) {
            Slog.d(TAG, "setNonSelectedSystemImesDisabledUntilUsed");
        } 
        final String[] systemImesDisabledUntilUsed = Resources.getSystem().getStringArray(
                com.android.internal.R.array.config_disabledUntilUsedPreinstalledImes); 
        if (systemImesDisabledUntilUsed == null || systemImesDisabledUntilUsed.length == 0) {
            return; 
        } 
        // Only the current spell checker should be treated as an enabled one. 
        final SpellCheckerInfo currentSpellChecker =
6
CodeRank
This code example shows how to use the following methods:getDisplayName, getNameResId
    } 
 
    private CharSequence getSubtypeName(InputMethodInfo imi, InputMethodSubtype subtype) {
        if (imi == null || subtype == null) return null;
        if (DEBUG) {
            Log.d(TAG, "Get text from: " + imi.getPackageName() + subtype.getNameResId()
                    + imi.getServiceInfo().applicationInfo);
        } 
        return subtype.getDisplayName(
                mContext, imi.getPackageName(), imi.getServiceInfo().applicationInfo);
    } 
 
    private Drawable getSubtypeIcon(InputMethodInfo imi, InputMethodSubtype subtype) {
        if (imi != null) {
            if (DEBUG) {
                Log.d(TAG, "Update icons of IME: " + imi.getPackageName());
                if (subtype != null) {
                    Log.d(TAG, "subtype =" + subtype.getLocale() + "," + subtype.getMode());
                } 
            } 
5
CodeRank
This code example shows how to use the following methods:getLocale
                (passwordInput() ? " passwordInput" : ""), 
                (mShortcutKeyEnabled ? " shortcutKeyEnabled" : ""),
                (mHasShortcutKey ? " hasShortcutKey" : ""),
                (mLanguageSwitchKeyEnabled ? " languageSwitchKeyEnabled" : ""),
                (isMultiLine() ? "isMultiLine" : "") 
        ); 
    } 
 
    public static boolean equivalentEditorInfoForKeyboard(EditorInfo a, EditorInfo b) {
        if (a == null && b == null) return true;
        if (a == null || b == null) return false;
        return a.inputType == b.inputType
                && a.imeOptions == b.imeOptions
                && TextUtils.equals(a.privateImeOptions, b.privateImeOptions);
    } 
 
    public static String elementIdToName(int elementId) {
        switch (elementId) {
        case ELEMENT_ALPHABET: return "alphabet";
        case ELEMENT_ALPHABET_MANUAL_SHIFTED: return "alphabetManualShifted";
5
CodeRank
This code example shows how to use the following methods:getLocale
                ? res.getConfiguration().locale : getSubtypeLocale(subtype);
        return getSubtypeName.runInLocale(res, locale);
    } 
 
    public static boolean isNoLanguage(InputMethodSubtype subtype) {
        final String localeString = subtype.getLocale();
        return localeString.equals(NO_LANGUAGE);
    } 
 
    public static Locale getSubtypeLocale(InputMethodSubtype subtype) {
        final String localeString = subtype.getLocale();
        return LocaleUtils.constructLocaleFromString(localeString);
    } 
 
    public static String getKeyboardLayoutSetDisplayName(InputMethodSubtype subtype) {
        final String layoutName = getKeyboardLayoutSetName(subtype);
        return getKeyboardLayoutSetDisplayName(layoutName);
    } 
 
    public static String getKeyboardLayoutSetDisplayName(String layoutName) {
5
CodeRank
This code example shows how to use the following methods:equals
                && other.isMultiLine() == isMultiLine()
                && other.imeAction() == imeAction()
                && TextUtils.equals(other.mCustomActionLabel, mCustomActionLabel)
                && other.navigateNext() == navigateNext()
                && other.navigatePrevious() == navigatePrevious()
                && other.mSubtype.equals(mSubtype);
    } 
 
    public boolean isAlphabetKeyboard() { 
        return mElementId < ELEMENT_SYMBOLS;
    } 
 
    public boolean navigateNext() { 
        return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0;
    } 
 
    public boolean navigatePrevious() { 
        return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS) != 0;
    } 
 
4
CodeRank
This code example shows how to use the following methods:equals
                && other.isMultiLine() == isMultiLine()
                && other.imeAction() == imeAction()
                && TextUtils.equals(other.mCustomActionLabel, mCustomActionLabel)
                && other.navigateNext() == navigateNext()
                && other.navigatePrevious() == navigatePrevious()
                && other.mSubtype.equals(mSubtype);
    } 
 
    public boolean isAlphabetKeyboard() { 
        return mElementId < ELEMENT_SYMBOLS;
    } 
 
    public boolean navigateNext() { 
        return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0;
    } 
 
    public boolean navigatePrevious() { 
        return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS) != 0;
    } 
 
4
CodeRank
This code example shows how to use the following methods:getIconResId
    } 
 
    @SuppressLint("NewApi") 
	void setSubtypeOnSpaceKey(final InputMethodSubtype subtype) {
    	final LatinKeyboard keyboard = (LatinKeyboard)getKeyboard();
        keyboard.setSpaceIcon(getResources().getDrawable(subtype.getIconResId()));
        invalidateAllKeys();
    } 
     
    static void setNewLanguageKeyboard(LatinKeyboardView inputView, Context context, InputMethodSubtype subtype){
    	final LatinKeyboard keyboard = new LatinKeyboard(context, R.xml.qwerty_tg);
    	inputView.setKeyboard(keyboard);
    } 
} 
4
CodeRank
This code example shows how to use the following methods:equals
                && other.isMultiLine() == isMultiLine()
                && other.imeAction() == imeAction()
                && TextUtils.equals(other.mCustomActionLabel, mCustomActionLabel)
                && other.navigateNext() == navigateNext()
                && other.navigatePrevious() == navigatePrevious()
                && other.mSubtype.equals(mSubtype);
    } 
 
    public boolean isAlphabetKeyboard() { 
        return mElementId < ELEMENT_SYMBOLS;
    } 
 
    public boolean navigateNext() { 
        return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_NEXT) != 0;
    } 
 
    public boolean navigatePrevious() { 
        return (mEditorInfo.imeOptions & EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS) != 0;
    } 
 
3
CodeRank

Related Android InputMethodSubtype Questions & Answers:

See Code Examples for Android InputMethodSubtype Methods: