|
@ -572,6 +572,7 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { |
|
|
} |
|
|
} |
|
|
} else if (currentHolder instanceof QuickReplyViewHolder) { |
|
|
} else if (currentHolder instanceof QuickReplyViewHolder) { |
|
|
final QuickReplyViewHolder holder = (QuickReplyViewHolder) currentHolder; |
|
|
final QuickReplyViewHolder holder = (QuickReplyViewHolder) currentHolder; |
|
|
|
|
|
Post reply = (Post) topicItems.get(position); |
|
|
|
|
|
|
|
|
//noinspection ConstantConditions
|
|
|
//noinspection ConstantConditions
|
|
|
Picasso.with(context) |
|
|
Picasso.with(context) |
|
@ -585,7 +586,11 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { |
|
|
.transform(new CircleTransform()) |
|
|
.transform(new CircleTransform()) |
|
|
.into(holder.thumbnail); |
|
|
.into(holder.thumbnail); |
|
|
holder.username.setText(getSessionManager().getUsername()); |
|
|
holder.username.setText(getSessionManager().getUsername()); |
|
|
holder.quickReplySubject.setText("Re: " + viewModel.getTopicTitle().getValue()); |
|
|
if (reply.getSubject() != null) { |
|
|
|
|
|
holder.quickReplySubject.setText(reply.getSubject()); |
|
|
|
|
|
} else { |
|
|
|
|
|
holder.quickReplySubject.setText("Re: " + viewModel.getTopicTitle().getValue()); |
|
|
|
|
|
} |
|
|
holder.quickReplySubject.setRawInputType(InputType.TYPE_CLASS_TEXT); |
|
|
holder.quickReplySubject.setRawInputType(InputType.TYPE_CLASS_TEXT); |
|
|
holder.quickReplySubject.setImeOptions(EditorInfo.IME_ACTION_DONE); |
|
|
holder.quickReplySubject.setImeOptions(EditorInfo.IME_ACTION_DONE); |
|
|
|
|
|
|
|
@ -593,7 +598,6 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { |
|
|
holder.replyEditor.requestEditTextFocus(); |
|
|
holder.replyEditor.requestEditTextFocus(); |
|
|
emojiKeyboard.registerEmojiInputField(holder.replyEditor); |
|
|
emojiKeyboard.registerEmojiInputField(holder.replyEditor); |
|
|
|
|
|
|
|
|
holder.replyEditor.setText(viewModel.getBuildedQuotes()); |
|
|
|
|
|
holder.replyEditor.setOnSubmitListener(view -> { |
|
|
holder.replyEditor.setOnSubmitListener(view -> { |
|
|
if (holder.quickReplySubject.getText().toString().isEmpty()) return; |
|
|
if (holder.quickReplySubject.getText().toString().isEmpty()) return; |
|
|
if (holder.replyEditor.getText().toString().isEmpty()) { |
|
|
if (holder.replyEditor.getText().toString().isEmpty()) { |
|
@ -611,6 +615,12 @@ class TopicAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { |
|
|
}); |
|
|
}); |
|
|
holder.replyEditor.setOnClickListener(view -> holder.replyEditor.setError(null)); |
|
|
holder.replyEditor.setOnClickListener(view -> holder.replyEditor.setError(null)); |
|
|
|
|
|
|
|
|
|
|
|
if (reply.getContent() != null) { |
|
|
|
|
|
holder.replyEditor.setText(reply.getContent()); |
|
|
|
|
|
} else { |
|
|
|
|
|
holder.replyEditor.setText(viewModel.getBuildedQuotes()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (backPressHidden) { |
|
|
if (backPressHidden) { |
|
|
holder.replyEditor.requestFocus(); |
|
|
holder.replyEditor.requestFocus(); |
|
|
backPressHidden = false; |
|
|
backPressHidden = false; |
|
|