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

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

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

origin: stackoverflow.com

 InputMethodSubtype subtype = mInputMethodManager.getCurrentInputMethodSubtype();
switch(subtype.getLocale()) {
  case "fa_IR":
    setLatinKeyboard(mPersianKeyboard);
    break;
  case "en_US":
    setLatinKeyboard(mQwertyKeyboard);
    break;
}
origin: stackoverflow.com

 @Override
public void onCurrentInputMethodSubtypeChanged(InputMethodSubtype subtype) {
  mInputView.setSubtypeOnSpaceKey(subtype);
  switch(subtype.getLocale()) {
    case "fa_IR":
      setLatinKeyboard(mSymbolsKeyboard);
      break;
    case "en_US":
      setLatinKeyboard(mQwertyKeyboard);
      break;
  };
}
origin: crvv/android_wubi_input

public static boolean isNoLanguage(final InputMethodSubtype subtype) {
  final String localeString = subtype.getLocale();
  return NO_LANGUAGE.equals(localeString);
}
origin: stackoverflow.com

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
 InputMethodSubtype ims = imm.getCurrentInputMethodSubtype();
 String localeString = ims.getLocale();
 Locale locale = new Locale(localeString);
 String currentLanguage = locale.getDisplayLanguage();
origin: stackoverflow.com

InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
 InputMethodSubtype ims = imm.getCurrentInputMethodSubtype();
 String localeString = ims.getLocale();
 Locale locale = new Locale(localeString);
 String currentLanguage = locale.getDisplayLanguage();
origin: stackoverflow.com

 InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
InputMethodSubtype ims = imm.getCurrentInputMethodSubtype();
String localeString = ims.getLocale();
Locale locale = new Locale(localeString);
String currentLanguage = locale.getDisplayLanguage();

if(Keyboard input method.equals(currentLanguage)
  {
   //do something
  }
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: rkkr/simple-keyboard

public SubtypeLocaleItem(final InputMethodSubtype subtype) {
  mLocaleString = subtype.getLocale();
  mDisplayName = SubtypeLocaleUtils.getSubtypeLocaleDisplayNameInSystemLocale(
      mLocaleString);
}
origin: rkkr/simple-keyboard

@NonNull
public static Locale getSubtypeLocale(@NonNull final InputMethodSubtype subtype) {
  final String localeString = subtype.getLocale();
  return LocaleUtils.constructLocaleFromString(localeString);
}
origin: crvv/android_wubi_input

public static Locale getSubtypeLocale(final InputMethodSubtype subtype) {
  final String localeString = subtype.getLocale();
  return LocaleUtils.constructLocaleFromString(localeString);
}
origin: rkkr/simple-keyboard

  public static Locale getLocaleObject(final InputMethodSubtype subtype) {
    // Locale.forLanguageTag() is available only in Android L and later.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
      final String languageTag = subtype.getLanguageTag();
      if (!TextUtils.isEmpty(languageTag)) {
        return Locale.forLanguageTag(languageTag);
      }
    }
    return LocaleUtils.constructLocaleFromString(subtype.getLocale());
  }
}
origin: rkkr/simple-keyboard

@NonNull
private static String getReplacementString(@NonNull final InputMethodSubtype subtype,
    @NonNull final Locale displayLocale) {
  if (subtype.containsExtraValueKey(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME)) {
    return subtype.getExtraValueOf(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME);
  }
  return getSubtypeLocaleDisplayNameInternal(subtype.getLocale(), displayLocale);
}
origin: rkkr/simple-keyboard

private InputMethodSubtype findDuplicatedSubtype(final InputMethodSubtype subtype) {
  final String localeString = subtype.getLocale();
  final String keyboardLayoutSetName = SubtypeLocaleUtils.getKeyboardLayoutSetName(subtype);
  return mRichImm.findSubtypeByLocaleAndKeyboardLayoutSet(
      localeString, keyboardLayoutSetName);
}
origin: rkkr/simple-keyboard

@NonNull
public String getFullDisplayName() {
  if (isNoLanguage()) {
    return SubtypeLocaleUtils.getKeyboardLayoutSetDisplayName(mSubtype);
  }
  return SubtypeLocaleUtils.getSubtypeLocaleDisplayName(mSubtype.getLocale());
}
origin: rkkr/simple-keyboard

@NonNull
public String getMiddleDisplayName() {
  if (isNoLanguage()) {
    return SubtypeLocaleUtils.getKeyboardLayoutSetDisplayName(mSubtype);
  }
  return SubtypeLocaleUtils.getSubtypeLanguageDisplayName(mSubtype.getLocale());
}
origin: rkkr/simple-keyboard

public static String getPrefSubtype(final InputMethodSubtype subtype) {
  final String localeString = subtype.getLocale();
  final String keyboardLayoutSetName = SubtypeLocaleUtils.getKeyboardLayoutSetName(subtype);
  final String layoutExtraValue = KEYBOARD_LAYOUT_SET + "=" + keyboardLayoutSetName;
  final String extraValue = StringUtils.removeFromCommaSplittableTextIfExists(
      layoutExtraValue, StringUtils.removeFromCommaSplittableTextIfExists(
          IS_ADDITIONAL_SUBTYPE, subtype.getExtraValue()));
  final String basePrefSubtype = localeString + LOCALE_AND_LAYOUT_SEPARATOR
      + keyboardLayoutSetName;
  return extraValue.isEmpty() ? basePrefSubtype
      : basePrefSubtype + LOCALE_AND_LAYOUT_SEPARATOR + extraValue;
}
origin: crvv/android_wubi_input

  public static String getMiddleDisplayName(final InputMethodSubtype subtype) {
    if (SubtypeLocaleUtils.isNoLanguage(subtype)) {
      return SubtypeLocaleUtils.getKeyboardLayoutSetDisplayName(subtype);
    }
    return SubtypeLocaleUtils.getSubtypeLanguageDisplayName(subtype.getLocale());
  }
}
origin: crvv/android_wubi_input

private static String getReplacementString(final InputMethodSubtype subtype,
    final Locale displayLocale) {
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN
      && subtype.containsExtraValueKey(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME)) {
    return subtype.getExtraValueOf(UNTRANSLATABLE_STRING_IN_SUBTYPE_NAME);
  } else {
    return getSubtypeLocaleDisplayNameInternal(subtype.getLocale(), displayLocale);
  }
}
origin: crvv/android_wubi_input

public Locale getCurrentSubtypeLocale() {
  if (null != sForcedSubtypeForTesting) {
    return LocaleUtils.constructLocaleFromString(sForcedSubtypeForTesting.getLocale());
  }
  return SubtypeLocaleUtils.getSubtypeLocale(getCurrentSubtype());
}
origin: crvv/android_wubi_input

public static String getFullDisplayName(final InputMethodSubtype subtype) {
  if (SubtypeLocaleUtils.isNoLanguage(subtype)) {
    return SubtypeLocaleUtils.getKeyboardLayoutSetDisplayName(subtype);
  }
  return SubtypeLocaleUtils.getSubtypeLocaleDisplayName(subtype.getLocale());
}
android.view.inputmethodInputMethodSubtypegetLocale

Popular methods of InputMethodSubtype

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

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Join (org.hibernate.mapping)
  • CodeWhisperer 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