Tabnine Logo
InputMethodSubtype.getMode
Code IndexAdd Tabnine to your IDE (free)

How to use
getMode
method
in
android.view.inputmethod.InputMethodSubtype

Best Java code snippets using android.view.inputmethod.InputMethodSubtype.getMode (Showing top 10 results out of 315)

origin: stackoverflow.com

 private void printInputLanguages() {
  InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
  List<InputMethodInfo> ims = imm.getEnabledInputMethodList();

  for (InputMethodInfo method : ims) {
    List<InputMethodSubtype> submethods = imm.getEnabledInputMethodSubtypeList(method, true);
    for (InputMethodSubtype submethod : submethods) {
     if (submethod.getMode().equals("keyboard")) {
       String currentLocale = submethod.getLocale();
       Log.i(TAG, "Available input method locale: " + currentLocale);
     }
    }
  }
}
origin: stackoverflow.com

private void printInputLanguages() {
 InputMethodManager imm = (InputMethodManager)   
 getSystemService(Context.INPUT_METHOD_SERVICE);
 List<InputMethodInfo> ims = imm.getEnabledInputMethodList();
 for (InputMethodInfo method : ims){
   List<InputMethodSubtype> submethods = 
   imm.getEnabledInputMethodSubtypeList(method, true);
   for (InputMethodSubtype submethod : submethods){
    if (submethod.getMode().equals("keyboard")){
      String currentLocale = submethod.getLocale();
      Log.i(TAG, "Available input method locale: " + currentLocale);
    }
   }
 }
}
origin: stackoverflow.com

 private ArrayList<String> getInputLanguages() {
    ArrayList<String> inputlanguages=new ArrayList<String>();
    InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    List<InputMethodInfo> ims = imm.getEnabledInputMethodList();

    for (InputMethodInfo method : ims){
      List<InputMethodSubtype> submethods = imm.getEnabledInputMethodSubtypeList(method, true);
      for (InputMethodSubtype submethod : submethods){
       if (submethod.getMode().equals("keyboard")){
         String currentLocale = submethod.getLocale();
         Locale locale = new Locale(localeString);
         String currentLanguage = locale.getDisplayLanguage();   
         inputlanguages.Add(currentLanguage );        

        }
      }
   }
 return inputlangauges;
}
origin: rkkr/simple-keyboard

  @Override
  protected String job(final Resources res) {
    try {
      return res.getString(nameResId, replacementString);
    } catch (Resources.NotFoundException e) {
      // TODO: Remove this catch when InputMethodManager.getCurrentInputMethodSubtype
      // is fixed.
      Log.w(TAG, "Unknown subtype: mode=" + subtype.getMode()
          + " nameResId=" + subtype.getNameResId()
          + " locale=" + subtype.getLocale()
          + " extra=" + subtype.getExtraValue()
          + "\n" + DebugLogUtils.getStackTrace());
      return "";
    }
  }
};
origin: crvv/android_wubi_input

    ? "<null>" : mShortcutInputMethodInfo.getId()) + ", "
+ (mShortcutSubtype == null ? "<null>" : (
    mShortcutSubtype.getLocale() + ", " + mShortcutSubtype.getMode())));
    ? "<null>" : mShortcutInputMethodInfo.getId()) + ", "
+ (mShortcutSubtype == null ? "<null>" : (
    mShortcutSubtype.getLocale() + ", " + mShortcutSubtype.getMode())));
origin: crvv/android_wubi_input

  @Override
  protected String job(final Resources res) {
    try {
      return res.getString(nameResId, replacementString);
    } catch (Resources.NotFoundException e) {
      // TODO: Remove this catch when InputMethodManager.getCurrentInputMethodSubtype
      // is fixed.
      Log.w(TAG, "Unknown subtype: mode=" + subtype.getMode()
          + " nameResId=" + subtype.getNameResId()
          + " locale=" + subtype.getLocale()
          + " extra=" + subtype.getExtraValue()
          + "\n" + DebugLogUtils.getStackTrace());
      return "";
    }
  }
};
origin: derry/delion

private void recordKeyboardLocaleUma() {
  InputMethodManager imm =
      (InputMethodManager) mAppContext.getSystemService(Context.INPUT_METHOD_SERVICE);
  List<InputMethodInfo> ims = imm.getEnabledInputMethodList();
  ArrayList<String> uniqueLanguages = new ArrayList<String>();
  for (InputMethodInfo method : ims) {
    List<InputMethodSubtype> submethods =
        imm.getEnabledInputMethodSubtypeList(method, true);
    for (InputMethodSubtype submethod : submethods) {
      if (submethod.getMode().equals("keyboard")) {
        String language = submethod.getLocale().split("_")[0];
        if (!uniqueLanguages.contains(language)) {
          uniqueLanguages.add(language);
        }
      }
    }
  }
  RecordHistogram.recordCountHistogram("InputMethod.ActiveCount", uniqueLanguages.size());
  InputMethodSubtype currentSubtype = imm.getCurrentInputMethodSubtype();
  Locale systemLocale = Locale.getDefault();
  if (currentSubtype != null && currentSubtype.getLocale() != null && systemLocale != null) {
    String keyboardLanguage = currentSubtype.getLocale().split("_")[0];
    boolean match = systemLocale.getLanguage().equalsIgnoreCase(keyboardLanguage);
    RecordHistogram.recordBooleanHistogram("InputMethod.MatchesSystemLanguage", match);
  }
}
origin: crvv/android_wubi_input

if (KEYBOARD_MODE.equals(subtype.getMode())) {
  ++keyboardCount;
origin: rkkr/simple-keyboard

if (KEYBOARD_MODE.equals(subtype.getMode())) {
  ++keyboardCount;
origin: rkkr/simple-keyboard

    ? "<null>" : mShortcutInputMethodInfo.getId()) + ", "
+ (mShortcutSubtype == null ? "<null>" : (
    mShortcutSubtype.getLocale() + ", " + mShortcutSubtype.getMode())));
    ? "<null>" : mShortcutInputMethodInfo.getId()) + ", "
+ (mShortcutSubtype == null ? "<null>" : (
    mShortcutSubtype.getLocale() + ", " + mShortcutSubtype.getMode())));
android.view.inputmethodInputMethodSubtypegetMode

Popular methods of InputMethodSubtype

  • getLocale
  • getDisplayName
  • containsExtraValueKey
  • equals
  • getExtraValue
  • getExtraValueOf
  • getNameResId
  • hashCode
  • isAuxiliary
  • <init>
  • getLanguageTag
  • isAsciiCapable
  • getLanguageTag,
  • isAsciiCapable

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
  • findViewById (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JLabel (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now