From d12e2bd3a8b2ce8d2e15b07f4392705d7f62ec1d Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 1 Feb 2019 09:29:26 +0000 Subject: [PATCH] Fixed wrong message showing --- .../eu/faircode/email/AdapterMessage.java | 61 ++++++++----------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 4b85c5ef87..96facb2cc9 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -152,7 +152,6 @@ public class AdapterMessage extends RecyclerView.Adapter() { @Override protected void onPreExecute(Bundle args) { - args.putInt("position", position); ivAvatar.setVisibility(avatars ? View.INVISIBLE : View.GONE); tvFrom.setText(MessageHelper.formatAddresses(addresses, !compact, false)); } @@ -512,8 +508,12 @@ public class AdapterMessage extends RecyclerView.Adapter>() { - @Override - protected void onPreExecute(Bundle args) { - args.putInt("position", position); - bnvActions.setHasTransientState(true); - } - - @Override - protected void onPostExecute(Bundle args) { - bnvActions.setHasTransientState(false); - } - @Override protected List onExecute(Context context, Bundle args) { long account = args.getLong("account"); @@ -794,7 +784,9 @@ public class AdapterMessage extends RecyclerView.Adapter folders) { - if (args.getInt("position") != position) + long id = args.getLong("id"); + TupleMessageEx amessage = getMessage(); + if (amessage == null || !amessage.id.equals(id)) return; boolean hasJunk = false; @@ -878,13 +870,17 @@ public class AdapterMessage extends RecyclerView.Adapter bodyTask = new SimpleTask() { private String body = null; - @Override - protected void onPreExecute(Bundle args) { - args.putInt("position", position); - } - @Override protected SpannableStringBuilder onExecute(Context context, final Bundle args) { DB db = DB.getInstance(context); @@ -1278,7 +1270,8 @@ public class AdapterMessage extends RecyclerView.Adapter