Added solarized light theme

pull/199/head
M66B 4 years ago
parent ab4d527d73
commit 513ef8a854

@ -179,8 +179,12 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
break; break;
// Solarized // Solarized
case "solarized_light":
setTheme(R.style.AppThemeSolarizedLight);
break;
case "solarized": case "solarized":
setTheme(R.style.AppThemeSolarized); case "solarized_dark":
setTheme(R.style.AppThemeSolarizedDark);
break; break;
// Black // Black
@ -246,6 +250,10 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
setTheme(night setTheme(night
? R.style.AppThemeGreySteelBlueDark : R.style.AppThemeGreySteelBlueLight); ? R.style.AppThemeGreySteelBlueDark : R.style.AppThemeGreySteelBlueLight);
break; break;
case "solarized_system":
setTheme(night
? R.style.AppThemeSolarizedDark : R.style.AppThemeSolarizedLight);
break;
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {

@ -24,7 +24,6 @@ import android.content.ContentResolver;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.text.Spannable; import android.text.Spannable;
@ -49,8 +48,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -200,14 +197,7 @@ public class ActivityEML extends ActivityBase {
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(this)) { FragmentDialogTheme.setBackground(this, view, false);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(this, beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
vSeparatorAttachments.setVisibility(View.GONE); vSeparatorAttachments.setVisibility(View.GONE);
grpReady.setVisibility(View.GONE); grpReady.setVisibility(View.GONE);

@ -39,7 +39,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -61,7 +60,6 @@ public class FragmentAccounts extends FragmentBase {
private boolean settings; private boolean settings;
private boolean cards; private boolean cards;
private boolean beige;
private ViewGroup view; private ViewGroup view;
private SwipeRefreshLayout swipeRefresh; private SwipeRefreshLayout swipeRefresh;
@ -86,7 +84,6 @@ public class FragmentAccounts extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
cards = prefs.getBoolean("cards", true); cards = prefs.getBoolean("cards", true);
beige = prefs.getBoolean("beige", true);
} }
@Override @Override
@ -213,11 +210,7 @@ public class FragmentAccounts extends FragmentBase {
}); });
// Initialize // Initialize
FragmentDialogTheme.setBackground(getContext(), view, false);
if (cards && !Helper.isDarkTheme(getContext()))
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
if (settings) { if (settings) {
fab.show(); fab.show();

@ -33,7 +33,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView; import androidx.appcompat.widget.SearchView;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -48,7 +47,6 @@ import java.util.List;
public class FragmentAnswers extends FragmentBase { public class FragmentAnswers extends FragmentBase {
private boolean cards; private boolean cards;
private boolean beige;
private RecyclerView rvAnswer; private RecyclerView rvAnswer;
private ContentLoadingProgressBar pbWait; private ContentLoadingProgressBar pbWait;
@ -64,7 +62,6 @@ public class FragmentAnswers extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
cards = prefs.getBoolean("cards", true); cards = prefs.getBoolean("cards", true);
beige = prefs.getBoolean("beige", true);
} }
@Override @Override
@ -106,12 +103,7 @@ public class FragmentAnswers extends FragmentBase {
}); });
// Initialize // Initialize
FragmentDialogTheme.setBackground(getContext(), view, false);
if (cards && !Helper.isDarkTheme(getContext()))
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
grpReady.setVisibility(View.GONE); grpReady.setVisibility(View.GONE);
pbWait.setVisibility(View.VISIBLE); pbWait.setVisibility(View.VISIBLE);

