From 85719aaa7c47078606042341e68f7d917c0105ce Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 19 Aug 2022 17:14:18 +0200 Subject: [PATCH] Added option for large message action buttons --- .../eu/faircode/email/AdapterMessage.java | 37 ++++++++++++++++--- .../email/FragmentOptionsDisplay.java | 12 +++++- .../res/layout/fragment_options_display.xml | 37 ++++++++++++------- app/src/main/res/values/strings.xml | 1 + 4 files changed, 68 insertions(+), 19 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 985152c65e..b62d1783fe 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -171,6 +171,7 @@ import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.HashMap; @@ -283,6 +284,7 @@ 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); + tvReformatted = vsBody.findViewById(R.id.tvReformatted); tvDecrypt = vsBody.findViewById(R.id.tvDecrypt); tvSignedData = vsBody.findViewById(R.id.tvSignedData); @@ -1709,8 +1735,8 @@ public class AdapterMessage extends RecyclerView.Adapter= Build.VERSION_CODES.O) ibTools.setTooltipText(ibTools.getContentDescription()); ibTools.setVisibility(outbox ? View.GONE : View.VISIBLE); - vwEmpty.setVisibility(outbox ? View.GONE : View.VISIBLE); if (tools) bindButtons(message); @@ -7218,6 +7244,7 @@ public class AdapterMessage extends RecyclerView.Adapter @@ -842,10 +842,10 @@ android:layout_marginTop="6dp" android:drawableStart="@drawable/twotone_check_24" android:drawablePadding="6dp" - app:drawableTint="?attr/colorControlNormal" android:text="@string/title_advanced_bimi_unverified" android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textStyle="italic" + app:drawableTint="?attr/colorControlNormal" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvBimiHint" /> @@ -857,10 +857,10 @@ android:layout_marginTop="6dp" android:drawableStart="@drawable/twotone_done_all_24" android:drawablePadding="6dp" - app:drawableTint="?attr/colorVerified" android:text="@string/title_advanced_bimi_verified" android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textStyle="italic" + app:drawableTint="?attr/colorVerified" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvBimiUnverified" /> @@ -893,10 +893,10 @@ android:layout_height="wrap_content" android:layout_marginStart="12dp" android:layout_marginTop="6dp" - app:drawableTint="?attr/colorWarning" android:text="@string/title_advanced_privacy_risk" android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textColor="?attr/colorWarning" + app:drawableTint="?attr/colorWarning" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swGravatars" /> @@ -908,10 +908,10 @@ android:layout_marginTop="12dp" android:drawableEnd="@drawable/twotone_open_in_new_12" android:drawablePadding="6dp" - app:drawableTint="?android:attr/textColorLink" android:text="@string/title_privacy_policy" android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textColor="?android:attr/textColorLink" + app:drawableTint="?android:attr/textColorLink" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvGravatarsHint" /> @@ -932,10 +932,10 @@ android:layout_height="wrap_content" android:layout_marginStart="12dp" android:layout_marginTop="6dp" - app:drawableTint="?attr/colorWarning" android:text="@string/title_advanced_privacy_risk" android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textColor="?attr/colorWarning" + app:drawableTint="?attr/colorWarning" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swLibravatars" /> @@ -947,10 +947,10 @@ android:layout_marginTop="12dp" android:drawableEnd="@drawable/twotone_open_in_new_12" android:drawablePadding="6dp" - app:drawableTint="?android:attr/textColorLink" android:text="@string/title_privacy_policy" android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textColor="?android:attr/textColorLink" + app:drawableTint="?android:attr/textColorLink" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvLibravatarsHint" /> @@ -973,10 +973,10 @@ android:layout_marginTop="6dp" android:drawableEnd="@drawable/twotone_open_in_new_12" android:drawablePadding="6dp" - app:drawableTint="?attr/colorWarning" android:text="@string/title_advanced_privacy_risk" android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textColor="?attr/colorWarning" + app:drawableTint="?attr/colorWarning" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swFavicons" /> @@ -1576,6 +1576,17 @@ app:layout_constraintTop_toBottomOf="@id/tvCaptionBody" app:switchPadding="12dp" /> + + + app:layout_constraintTop_toBottomOf="@id/swLargeButtons" /> @@ -2007,8 +2018,8 @@ android:checked="true" android:drawableStart="@drawable/twotone_flag_24" android:drawablePadding="6dp" - app:drawableTint="?attr/colorWarning" android:text="@string/title_advanced_authentication" + app:drawableTint="?attr/colorWarning" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swTextTitles" @@ -2046,10 +2057,10 @@ android:layout_marginTop="6dp" android:drawableStart="@drawable/twotone_gpp_maybe_24" android:drawablePadding="6dp" - app:drawableTint="?attr/colorControlNormal" android:text="@string/title_advanced_authentication_some" android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textStyle="italic" + app:drawableTint="?attr/colorControlNormal" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swAuthenticationIndicator" /> @@ -2061,10 +2072,10 @@ android:layout_marginTop="6dp" android:drawableStart="@drawable/twotone_gpp_good_24" android:drawablePadding="6dp" - app:drawableTint="?attr/colorVerified" android:text="@string/title_advanced_authentication_all" android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textStyle="italic" + app:drawableTint="?attr/colorVerified" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvAuthSome" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index afadb4f5aa..2bf082f71e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -558,6 +558,7 @@ Show message preview in italics Number of preview lines Expand address details by default + Use large buttons for message actions Show contents of compressed attachments Show attachments after the message text Show image thumbnails after the message text