From b1cad66ad1920828430ccd360e24fc0b8225b0da Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 26 Oct 2021 18:48:01 +0200 Subject: [PATCH] Added Material You hint --- .../faircode/email/FragmentDialogTheme.java | 5 ++- app/src/main/res/layout/dialog_theme.xml | 35 ++++++++++++------- app/src/main/res/values/strings.xml | 1 + 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogTheme.java b/app/src/main/java/eu/faircode/email/FragmentDialogTheme.java index 10f926e6f9..e5263cd746 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogTheme.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogTheme.java @@ -27,6 +27,7 @@ public class FragmentDialogTheme extends FragmentDialogBase { private RadioGroup rgTheme; private SwitchCompat swReverse; private RadioButton rbThemeYou; + private TextView tvYou; private RadioGroup rgThemeOptions; private TextView tvSystem; private SwitchCompat swBlack; @@ -75,6 +76,7 @@ public class FragmentDialogTheme extends FragmentDialogBase { View dview = LayoutInflater.from(context).inflate(R.layout.dialog_theme, null); rgTheme = dview.findViewById(R.id.rgTheme); rbThemeYou = dview.findViewById(R.id.rbThemeYou); + tvYou = dview.findViewById(R.id.tvYou); swReverse = dview.findViewById(R.id.swReverse); rgThemeOptions = dview.findViewById(R.id.rgThemeOptions); tvSystem = dview.findViewById(R.id.tvSystem); @@ -91,7 +93,8 @@ public class FragmentDialogTheme extends FragmentDialogBase { } }); - rbThemeYou.setVisibility((Build.VERSION.SDK_INT < Build.VERSION_CODES.S ? View.GONE : View.VISIBLE)); + rbThemeYou.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.S ? View.GONE : View.VISIBLE); + tvYou.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.S ? View.GONE : View.VISIBLE); swReverse.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override diff --git a/app/src/main/res/layout/dialog_theme.xml b/app/src/main/res/layout/dialog_theme.xml index 132f23e6a2..2494230422 100644 --- a/app/src/main/res/layout/dialog_theme.xml +++ b/app/src/main/res/layout/dialog_theme.xml @@ -35,7 +35,7 @@ + + + app:layout_constraintTop_toBottomOf="@id/tvYou" /> Light background for original message view Light background for message editor + The Material You colors can be configured in the Android system settings This will automatically switch to a light/dark theme on day/night mode, if supported by Android I want more colors