Fixed duplicate submenu icons

pull/194/merge
M66B 3 years ago
parent c82b9e3323
commit b275895762

@ -1618,7 +1618,9 @@ public class FragmentCompose extends FragmentBase {
ssbZoom.append(' '); ssbZoom.append(' ');
for (int i = 0; i <= zoom; i++) for (int i = 0; i <= zoom; i++)
ssbZoom.append('+'); ssbZoom.append('+');
menu.findItem(R.id.menu_zoom).setTitle(ssbZoom); menu.findItem(R.id.menu_zoom)
.setTitle(ssbZoom)
.setIcon(R.drawable.twotone_format_size_24);
PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_zoom)); PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_zoom));
int colorEncrypt = Helper.resolveColor(context, R.attr.colorEncrypt); int colorEncrypt = Helper.resolveColor(context, R.attr.colorEncrypt);

@ -4536,9 +4536,18 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
ssbPadding.append('+'); ssbPadding.append('+');
menu.findItem(R.id.menu_compact).setChecked(compact); menu.findItem(R.id.menu_compact).setChecked(compact);
menu.findItem(R.id.menu_zoom).setTitle(ssbZoom);
menu.findItem(R.id.menu_padding).setTitle(ssbPadding); menu.findItem(R.id.menu_zoom)
.setTitle(ssbZoom)
.setIcon(R.drawable.twotone_format_size_24);
PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_zoom));
menu.findItem(R.id.menu_padding)
.setTitle(ssbPadding)
.setIcon(R.drawable.twotone_fullscreen_24);
menu.findItem(R.id.menu_padding).setVisible(cards); menu.findItem(R.id.menu_padding).setVisible(cards);
PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_padding));
menu.findItem(R.id.menu_theme).setVisible(viewType == AdapterMessage.ViewType.UNIFIED); menu.findItem(R.id.menu_theme).setVisible(viewType == AdapterMessage.ViewType.UNIFIED);
menu.findItem(R.id.menu_select_all).setVisible(folder); menu.findItem(R.id.menu_select_all).setVisible(folder);
@ -4561,9 +4570,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
ibUnflagged.setVisibility(quick_filter && folder ? View.VISIBLE : View.GONE); ibUnflagged.setVisibility(quick_filter && folder ? View.VISIBLE : View.GONE);
ibSnoozed.setVisibility(quick_filter && folder && !drafts ? View.VISIBLE : View.GONE); ibSnoozed.setVisibility(quick_filter && folder && !drafts ? View.VISIBLE : View.GONE);
PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_zoom));
PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_padding));
super.onPrepareOptionsMenu(menu); super.onPrepareOptionsMenu(menu);
} }

@ -136,7 +136,7 @@ public class PopupMenuLifecycle extends PopupMenu {
ssb.insert(0, "\uFFFC\u2002"); // object replacement character, en space ssb.insert(0, "\uFFFC\u2002"); // object replacement character, en space
ssb.setSpan(imageSpan, 0, 1, 0); ssb.setSpan(imageSpan, 0, 1, 0);
menuItem.setTitle(ssb); menuItem.setTitle(ssb);
//menuItem.setIcon(null); menuItem.setIcon(null);
menuItem.setTitleCondensed(""); menuItem.setTitleCondensed("");
} }
} }

Loading…
Cancel
Save