From 9d1176ec5feb1451069796750517bd2de3f99051 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 9 Nov 2021 09:49:15 +0100 Subject: [PATCH] Show composer zoom level --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 9 +++++++++ .../main/java/eu/faircode/email/PopupMenuLifecycle.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 5f797c8a72..eeeefdc9e6 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -1616,6 +1616,15 @@ public class FragmentCompose extends FragmentBase { menu.findItem(R.id.menu_answer_create).setEnabled(state == State.LOADED); menu.findItem(R.id.menu_clear).setEnabled(state == State.LOADED); + SpannableStringBuilder ssbZoom = new SpannableStringBuilder(getString(R.string.title_zoom)); + ssbZoom.append(' '); + for (int i = 0; i <= zoom; i++) + ssbZoom.append('+'); + menu.findItem(R.id.menu_zoom) + .setIcon(R.drawable.twotone_format_size_24) + .setTitle(ssbZoom); + PopupMenuLifecycle.insertIcon(context, menu.findItem(R.id.menu_zoom)); + int colorEncrypt = Helper.resolveColor(context, R.attr.colorEncrypt); int colorActionForeground = Helper.resolveColor(context, R.attr.colorActionForeground); diff --git a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java index e26cf969b8..8a2409ed63 100644 --- a/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java +++ b/app/src/main/java/eu/faircode/email/PopupMenuLifecycle.java @@ -115,7 +115,7 @@ public class PopupMenuLifecycle extends PopupMenu { } } - private static void insertIcon(Context context, MenuItem menuItem) { + static void insertIcon(Context context, MenuItem menuItem) { Drawable icon = menuItem.getIcon(); if (icon == null)