@ -965,19 +965,9 @@ public class FragmentCompose extends FragmentBase {
// Initialize // Initialize
setHasOptionsMenu(true); setHasOptionsMenu(true);
FragmentDialogTheme.setBackground(getContext(), view, true);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean cards = prefs.getBoolean("cards", true);
String theme = prefs.getString("theme", null);
if (cards &&
(!Helper.isDarkTheme(getContext())) || "solarized".equals(theme))
view.setBackgroundColor(Helper.resolveColor(getContext(), R.attr.colorCardBackground));
//boolean beige = prefs.getBoolean("beige", true);
//if (beige && !Helper.isDarkTheme(getContext()))
// view.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.lightColorBackground_cards_beige));
boolean keyboard_no_fullscreen = prefs.getBoolean("keyboard_no_fullscreen", false); boolean keyboard_no_fullscreen = prefs.getBoolean("keyboard_no_fullscreen", false);
if (keyboard_no_fullscreen) { if (keyboard_no_fullscreen) {
// https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_FULLSCREEN // https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_FULLSCREEN

@ -1,6 +1,7 @@
package eu.faircode.email; package eu.faircode.email;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.graphics.Paint; import android.graphics.Paint;
@ -15,6 +16,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.core.content.ContextCompat;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
public class FragmentDialogTheme extends FragmentDialogBase { public class FragmentDialogTheme extends FragmentDialogBase {
@ -28,19 +30,20 @@ public class FragmentDialogTheme extends FragmentDialogBase {
private void eval() { private void eval() {
int checkedId = rgTheme.getCheckedRadioButtonId(); int checkedId = rgTheme.getCheckedRadioButtonId();
boolean grey = (checkedId == R.id.rbThemeGrey); boolean grey = (checkedId == R.id.rbThemeGrey);
boolean colored = (grey || boolean solarized = (checkedId == R.id.rbThemeSolarized);
boolean colored = (grey || solarized ||
checkedId == R.id.rbThemeBlueOrange || checkedId == R.id.rbThemeBlueOrange ||
checkedId == R.id.rbThemeRedGreen || checkedId == R.id.rbThemeRedGreen ||
checkedId == R.id.rbThemeYellowPurple); checkedId == R.id.rbThemeYellowPurple);
int optionId = rgThemeOptions.getCheckedRadioButtonId(); int optionId = rgThemeOptions.getCheckedRadioButtonId();
swReverse.setEnabled(colored && !grey); swReverse.setEnabled(colored && !grey && !solarized);
rgThemeOptions.setEnabled(colored); rgThemeOptions.setEnabled(colored);
for (int i = 0; i < rgThemeOptions.getChildCount(); i++) for (int i = 0; i < rgThemeOptions.getChildCount(); i++)
rgThemeOptions.getChildAt(i).setEnabled(colored); rgThemeOptions.getChildAt(i).setEnabled(colored);
swBlack.setEnabled(colored && !grey && optionId != R.id.rbThemeLight); swBlack.setEnabled(colored && !grey && !solarized && optionId != R.id.rbThemeLight);
tvSystem.setEnabled(colored && optionId == R.id.rbThemeSystem); tvSystem.setEnabled(colored && optionId == R.id.rbThemeSystem);
} }
@ -154,6 +157,9 @@ public class FragmentDialogTheme extends FragmentDialogBase {
break; break;
case "solarized": case "solarized":
case "solarized_light":
case "solarized_dark":
case "solarized_system":
rgTheme.check(R.id.rbThemeSolarized); rgTheme.check(R.id.rbThemeSolarized);
break; break;
@ -227,7 +233,11 @@ public class FragmentDialogTheme extends FragmentDialogBase {
editor.putString("theme", editor.putString("theme",
"grey" + (dark ? "_dark" : "_light")).apply(); "grey" + (dark ? "_dark" : "_light")).apply();
} else if (checkedRadioButtonId == R.id.rbThemeSolarized) { } else if (checkedRadioButtonId == R.id.rbThemeSolarized) {
editor.putString("theme", "solarized").apply(); if (system)
editor.putString("theme", "solarized_system").apply();
else
editor.putString("theme",
"solarized" + (dark ? "_dark" : "_light")).apply();
} else if (checkedRadioButtonId == R.id.rbThemeBlack) { } else if (checkedRadioButtonId == R.id.rbThemeBlack) {
editor.putString("theme", "black").apply(); editor.putString("theme", "black").apply();
} else if (checkedRadioButtonId == R.id.rbThemeBlackAndWhite) { } else if (checkedRadioButtonId == R.id.rbThemeBlackAndWhite) {
@ -240,4 +250,23 @@ public class FragmentDialogTheme extends FragmentDialogBase {
.setNegativeButton(android.R.string.cancel, null) .setNegativeButton(android.R.string.cancel, null)
.create(); .create();
} }
static void setBackground(Context context, View view, boolean compose) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean cards = prefs.getBoolean("cards", true);
boolean beige = prefs.getBoolean("beige", true);
String theme = prefs.getString("theme", "blue_orange_system");
boolean dark = Helper.isDarkTheme(context);
boolean solarized = (theme != null && theme.startsWith("solarized"));
if (compose) {
if (cards && (!dark || solarized))
view.setBackgroundColor(Helper.resolveColor(context, R.attr.colorCardBackground));
} else {
if (cards && !dark && !solarized)
view.setBackgroundColor(ContextCompat.getColor(context, beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
}
} }

@ -49,7 +49,6 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -100,7 +99,6 @@ public class FragmentFolders extends FragmentBase {
private FloatingActionButton fabError; private FloatingActionButton fabError;
private boolean cards; private boolean cards;
private boolean beige;
private boolean compact; private boolean compact;
private long account; private long account;
@ -131,7 +129,6 @@ public class FragmentFolders extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
cards = prefs.getBoolean("cards", true); cards = prefs.getBoolean("cards", true);
beige = prefs.getBoolean("beige", true);
compact = prefs.getBoolean("compact_folders", false); compact = prefs.getBoolean("compact_folders", false);
show_hidden = false; // prefs.getBoolean("hidden_folders", false); show_hidden = false; // prefs.getBoolean("hidden_folders", false);
show_flagged = prefs.getBoolean("flagged_folders", false); show_flagged = prefs.getBoolean("flagged_folders", false);
@ -271,12 +268,7 @@ public class FragmentFolders extends FragmentBase {
}); });
// Initialize // Initialize
FragmentDialogTheme.setBackground(getContext(), view, false);
if (cards && !Helper.isDarkTheme(getContext()))
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
grpReady.setVisibility(View.GONE); grpReady.setVisibility(View.GONE);
pbWait.setVisibility(View.VISIBLE); pbWait.setVisibility(View.VISIBLE);
fabAdd.hide(); fabAdd.hide();

@ -31,7 +31,6 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -46,7 +45,6 @@ import java.util.List;
public class FragmentIdentities extends FragmentBase { public class FragmentIdentities extends FragmentBase {
private boolean cards; private boolean cards;
private boolean beige;
private RecyclerView rvIdentity; private RecyclerView rvIdentity;
private ContentLoadingProgressBar pbWait; private ContentLoadingProgressBar pbWait;
@ -62,7 +60,6 @@ public class FragmentIdentities extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
cards = prefs.getBoolean("cards", true); cards = prefs.getBoolean("cards", true);
beige = prefs.getBoolean("beige", true);
} }
@Override @Override
@ -116,12 +113,7 @@ public class FragmentIdentities extends FragmentBase {
}); });
// Initialize // Initialize
FragmentDialogTheme.setBackground(getContext(), view, false);
if (cards && !Helper.isDarkTheme(getContext()))
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
grpReady.setVisibility(View.GONE); grpReady.setVisibility(View.GONE);
pbWait.setVisibility(View.VISIBLE); pbWait.setVisibility(View.VISIBLE);

@ -98,7 +98,6 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.core.content.FileProvider; import androidx.core.content.FileProvider;
import androidx.core.graphics.ColorUtils; import androidx.core.graphics.ColorUtils;
import androidx.core.view.MenuItemCompat; import androidx.core.view.MenuItemCompat;
@ -288,7 +287,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private OpenPgpServiceConnection pgpService; private OpenPgpServiceConnection pgpService;
private boolean cards; private boolean cards;
private boolean beige;
private boolean date; private boolean date;
private boolean date_bold; private boolean date_bold;
private boolean threading; private boolean threading;
@ -407,7 +405,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
swipenav = prefs.getBoolean("swipenav", true); swipenav = prefs.getBoolean("swipenav", true);
cards = prefs.getBoolean("cards", true); cards = prefs.getBoolean("cards", true);
beige = prefs.getBoolean("beige", true);
date = prefs.getBoolean("date", true); date = prefs.getBoolean("date", true);
date_bold = prefs.getBoolean("date_bold", false); date_bold = prefs.getBoolean("date_bold", false);
threading = prefs.getBoolean("threading", true); threading = prefs.getBoolean("threading", true);
@ -1146,12 +1143,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
addKeyPressedListener(onBackPressedListener); addKeyPressedListener(onBackPressedListener);
// Initialize // Initialize
FragmentDialogTheme.setBackground(getContext(), view, false);
if (cards && !Helper.isDarkTheme(getContext()))
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
tvNoEmail.setVisibility(View.GONE); tvNoEmail.setVisibility(View.GONE);
tvNoEmailHint.setVisibility(View.GONE); tvNoEmailHint.setVisibility(View.GONE);
sbThread.setVisibility(View.GONE); sbThread.setVisibility(View.GONE);

@ -48,7 +48,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -409,12 +408,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
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);

@ -52,7 +52,6 @@ import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.cardview.widget.CardView; import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -257,19 +256,13 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
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);
tvNetworkMetered.setVisibility(View.GONE); tvNetworkMetered.setVisibility(View.GONE);
tvNetworkRoaming.setVisibility(View.GONE); tvNetworkRoaming.setVisibility(View.GONE);
cardDebug.setVisibility(View.GONE); cardDebug.setVisibility(View.GONE);
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
return view; return view;
} }

