@Override
 public void handleClear() {
   typedText.setLength(0);
   final InputConnection ic = getCurrentInputConnection();
   ic.setSelection(0, 0);
   ic.deleteSurroundingText(MAX_INT, MAX_INT);
 }
  @Override
  public int translateKeyDown(int unicodeChar) {
    if (!Strings.isEmpty(typedText)) {
      char accent = typedText.charAt(typedText.length() - 1);
      int composed = KeyEvent.getDeadChar(accent, unicodeChar);

      if (composed != 0) {
        unicodeChar = composed;
        typedText.setLength(typedText.length() - 1);
      }
    }

    return unicodeChar;
  }