diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java index 7d03e04279..c83669373c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java @@ -48,6 +48,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.SwitchCompat; +import androidx.core.content.ContextCompat; import androidx.lifecycle.Lifecycle; import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.preference.PreferenceManager; @@ -407,6 +408,10 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe } }); + // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); return view; diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsConnection.java b/app/src/main/java/eu/faircode/email/FragmentOptionsConnection.java index 209248018a..661283381b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsConnection.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsConnection.java @@ -51,6 +51,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.SwitchCompat; import androidx.constraintlayout.widget.Group; +import androidx.core.content.ContextCompat; import androidx.lifecycle.Lifecycle; import androidx.preference.PreferenceManager; @@ -251,6 +252,10 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre } }); + // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); tvNetworkMetered.setVisibility(View.GONE); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index b9c413c2ed..cf238b6c64 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -48,6 +48,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.SwitchCompat; +import androidx.core.content.ContextCompat; import androidx.fragment.app.FragmentActivity; import androidx.lifecycle.Lifecycle; import androidx.preference.PreferenceManager; @@ -852,6 +853,9 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer } }); + // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); return view; diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsEncryption.java b/app/src/main/java/eu/faircode/email/FragmentOptionsEncryption.java index 7b7bd39a71..a6b5fe81c3 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsEncryption.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsEncryption.java @@ -48,6 +48,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.SwitchCompat; +import androidx.core.content.ContextCompat; import androidx.lifecycle.Lifecycle; import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.preference.PreferenceManager; @@ -315,6 +316,10 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre } }); + // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + try { int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES"); tvKeySize.setText(getString(R.string.title_advanced_aes_key_size, maxKeySize)); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index c36ece2ad2..2ef7f4a722 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -54,6 +54,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.SwitchCompat; import androidx.constraintlayout.widget.Group; +import androidx.core.content.ContextCompat; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Observer; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -770,6 +771,10 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); + // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + tvFtsIndexed.setText(null); DB db = DB.getInstance(getContext()); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java index c6fe67fe90..a31e3e4533 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsNotifications.java @@ -47,6 +47,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.SwitchCompat; import androidx.constraintlayout.widget.Group; +import androidx.core.content.ContextCompat; import androidx.lifecycle.Lifecycle; import androidx.preference.PreferenceManager; @@ -471,6 +472,10 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared } }); + // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + swAlertOnce.setVisibility(Log.isXiaomi() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE); // https://developer.android.com/training/notify-user/group diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java b/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java index 20c983859f..8da6ffb57c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsPrivacy.java @@ -50,6 +50,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.SwitchCompat; import androidx.constraintlayout.widget.Group; +import androidx.core.content.ContextCompat; import androidx.lifecycle.Lifecycle; import androidx.preference.PreferenceManager; import androidx.webkit.WebViewFeature; @@ -333,6 +334,10 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer } }); + // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); return view; diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java index ef982ebfea..51011bad32 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSend.java @@ -40,6 +40,7 @@ import android.widget.Spinner; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.SwitchCompat; +import androidx.core.content.ContextCompat; import androidx.lifecycle.Lifecycle; import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.preference.PreferenceManager; @@ -420,6 +421,10 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc } }); + // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); return view; diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java index 60f28e1bd4..dcbdc2c94a 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsSynchronize.java @@ -43,6 +43,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.SwitchCompat; import androidx.constraintlayout.widget.Group; +import androidx.core.content.ContextCompat; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleOwner; @@ -331,6 +332,10 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr } }); + // Initialize + if (!Helper.isDarkTheme(getContext())) + view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); + DB db = DB.getInstance(getContext()); db.account().liveSynchronizingAccounts().observe(getViewLifecycleOwner(), new Observer>() { @Override diff --git a/app/src/main/res/layout/fragment_options_behavior.xml b/app/src/main/res/layout/fragment_options_behavior.xml index a3bd7df8bd..fd3eee94de 100644 --- a/app/src/main/res/layout/fragment_options_behavior.xml +++ b/app/src/main/res/layout/fragment_options_behavior.xml @@ -10,7 +10,7 @@ android:paddingEnd="6dp" android:paddingBottom="0dp" android:scrollbarStyle="outsideOverlay" - tools:context="eu.faircode.email.ActivitySetup"> + tools:context=".ActivitySetup"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -