From 93bdc345f43b22fa2fdd1e45a0e7c36687129c28 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 11 May 2021 10:03:28 +0200 Subject: [PATCH] Conditionally shown sub menu icons --- app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java index 1622ea9eb4..2b75547fec 100644 --- a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java +++ b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java @@ -91,12 +91,15 @@ public class PopupMenuLifecycle extends PopupMenu implements LifecycleObserver { insertIcon(context, item); if (item.hasSubMenu()) { SubMenu sub = item.getSubMenu(); - sub.setHeaderTitle(title); + boolean has = false; for (int j = 0; j < sub.size(); j++) if (sub.getItem(j).getIcon() != null) { + has = true; insertIcons(context, sub); break; } + if (has) + sub.setHeaderTitle(title); } } }