From 21515ca91daa7dc2474f343f6aa48b814f69e425 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 6 Feb 2024 07:21:49 +0100 Subject: [PATCH] Simplification --- app/src/main/java/eu/faircode/email/ActivityView.java | 6 +----- app/src/main/java/eu/faircode/email/WidgetUnified.java | 10 +++++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 8c847db069..57f99334c1 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -741,11 +741,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB Intent intent = getIntent(); boolean search = (intent != null && intent.hasExtra(Intent.EXTRA_PROCESS_TEXT)); boolean standalone = (intent != null && intent.getBooleanExtra("standalone", false)); - boolean unified = (intent != null && - ("unified".equals(intent.getAction()) || - ("folder:-1".equals(intent.getAction()) && - intent.getLongExtra("account", 0) < 0 && - intent.getStringExtra("type") == null))); + boolean unified = (intent != null && "unified".equals(intent.getAction())); if (!search && !(standalone && !unified)) init(); } diff --git a/app/src/main/java/eu/faircode/email/WidgetUnified.java b/app/src/main/java/eu/faircode/email/WidgetUnified.java index b777361278..9da2081a47 100644 --- a/app/src/main/java/eu/faircode/email/WidgetUnified.java +++ b/app/src/main/java/eu/faircode/email/WidgetUnified.java @@ -70,9 +70,13 @@ public class WidgetUnified extends AppWidgetProvider { padding = 2; // Default medium Intent view = new Intent(context, ActivityView.class); - view.setAction("folder:" + folder); - view.putExtra("account", account); - view.putExtra("type", type); + if (account < 0 && folder < 0 && type == null) + view.setAction("unified"); + else { + view.setAction("folder:" + folder); + view.putExtra("account", account); + view.putExtra("type", type); + } view.putExtra("standalone", standalone); view.putExtra("refresh", true); view.putExtra("version", version);