@ -49,7 +49,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -875,13 +874,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
grpGravatars.setVisibility(BuildConfig.PLAY_STORE_RELEASE ? View.GONE : View.VISIBLE); grpGravatars.setVisibility(BuildConfig.PLAY_STORE_RELEASE ? View.GONE : View.VISIBLE);
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);

@ -48,7 +48,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -339,12 +338,7 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
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");

@ -55,7 +55,6 @@ import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.cardview.widget.CardView; import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@ -801,12 +800,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
swPowerMenu.setVisibility(!BuildConfig.PLAY_STORE_RELEASE && swPowerMenu.setVisibility(!BuildConfig.PLAY_STORE_RELEASE &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.R Build.VERSION.SDK_INT >= Build.VERSION_CODES.R

@ -47,7 +47,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -501,12 +500,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
swNotifyTransliterate.setVisibility(TextHelper.canTransliterate() ? View.VISIBLE : View.GONE); swNotifyTransliterate.setVisibility(TextHelper.canTransliterate() ? View.VISIBLE : View.GONE);
swUnseenIgnored.setVisibility(Helper.isXiaomi() ? View.GONE : View.VISIBLE); swUnseenIgnored.setVisibility(Helper.isXiaomi() ? View.GONE : View.VISIBLE);

@ -50,7 +50,6 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import androidx.webkit.WebViewFeature; import androidx.webkit.WebViewFeature;
@ -359,13 +358,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
tvClientId.setText(getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME); tvClientId.setText(getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME);
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);

@ -42,7 +42,6 @@ import android.widget.Spinner;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -444,12 +443,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
boolean beige = prefs.getBoolean("beige", true);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
}
String re1 = getString(R.string.title_subject_reply, ""); String re1 = getString(R.string.title_subject_reply, "");
String re2 = getString(R.string.title_subject_reply_alt, ""); String re2 = getString(R.string.title_subject_reply_alt, "");

