Allow gray settings card background

pull/198/head
M66B 4 years ago
parent 01869a4fe8
commit 88d1d4cb09

@ -570,7 +570,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
Log.i("Preference " + key + "=" + prefs.getAll().get(key)); Log.i("Preference " + key + "=" + prefs.getAll().get(key));
if ("theme".equals(key)) { if ("theme".equals(key) || "beige".equals(key)) {
finish(); finish();
if (this.getClass().equals(ActivitySetup.class) || this.getClass().equals(ActivityView.class)) if (this.getClass().equals(ActivitySetup.class) || this.getClass().equals(ActivityView.class))
startActivity(getIntent()); startActivity(getIntent());

@ -409,8 +409,12 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);

@ -253,8 +253,12 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);

@ -283,6 +283,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swBeige.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swBeige.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
getActivity().getIntent().putExtra("tab", "display");
prefs.edit().putBoolean("beige", checked).apply(); prefs.edit().putBoolean("beige", checked).apply();
} }
}); });
@ -854,8 +855,13 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
return view; return view;

@ -317,8 +317,12 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
try { try {
int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES"); int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");

@ -772,8 +772,12 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
tvFtsIndexed.setText(null); tvFtsIndexed.setText(null);

@ -473,8 +473,12 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
swAlertOnce.setVisibility(Log.isXiaomi() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE); swAlertOnce.setVisibility(Log.isXiaomi() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);

@ -335,8 +335,12 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);

@ -422,8 +422,12 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);

@ -333,8 +333,12 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
DB db = DB.getInstance(getContext()); DB db = DB.getInstance(getContext());
db.account().liveSynchronizingAccounts().observe(getViewLifecycleOwner(), new Observer<List<EntityAccount>>() { db.account().liveSynchronizingAccounts().observe(getViewLifecycleOwner(), new Observer<List<EntityAccount>>() {

@ -403,8 +403,13 @@ public class FragmentSetup extends FragmentBase {
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) if (!Helper.isDarkTheme(getContext())) {
view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige)); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
btnIdentity.setEnabled(false); btnIdentity.setEnabled(false);
tvNoComposable.setVisibility(View.GONE); tvNoComposable.setVisibility(View.GONE);

Loading…
Cancel
Save