Ejemplo n.º 1
0
  @Override
  public View onCreateInputView() {
    ViewGroup vg = (ViewGroup) viewInput.getParent();
    if (vg != null) {
      vg.removeView(viewInput);
    }

    return viewInput;
  }
Ejemplo n.º 2
0
  @Override
  public void onStartInput(EditorInfo info, boolean restarting) {
    super.onStartInput(info, restarting);

    loadConfiguration();

    if (!restarting) viewInput.onNewInputTarget(info);

    connManager.setConnection(getCurrentInputConnection());

    updateInputViewShown();
  }
Ejemplo n.º 3
0
  /** Load configuration which is managed by {@link VnImeSettings} */
  protected void loadConfiguration() {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);

    connManager.setModifiers(
        sp.getString(getString(R.string.vnime_settings_key_typingmethod), null));
    connManager.setMacroEnabled(
        sp.getBoolean(getString(R.string.vnime_settings_key_macro_enable), true));
    connManager.setRevertEnabled(
        sp.getBoolean(getString(R.string.vnime_settings_key_spellcheck_revert), true));

    showInputView =
        sp.getBoolean(getString(R.string.vnime_settings_key_showsoftkeyboard), showInputView);
    showInputViewAlways =
        sp.getBoolean(
            getString(R.string.vnime_settings_key_showsoftkeyboard_always), showInputViewAlways);
    showCandidateView =
        sp.getBoolean(getString(R.string.vnime_settings_key_showsuggestion), showCandidateView);
    viewCandidate.setMacroEnabled(
        sp.getBoolean(getString(R.string.vnime_settings_key_macro_enable), true));

    viewInput.setAutoCapSentences(
        sp.getBoolean(getString(R.string.vnime_settings_key_autocapsentences), true));
    viewInput.setAlwaysShowNumKeys(
        sp.getBoolean(getString(R.string.vnime_settings_key_alwaysshownumber), false));
    int feedbackType = 0;
    if (sp.getBoolean(getString(R.string.vnime_settings_key_feedback_visual), true)) {
      feedbackType |= InputView.FEEDBACK_TYPE_VISUAL;
    }
    if (sp.getBoolean(getString(R.string.vnime_settings_key_feedback_sound), false)) {
      feedbackType |= InputView.FEEDBACK_TYPE_SOUND;
    }
    if (sp.getBoolean(getString(R.string.vnime_settings_key_feedback_vibration), false)) {
      feedbackType |= InputView.FEEDBACK_TYPE_VIBRATION;
    }
    viewInput.setFeedbackType(feedbackType);
  }