@ -43,7 +43,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat; import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner; import androidx.lifecycle.LifecycleOwner;
@ -368,12 +367,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
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>>() {

@ -39,7 +39,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView; import androidx.appcompat.widget.SearchView;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -72,7 +71,6 @@ public class FragmentRules extends FragmentBase {
private String type; private String type;
private boolean cards; private boolean cards;
private boolean beige;
private RecyclerView rvRule; private RecyclerView rvRule;
private ContentLoadingProgressBar pbWait; private ContentLoadingProgressBar pbWait;
@ -100,7 +98,6 @@ public class FragmentRules extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
cards = prefs.getBoolean("cards", true); cards = prefs.getBoolean("cards", true);
beige = prefs.getBoolean("beige", true);
} }
@Override @Override
@ -151,11 +148,7 @@ public class FragmentRules extends FragmentBase {
// Initialize // Initialize
if (cards && !Helper.isDarkTheme(getContext())) FragmentDialogTheme.setBackground(getContext(), view, false);
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
? R.color.lightColorBackground_cards_beige
: R.color.lightColorBackground_cards));
grpReady.setVisibility(View.GONE); grpReady.setVisibility(View.GONE);
pbWait.setVisibility(View.VISIBLE); pbWait.setVisibility(View.VISIBLE);

