コード例 #1
0
  public void restoreInputState() {
    skipOnTextChanges = true;

    inputView.setText(ChatManager.getInstance().getTypedMessage(account, user));
    inputView.setSelection(
        ChatManager.getInstance().getSelectionStart(account, user),
        ChatManager.getInstance().getSelectionEnd(account, user));

    skipOnTextChanges = false;

    if (!inputView.getText().toString().isEmpty()) {
      inputView.requestFocus();
    }
  }
コード例 #2
0
 public void saveInputState() {
   ChatManager.getInstance()
       .setTyped(
           account,
           user,
           inputView.getText().toString(),
           inputView.getSelectionStart(),
           inputView.getSelectionEnd());
 }