From 24373b4be9a768f25a10429b7ab990d6092c3b64 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 11 May 2021 22:10:47 +0200 Subject: [PATCH] Use cards for main setup --- .../java/eu/faircode/email/FragmentSetup.java | 7 +- app/src/main/res/layout/fragment_setup.xml | 1124 +++++++++-------- 2 files changed, 584 insertions(+), 547 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index 5ce8f889fa..d56b7fb2f5 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -51,6 +51,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.PopupMenu; import androidx.constraintlayout.widget.Group; +import androidx.core.content.ContextCompat; import androidx.fragment.app.FragmentActivity; import androidx.lifecycle.Observer; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -91,7 +92,6 @@ public class FragmentSetup extends FragmentBase { private Button btnInbox; private Group grpManual; - private Group grpDoze; private Group grpBackgroundRestricted; private Group grpDataSaver; @@ -157,7 +157,6 @@ public class FragmentSetup extends FragmentBase { btnInbox = view.findViewById(R.id.btnInbox); grpManual = view.findViewById(R.id.grpManual); - grpDoze = view.findViewById(R.id.grpDoze); grpBackgroundRestricted = view.findViewById(R.id.grpBackgroundRestricted); grpDataSaver = view.findViewById(R.id.grpDataSaver); @@ -404,6 +403,9 @@ public class FragmentSetup extends FragmentBase { }); // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + btnIdentity.setEnabled(false); tvNoComposable.setVisibility(View.GONE); @@ -416,7 +418,6 @@ public class FragmentSetup extends FragmentBase { btnInbox.setEnabled(false); - grpDoze.setVisibility(Build.VERSION.SDK_INT < Build.VERSION_CODES.M ? View.GONE : View.VISIBLE); grpBackgroundRestricted.setVisibility(View.GONE); grpDataSaver.setVisibility(View.GONE); diff --git a/app/src/main/res/layout/fragment_setup.xml b/app/src/main/res/layout/fragment_setup.xml index 452bf3bd2b..386f027a20 100644 --- a/app/src/main/res/layout/fragment_setup.xml +++ b/app/src/main/res/layout/fragment_setup.xml @@ -18,579 +18,615 @@ android:layout_height="wrap_content" android:paddingBottom="24dp"> - + app:layout_constraintTop_toTopOf="parent"> - + + + + + + + + + + + app:layout_constraintTop_toBottomOf="@+id/cardWelcome"> - + + + + + + + +