Example #1
0
  /**
   * This tells us about completions that the editor has determined based on the current text in it.
   * We want to use this in fullscreen mode to show the completions ourself, since the editor can
   * not be seen in that situation.
   */
  @Override
  public void onDisplayCompletions(CompletionInfo[] completions) {
    if (mCompletionOn) {
      mCompletions = completions;
      if (completions == null) {
        setSuggestions(null, false, false);
        return;
      }

      List<String> stringList = new ArrayList<String>();
      for (int i = 0; i < completions.length; i++) {
        CompletionInfo ci = completions[i];
        if (ci != null) stringList.add(ci.getText().toString());
      }
      setSuggestions(stringList, true, true);
    }
  }
 @Override
 public boolean commitCompletion(CompletionInfo text) {
   return commitText(text.getText(), 1);
 }