@ -52,7 +52,6 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.PopupMenu; import androidx.appcompat.widget.PopupMenu;
import androidx.constraintlayout.widget.Group; import androidx.constraintlayout.widget.Group;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@ -432,13 +431,7 @@ public class FragmentSetup extends FragmentBase {
}); });
// Initialize // Initialize
if (!Helper.isDarkTheme(getContext())) { FragmentDialogTheme.setBackground(getContext(), view, false);
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));
}
tvNoInternet.setVisibility(View.GONE); tvNoInternet.setVisibility(View.GONE);
btnIdentity.setEnabled(false); btnIdentity.setEnabled(false);

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white" />
</shape>

@ -134,9 +134,10 @@
<color name="greyAccentLight">#c1d5e0</color> <color name="greyAccentLight">#c1d5e0</color>
<!-- https://github.com/altercation/solarized --> <!-- https://github.com/altercation/solarized -->
<color name="solarizedPrimary">#073642</color> <color name="darkSolarizedPrimary">#073642</color>
<color name="solarizedPrimaryDark">#002b36</color> <color name="darkSolarizedPrimaryDark">#002b36</color>
<color name="solarizedAccent">#268bd2</color> <color name="darkSolarizedAccent">#268bd2</color>
<color name="lightSolarizedPaper">#fdf6e3</color>
<!-- default: #323232 --> <!-- default: #323232 -->
<color name="design_snackbar_background_color" tools:override="true">#222</color> <color name="design_snackbar_background_color" tools:override="true">#222</color>

