Example usage for android.view.inputmethod InputMethodSubtype getExtraValueOf

List of usage examples for android.view.inputmethod InputMethodSubtype getExtraValueOf

Introduction

In this page you can find the example usage for android.view.inputmethod InputMethodSubtype getExtraValueOf.

Prototype

public String getExtraValueOf(String key) 

Source Link

Document

The string of ExtraValue in subtype should be defined as follows: example: key0,key1=value1,key2,key3,key4=value4

Usage

From source file:com.mobiletin.inputmethod.indic.LatinIME.java

private boolean checkForTransliteration() {
    Locale locale = mSubtypeSwitcher.getCurrentSubtypeLocale();

    if (!locale.getLanguage().equals("en")) {
        mInputLogic.setIndic(true);//from w  ww . j a  va2 s  . c o  m
    } else {
        mInputLogic.setIndic(false);
    }

    InputMethodSubtype currentSubtype = mSubtypeSwitcher.getCurrentSubtype();
    if (currentSubtype.containsExtraValueKey(Constants.Subtype.ExtraValue.TRANSLITERATION_METHOD)) {
        try {
            String transliterationName = currentSubtype
                    .getExtraValueOf(Constants.Subtype.ExtraValue.TRANSLITERATION_METHOD);
            mInputLogic.enableTransliteration(transliterationName, getApplicationContext());
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }
    mInputLogic.disableTransliteration();
    return false;
}