simplify logic

This commit is contained in:
Ammar Githam 2020-08-16 06:04:50 +09:00
parent 86b9feda4a
commit 1a57969abe
1 changed files with 5 additions and 3 deletions

View File

@ -86,9 +86,11 @@ public final class DirectMessageThread extends BaseLanguageActivity {
}
};
private final View.OnClickListener newCommentListener = v -> {
if (Utils.isEmpty(dmsBinding.commentText.getText().toString()) && v == dmsBinding.commentSend)
Toast.makeText(getApplicationContext(), R.string.comment_send_empty_comment, Toast.LENGTH_SHORT).show();
else if (v == dmsBinding.commentSend) {
if (v == dmsBinding.commentSend) {
if (Utils.isEmpty(dmsBinding.commentText.getText().toString())) {
Toast.makeText(getApplicationContext(), R.string.comment_send_empty_comment, Toast.LENGTH_SHORT).show();
return;
}
final CommentAction action = new CommentAction(dmsBinding.commentText.getText().toString(), threadid);
action.setOnTaskCompleteListener(result -> {
if (!result) {