@ -291,37 +291,37 @@
<style name="AppThemeBlueOrangeBlack" parent="AppThemeBlueOrangeDark"> <style name="AppThemeBlueOrangeBlack" parent="AppThemeBlueOrangeDark">
<item name="themeName">black</item> <item name="themeName">black</item>
<item name="android:windowBackground">@drawable/black_background</item> <item name="android:windowBackground">@drawable/background_black</item>
<item name="colorDrawerBackground">@color/black</item> <item name="colorDrawerBackground">@color/black</item>
</style> </style>
<style name="AppThemeOrangeBlueBlack" parent="AppThemeOrangeBlueDark"> <style name="AppThemeOrangeBlueBlack" parent="AppThemeOrangeBlueDark">
<item name="themeName">black</item> <item name="themeName">black</item>
<item name="android:windowBackground">@drawable/black_background</item> <item name="android:windowBackground">@drawable/background_black</item>
<item name="colorDrawerBackground">@color/black</item> <item name="colorDrawerBackground">@color/black</item>
</style> </style>
<style name="AppThemeYellowPurpleBlack" parent="AppThemeYellowPurpleDark"> <style name="AppThemeYellowPurpleBlack" parent="AppThemeYellowPurpleDark">
<item name="themeName">black</item> <item name="themeName">black</item>
<item name="android:windowBackground">@drawable/black_background</item> <item name="android:windowBackground">@drawable/background_black</item>
<item name="colorDrawerBackground">@color/black</item> <item name="colorDrawerBackground">@color/black</item>
</style> </style>
<style name="AppThemePurpleYellowBlack" parent="AppThemePurpleYellowDark"> <style name="AppThemePurpleYellowBlack" parent="AppThemePurpleYellowDark">
<item name="themeName">black</item> <item name="themeName">black</item>
<item name="android:windowBackground">@drawable/black_background</item> <item name="android:windowBackground">@drawable/background_black</item>
<item name="colorDrawerBackground">@color/black</item> <item name="colorDrawerBackground">@color/black</item>
</style> </style>
<style name="AppThemeRedGreenBlack" parent="AppThemeRedGreenDark"> <style name="AppThemeRedGreenBlack" parent="AppThemeRedGreenDark">
<item name="themeName">black</item> <item name="themeName">black</item>
<item name="android:windowBackground">@drawable/black_background</item> <item name="android:windowBackground">@drawable/background_black</item>
<item name="colorDrawerBackground">@color/black</item> <item name="colorDrawerBackground">@color/black</item>
</style> </style>
<style name="AppThemeGreenRedBlack" parent="AppThemeGreenRedDark"> <style name="AppThemeGreenRedBlack" parent="AppThemeGreenRedDark">
<item name="themeName">black</item> <item name="themeName">black</item>
<item name="android:windowBackground">@drawable/black_background</item> <item name="android:windowBackground">@drawable/background_black</item>
<item name="colorDrawerBackground">@color/black</item> <item name="colorDrawerBackground">@color/black</item>
</style> </style>
@ -336,7 +336,7 @@
<item name="colorInfoForeground">@color/white</item> <item name="colorInfoForeground">@color/white</item>
<item name="colorInfoBackground">@color/blackPrimary</item> <item name="colorInfoBackground">@color/blackPrimary</item>
<item name="android:windowBackground">@drawable/black_background</item> <item name="android:windowBackground">@drawable/background_black</item>
<item name="colorDrawerBackground">@color/black</item> <item name="colorDrawerBackground">@color/black</item>
</style> </style>
@ -393,27 +393,46 @@
<item name="colorInfoForeground">@color/white</item> <item name="colorInfoForeground">@color/white</item>
<item name="colorInfoBackground">@color/greyPrimary</item> <item name="colorInfoBackground">@color/greyPrimary</item>
<item name="android:windowBackground">@drawable/black_background</item> <item name="android:windowBackground">@drawable/background_black</item>
<item name="colorDrawerBackground">@color/black</item> <item name="colorDrawerBackground">@color/black</item>
</style> </style>
<style name="AppThemeSolarized" parent="AppThemeBaseDark"> <style name="AppThemeSolarizedLight" parent="AppThemeBaseLight">
<item name="colorPrimary">@color/darkSolarizedPrimary</item>
<item name="colorPrimaryDark">@color/darkSolarizedPrimaryDark</item>
<item name="colorAccent">@color/darkSolarizedAccent</item>
<item name="colorUnreadHighlight">@color/darkSolarizedAccent</item>
<item name="colorFabBackground">@color/darkSolarizedAccent</item>
<item name="colorInfoForeground">@color/white</item>
<item name="colorInfoBackground">@color/darkSolarizedAccent</item>
<item name="android:textColorLink">@color/darkSolarizedAccent</item>
<item name="colorCardBackground">@color/lightSolarizedPaper</item>
<item name="android:windowBackground">@drawable/background_white</item>
<item name="colorDrawerBackground">@color/white</item>
</style>
<style name="AppThemeSolarizedDark" parent="AppThemeBaseDark">
<item name="themeName">black</item> <item name="themeName">black</item>
<item name="colorPrimary">@color/solarizedPrimary</item> <item name="colorPrimary">@color/darkSolarizedPrimary</item>
<item name="colorPrimaryDark">@color/solarizedPrimaryDark</item> <item name="colorPrimaryDark">@color/darkSolarizedPrimaryDark</item>
<item name="colorAccent">@color/solarizedAccent</item> <item name="colorAccent">@color/darkSolarizedAccent</item>
<item name="colorUnreadHighlight">@color/solarizedAccent</item> <item name="colorUnreadHighlight">@color/darkSolarizedAccent</item>
<item name="colorFabBackground">@color/solarizedAccent</item> <item name="colorFabBackground">@color/darkSolarizedAccent</item>
<item name="colorInfoForeground">@color/white</item> <item name="colorInfoForeground">@color/white</item>
<item name="colorInfoBackground">@color/solarizedPrimary</item> <item name="colorInfoBackground">@color/darkSolarizedAccent</item>
<item name="android:textColorLink">@color/solarizedAccent</item> <item name="android:textColorLink">@color/darkSolarizedAccent</item>
<item name="colorCardBackground">@color/solarizedPrimaryDark</item> <item name="colorCardBackground">@color/darkSolarizedPrimaryDark</item>
<item name="android:windowBackground">@drawable/black_background</item> <item name="android:windowBackground">@drawable/background_black</item>
<item name="colorDrawerBackground">@color/black</item> <item name="colorDrawerBackground">@color/black</item>
</style> </style>

Loading…
Cancel
Save