From 7741037edc30e6e8367bb3eb1f7890b1187df71d Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 20 Aug 2022 08:16:14 +0200 Subject: [PATCH] Larger buttons (2) --- CHANGELOG.md | 2 +- app/src/main/assets/CHANGELOG.md | 2 +- .../eu/faircode/email/AdapterMessage.java | 51 +++++++++++-------- .../eu/faircode/email/FragmentMessages.java | 21 ++++++-- .../email/FragmentOptionsDisplay.java | 12 +---- .../main/java/eu/faircode/email/Helper.java | 14 +++++ .../res/layout/fragment_options_display.xml | 13 +---- app/src/main/res/menu/menu_messages.xml | 7 +++ app/src/main/res/values/strings.xml | 2 +- metadata/en-US/changelogs/1955.txt | 2 +- 10 files changed, 74 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef8472c686..b577efff3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ### 1.1955 - 2022-08-18 * Added batch enable showing child folders in the navigation menu -* Added display option for large message action buttons +* Added menu item for larger message action buttons * Small improvements and minor bug fixes * Updated libraries * Updated translations diff --git a/app/src/main/assets/CHANGELOG.md b/app/src/main/assets/CHANGELOG.md index ef8472c686..b577efff3b 100644 --- a/app/src/main/assets/CHANGELOG.md +++ b/app/src/main/assets/CHANGELOG.md @@ -7,7 +7,7 @@ ### 1.1955 - 2022-08-18 * Added batch enable showing child folders in the navigation menu -* Added display option for large message action buttons +* Added menu item for larger message action buttons * Small improvements and minor bug fixes * Updated libraries * Updated translations diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 51993c1723..291aaa62e8 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -889,26 +889,6 @@ public class AdapterMessage extends RecyclerView.Adapter ids = new ArrayList<>(); - for (int id : ibFlow.getReferencedIds()) - ids.add(id); - for (int id : new int[]{ - R.id.ibTools, R.id.vwEmpty, - R.id.ibFull, R.id.ibImages, R.id.ibAmp, - R.id.ibDecrypt, R.id.ibVerify}) - ids.add(id); - for (int id : ids) { - View v = cl.findViewById(id); - ViewGroup.LayoutParams lparam = v.getLayoutParams(); - lparam.width = dp36; - lparam.height = dp36; - } - } - ibTools = vsBody.findViewById(R.id.ibTools); buttons = vsBody.findViewById(R.id.buttons); @@ -958,6 +938,24 @@ public class AdapterMessage extends RecyclerView.Adapter ids = new ArrayList<>(); + ids.addAll(Helper.fromIntArray(ibFlow.getReferencedIds())); + ids.addAll(Arrays.asList(R.id.ibTools, R.id.vwEmpty, + R.id.ibFull, R.id.ibImages, R.id.ibAmp, + R.id.ibDecrypt, R.id.ibVerify, + R.id.ibInfrastructure, + R.id.ibTrashBottom, R.id.ibArchiveBottom, R.id.ibMoveBottom, + R.id.ibSeenBottom)); + for (int id : ids) { + View v = view.findViewById(id); + ViewGroup.LayoutParams lparam = v.getLayoutParams(); + lparam.width = dp36; + lparam.height = dp36; + } + } + unwire(); wire(); } @@ -7131,7 +7129,7 @@ public class AdapterMessage extends RecyclerView.Adapter list) { + int[] result = new int[list.size()]; + for (int i = 0; i < list.size(); i++) + result[i] = list.get(i); + return result; + } + + static List fromIntArray(int[] array) { + List result = new ArrayList<>(); + for (int i = 0; i < array.length; i++) + result.add(array[i]); + return result; + } + static long[] toLongArray(List list) { long[] result = new long[list.size()]; for (int i = 0; i < list.size(); i++) diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml index 883490ebb9..67f03dba60 100644 --- a/app/src/main/res/layout/fragment_options_display.xml +++ b/app/src/main/res/layout/fragment_options_display.xml @@ -1576,17 +1576,6 @@ app:layout_constraintTop_toBottomOf="@id/tvCaptionBody" app:switchPadding="12dp" /> - - + app:layout_constraintTop_toBottomOf="@id/swAddresses" /> + + Show message preview in italics Number of preview lines Expand address details by default - Use larger buttons for message actions Show contents of compressed attachments Show attachments after the message text Show image thumbnails after the message text @@ -1630,6 +1629,7 @@ Compact view Text size Padding size + Larger buttons Select language Select all Select found diff --git a/metadata/en-US/changelogs/1955.txt b/metadata/en-US/changelogs/1955.txt index 5d547e29e4..47e2ab5546 100644 --- a/metadata/en-US/changelogs/1955.txt +++ b/metadata/en-US/changelogs/1955.txt @@ -7,7 +7,7 @@ Ledumahadi 1.1955 - 2022-08-18 * Added batch enable showing child folders in the navigation menu -* Added display option for large message action buttons +* Added menu item for larger message action buttons * Small improvements and minor bug fixes * Updated libraries * Updated translations