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

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

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

origin: rkkr/simple-keyboard

public static InputMethodSubtype[] createAdditionalSubtypesArray(final String prefSubtypes) {
  if (TextUtils.isEmpty(prefSubtypes)) {
    return EMPTY_SUBTYPE_ARRAY;
  }
  final String[] prefSubtypeArray = prefSubtypes.split(PREF_SUBTYPE_SEPARATOR);
  final ArrayList<InputMethodSubtype> subtypesList = new ArrayList<>(prefSubtypeArray.length);
  for (final String prefSubtype : prefSubtypeArray) {
    final String elems[] = prefSubtype.split(LOCALE_AND_LAYOUT_SEPARATOR);
    if (elems.length != LENGTH_WITHOUT_EXTRA_VALUE
        && elems.length != LENGTH_WITH_EXTRA_VALUE) {
      Log.w(TAG, "Unknown additional subtype specified: " + prefSubtype + " in "
          + prefSubtypes);
      continue;
    }
    final String localeString = elems[INDEX_OF_LOCALE];
    final String keyboardLayoutSetName = elems[INDEX_OF_KEYBOARD_LAYOUT];
    // Here we assume that all the additional subtypes have AsciiCapable and EmojiCapable.
    // This is actually what the setting dialog for additional subtype is doing.
    final InputMethodSubtype subtype = createAsciiEmojiCapableAdditionalSubtype(
        localeString, keyboardLayoutSetName);
    if (subtype.getNameResId() == SubtypeLocaleUtils.UNKNOWN_KEYBOARD_LAYOUT) {
      // Skip unknown keyboard layout subtype. This may happen when predefined keyboard
      // layout has been removed.
      continue;
    }
    subtypesList.add(subtype);
  }
  return subtypesList.toArray(new InputMethodSubtype[subtypesList.size()]);
}
origin: rkkr/simple-keyboard

@NonNull
private static String getSubtypeDisplayNameInternal(@NonNull final InputMethodSubtype subtype,
    @NonNull final Locale displayLocale) {
  final String replacementString = getReplacementString(subtype, displayLocale);
  // TODO: rework this for multi-lingual subtypes
  final int nameResId = subtype.getNameResId();
  final RunInLocale<String> getSubtypeName = new RunInLocale<String>() {
    @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 "";
      }
    }
  };
  return StringUtils.capitalizeFirstCodePoint(
      getSubtypeName.runInLocale(sResources, displayLocale), displayLocale);
}
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: 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

private static String getSubtypeDisplayNameInternal(final InputMethodSubtype subtype,
    final Locale displayLocale) {
  final String replacementString = getReplacementString(subtype, displayLocale);
  final int nameResId = subtype.getNameResId();
  final RunInLocale<String> getSubtypeName = new RunInLocale<String>() {
    @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 "";
      }
    }
  };
  return StringUtils.capitalizeFirstCodePoint(
      getSubtypeName.runInLocale(sResources, displayLocale), displayLocale);
}
android.view.inputmethodInputMethodSubtypegetNameResId

Popular methods of InputMethodSubtype

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top PhpStorm plugins
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