From eade96f75c7e3f74141485ae931541a87cf34546 Mon Sep 17 00:00:00 2001 From: oogee Date: Mon, 19 Nov 2018 20:23:33 +0200 Subject: [PATCH] include quotes when caching replies --- .../thmmy/mthmmy/activities/topic/TopicAdapter.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java index ef972d01..0181c49a 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java @@ -644,15 +644,19 @@ class TopicAdapter extends RecyclerView.Adapter { }); holder.replyEditor.setOnClickListener(view -> holder.replyEditor.setError(null)); + String replyText = ""; + if (reply.getContent() != null) - holder.replyEditor.setText(reply.getContent()); - else if (viewModel.getBuildedQuotes() != null && !viewModel.getBuildedQuotes().isEmpty()) - holder.replyEditor.setText(viewModel.getBuildedQuotes()); + replyText += reply.getContent(); else { + if (viewModel.getBuildedQuotes() != null && !viewModel.getBuildedQuotes().isEmpty()) + replyText += viewModel.getBuildedQuotes(); SharedPreferences drafts = context.getSharedPreferences(context.getString(R.string.pref_topic_drafts_key), Context.MODE_PRIVATE); - holder.replyEditor.setText(drafts.getString(String.valueOf(viewModel.getTopicId()), "")); + replyText += drafts.getString(String.valueOf(viewModel.getTopicId()), ""); + } + holder.replyEditor.setText(replyText); holder.replyEditor.getEditText().setSelection(holder.replyEditor.getText().length()); if (backPressHidden) {