From 93c3169f5a196f4eec7360fa7f3985c95adaab8b Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 12 May 2022 07:56:19 +0200 Subject: [PATCH] Optimization --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index d65bc36f77..cf0ec17c8e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -5862,8 +5862,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. if (selectionTracker != null && selectionTracker.hasSelection()) { fabMore.show(); + long[] selection = getSelection(); + Context context = tvSelectedCount.getContext(); - int count = getSelection().length; + int count = selection.length; tvSelectedCount.setText(NF.format(count)); if (count > (BuildConfig.DEBUG ? 10 : MAX_MORE)) { int ts = Math.round(tvSelectedCount.getTextSize()); @@ -5877,7 +5879,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. tvSelectedCount.setVisibility(View.VISIBLE); Bundle args = new Bundle(); - args.putLongArray("ids", getSelection()); + args.putLongArray("ids", selection); new SimpleTask() { @Override @@ -5960,7 +5962,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. protected void onException(Bundle args, Throwable ex) { Log.unexpectedError(getParentFragmentManager(), ex); } - }.setExecutor(executor).execute(this, args, "fabs"); + }.setExecutor(executor).execute(this, args, "quickactions"); } else { fabMore.hide(); tvSelectedCount.setVisibility(View.GONE);