From 1b5970a4836bdf77cd0904815b286b2afc3560e4 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 6 Sep 2020 16:26:17 +0200 Subject: [PATCH] Clear measurements on text size changes --- .../main/java/eu/faircode/email/FragmentMessages.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 05e799459f..97a87e585d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -4109,6 +4109,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. int zoom = prefs.getInt("view_zoom", compact ? 0 : 1); zoom = ++zoom % 3; prefs.edit().putInt("view_zoom", zoom).apply(); + clearMeasurements(); adapter.setZoom(zoom); } @@ -4122,9 +4123,17 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. adapter.setCompact(compact); adapter.setZoom(zoom); + clearMeasurements(); getActivity().invalidateOptionsMenu(); } + private void clearMeasurements() { + scales.clear(); + sizes.clear(); + heights.clear(); + positions.clear(); + } + private void onMenuSelectLanguage() { Bundle args = new Bundle(); args.putLong("account", account);