scroll to bottom after sending multi-line message

This commit is contained in:
Daniel Gultsch 2016-05-12 10:39:04 +02:00
parent cc209afc51
commit 1bc92482e9
1 changed files with 8 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentSender.SendIntentException; import android.content.IntentSender.SendIntentException;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.text.InputType; import android.text.InputType;
import android.view.ContextMenu; import android.view.ContextMenu;
@ -956,10 +957,15 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
} }
private void messageSent() { private void messageSent() {
int size = this.messageList.size();
messagesView.setSelection(size - 1);
mEditMessage.setText(""); mEditMessage.setText("");
updateChatMsgHint(); updateChatMsgHint();
new Handler().post(new Runnable() {
@Override
public void run() {
int size = messageList.size();
messagesView.setSelection(size - 1);
}
});
} }
public void setFocusOnInputField() { public void setFocusOnInputField() {