mirror of https://github.com/M66B/FairEmail.git
Added solarized light theme
This commit is contained in:
parent
ab4d527d73
commit
513ef8a854
|
@ -179,8 +179,12 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|||
break;
|
||||
|
||||
// Solarized
|
||||
case "solarized_light":
|
||||
setTheme(R.style.AppThemeSolarizedLight);
|
||||
break;
|
||||
case "solarized":
|
||||
setTheme(R.style.AppThemeSolarized);
|
||||
case "solarized_dark":
|
||||
setTheme(R.style.AppThemeSolarizedDark);
|
||||
break;
|
||||
|
||||
// Black
|
||||
|
@ -246,6 +250,10 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|||
setTheme(night
|
||||
? R.style.AppThemeGreySteelBlueDark : R.style.AppThemeGreySteelBlueLight);
|
||||
break;
|
||||
case "solarized_system":
|
||||
setTheme(night
|
||||
? R.style.AppThemeSolarizedDark : R.style.AppThemeSolarizedLight);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
|
|
@ -24,7 +24,6 @@ import android.content.ContentResolver;
|
|||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.Spannable;
|
||||
|
@ -49,8 +48,6 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
@ -200,14 +197,7 @@ public class ActivityEML extends ActivityBase {
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(this)) {
|
||||
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));
|
||||
}
|
||||
|
||||
FragmentDialogTheme.setBackground(this, view, false);
|
||||
vSeparatorAttachments.setVisibility(View.GONE);
|
||||
grpReady.setVisibility(View.GONE);
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -61,7 +60,6 @@ public class FragmentAccounts extends FragmentBase {
|
|||
private boolean settings;
|
||||
|
||||
private boolean cards;
|
||||
private boolean beige;
|
||||
|
||||
private ViewGroup view;
|
||||
private SwipeRefreshLayout swipeRefresh;
|
||||
|
@ -86,7 +84,6 @@ public class FragmentAccounts extends FragmentBase {
|
|||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
cards = prefs.getBoolean("cards", true);
|
||||
beige = prefs.getBoolean("beige", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -213,11 +210,7 @@ public class FragmentAccounts extends FragmentBase {
|
|||
});
|
||||
|
||||
// Initialize
|
||||
|
||||
if (cards && !Helper.isDarkTheme(getContext()))
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
|
||||
if (settings) {
|
||||
fab.show();
|
||||
|
|
|
@ -33,7 +33,6 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -48,7 +47,6 @@ import java.util.List;
|
|||
|
||||
public class FragmentAnswers extends FragmentBase {
|
||||
private boolean cards;
|
||||
private boolean beige;
|
||||
|
||||
private RecyclerView rvAnswer;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
|
@ -64,7 +62,6 @@ public class FragmentAnswers extends FragmentBase {
|
|||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
cards = prefs.getBoolean("cards", true);
|
||||
beige = prefs.getBoolean("beige", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -106,12 +103,7 @@ public class FragmentAnswers extends FragmentBase {
|
|||
});
|
||||
|
||||
// Initialize
|
||||
|
||||
if (cards && !Helper.isDarkTheme(getContext()))
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
grpReady.setVisibility(View.GONE);
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
||||
|
|
|
@ -965,19 +965,9 @@ public class FragmentCompose extends FragmentBase {
|
|||
|
||||
// Initialize
|
||||
setHasOptionsMenu(true);
|
||||
FragmentDialogTheme.setBackground(getContext(), view, true);
|
||||
|
||||
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);
|
||||
if (keyboard_no_fullscreen) {
|
||||
// https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_FULLSCREEN
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package eu.faircode.email;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Paint;
|
||||
|
@ -15,6 +16,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.preference.PreferenceManager;
|
||||
|
||||
public class FragmentDialogTheme extends FragmentDialogBase {
|
||||
|
@ -28,19 +30,20 @@ public class FragmentDialogTheme extends FragmentDialogBase {
|
|||
private void eval() {
|
||||
int checkedId = rgTheme.getCheckedRadioButtonId();
|
||||
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.rbThemeRedGreen ||
|
||||
checkedId == R.id.rbThemeYellowPurple);
|
||||
int optionId = rgThemeOptions.getCheckedRadioButtonId();
|
||||
|
||||
swReverse.setEnabled(colored && !grey);
|
||||
swReverse.setEnabled(colored && !grey && !solarized);
|
||||
|
||||
rgThemeOptions.setEnabled(colored);
|
||||
for (int i = 0; i < rgThemeOptions.getChildCount(); i++)
|
||||
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);
|
||||
}
|
||||
|
@ -154,6 +157,9 @@ public class FragmentDialogTheme extends FragmentDialogBase {
|
|||
break;
|
||||
|
||||
case "solarized":
|
||||
case "solarized_light":
|
||||
case "solarized_dark":
|
||||
case "solarized_system":
|
||||
rgTheme.check(R.id.rbThemeSolarized);
|
||||
break;
|
||||
|
||||
|
@ -227,7 +233,11 @@ public class FragmentDialogTheme extends FragmentDialogBase {
|
|||
editor.putString("theme",
|
||||
"grey" + (dark ? "_dark" : "_light")).apply();
|
||||
} 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) {
|
||||
editor.putString("theme", "black").apply();
|
||||
} else if (checkedRadioButtonId == R.id.rbThemeBlackAndWhite) {
|
||||
|
@ -240,4 +250,23 @@ public class FragmentDialogTheme extends FragmentDialogBase {
|
|||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.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.constraintlayout.widget.Group;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -100,7 +99,6 @@ public class FragmentFolders extends FragmentBase {
|
|||
private FloatingActionButton fabError;
|
||||
|
||||
private boolean cards;
|
||||
private boolean beige;
|
||||
private boolean compact;
|
||||
|
||||
private long account;
|
||||
|
@ -131,7 +129,6 @@ public class FragmentFolders extends FragmentBase {
|
|||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
cards = prefs.getBoolean("cards", true);
|
||||
beige = prefs.getBoolean("beige", true);
|
||||
compact = prefs.getBoolean("compact_folders", false);
|
||||
show_hidden = false; // prefs.getBoolean("hidden_folders", false);
|
||||
show_flagged = prefs.getBoolean("flagged_folders", false);
|
||||
|
@ -271,12 +268,7 @@ public class FragmentFolders extends FragmentBase {
|
|||
});
|
||||
|
||||
// Initialize
|
||||
|
||||
if (cards && !Helper.isDarkTheme(getContext()))
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
grpReady.setVisibility(View.GONE);
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
fabAdd.hide();
|
||||
|
|
|
@ -31,7 +31,6 @@ import android.view.ViewGroup;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -46,7 +45,6 @@ import java.util.List;
|
|||
|
||||
public class FragmentIdentities extends FragmentBase {
|
||||
private boolean cards;
|
||||
private boolean beige;
|
||||
|
||||
private RecyclerView rvIdentity;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
|
@ -62,7 +60,6 @@ public class FragmentIdentities extends FragmentBase {
|
|||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
cards = prefs.getBoolean("cards", true);
|
||||
beige = prefs.getBoolean("beige", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -116,12 +113,7 @@ public class FragmentIdentities extends FragmentBase {
|
|||
});
|
||||
|
||||
// Initialize
|
||||
|
||||
if (cards && !Helper.isDarkTheme(getContext()))
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
grpReady.setVisibility(View.GONE);
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
||||
|
|
|
@ -98,7 +98,6 @@ 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.core.content.FileProvider;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.core.view.MenuItemCompat;
|
||||
|
@ -288,7 +287,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
private OpenPgpServiceConnection pgpService;
|
||||
|
||||
private boolean cards;
|
||||
private boolean beige;
|
||||
private boolean date;
|
||||
private boolean date_bold;
|
||||
private boolean threading;
|
||||
|
@ -407,7 +405,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
|
||||
swipenav = prefs.getBoolean("swipenav", true);
|
||||
cards = prefs.getBoolean("cards", true);
|
||||
beige = prefs.getBoolean("beige", true);
|
||||
date = prefs.getBoolean("date", true);
|
||||
date_bold = prefs.getBoolean("date_bold", false);
|
||||
threading = prefs.getBoolean("threading", true);
|
||||
|
@ -1146,12 +1143,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
addKeyPressedListener(onBackPressedListener);
|
||||
|
||||
// Initialize
|
||||
|
||||
if (cards && !Helper.isDarkTheme(getContext()))
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
tvNoEmail.setVisibility(View.GONE);
|
||||
tvNoEmailHint.setVisibility(View.GONE);
|
||||
sbThread.setVisibility(View.GONE);
|
||||
|
|
|
@ -48,7 +48,6 @@ 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;
|
||||
|
@ -409,12 +408,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
boolean beige = prefs.getBoolean("beige", true);
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
}
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ import androidx.annotation.Nullable;
|
|||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
|
@ -257,19 +256,13 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
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);
|
||||
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
tvNetworkMetered.setVisibility(View.GONE);
|
||||
tvNetworkRoaming.setVisibility(View.GONE);
|
||||
cardDebug.setVisibility(View.GONE);
|
||||
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@ 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.FragmentActivity;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -875,13 +874,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
boolean beige = prefs.getBoolean("beige", true);
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
}
|
||||
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
grpGravatars.setVisibility(BuildConfig.PLAY_STORE_RELEASE ? View.GONE : View.VISIBLE);
|
||||
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
|
||||
|
|
|
@ -48,7 +48,6 @@ 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;
|
||||
|
@ -339,12 +338,7 @@ public class FragmentOptionsEncryption extends FragmentBase implements SharedPre
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
boolean beige = prefs.getBoolean("beige", true);
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
}
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
|
||||
try {
|
||||
int maxKeySize = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");
|
||||
|
|
|
@ -55,7 +55,6 @@ import androidx.appcompat.app.AlertDialog;
|
|||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
@ -801,12 +800,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
boolean beige = prefs.getBoolean("beige", true);
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
}
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
|
||||
swPowerMenu.setVisibility(!BuildConfig.PLAY_STORE_RELEASE &&
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
|
||||
|
|
|
@ -47,7 +47,6 @@ 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;
|
||||
|
||||
|
@ -501,12 +500,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
boolean beige = prefs.getBoolean("beige", true);
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
}
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
|
||||
swNotifyTransliterate.setVisibility(TextHelper.canTransliterate() ? View.VISIBLE : View.GONE);
|
||||
swUnseenIgnored.setVisibility(Helper.isXiaomi() ? View.GONE : View.VISIBLE);
|
||||
|
|
|
@ -50,7 +50,6 @@ 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;
|
||||
|
@ -359,13 +358,7 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
boolean beige = prefs.getBoolean("beige", true);
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
}
|
||||
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
tvClientId.setText(getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME);
|
||||
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
|
||||
|
|
|
@ -42,7 +42,6 @@ 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;
|
||||
|
@ -444,12 +443,7 @@ public class FragmentOptionsSend extends FragmentBase implements SharedPreferenc
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
boolean beige = prefs.getBoolean("beige", true);
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
}
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
|
||||
String re1 = getString(R.string.title_subject_reply, "");
|
||||
String re2 = getString(R.string.title_subject_reply_alt, "");
|
||||
|
|
|
@ -43,7 +43,6 @@ 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;
|
||||
|
@ -368,12 +367,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
boolean beige = prefs.getBoolean("beige", true);
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
}
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
|
||||
DB db = DB.getInstance(getContext());
|
||||
db.account().liveSynchronizingAccounts().observe(getViewLifecycleOwner(), new Observer<List<EntityAccount>>() {
|
||||
|
|
|
@ -39,7 +39,6 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
@ -72,7 +71,6 @@ public class FragmentRules extends FragmentBase {
|
|||
private String type;
|
||||
|
||||
private boolean cards;
|
||||
private boolean beige;
|
||||
|
||||
private RecyclerView rvRule;
|
||||
private ContentLoadingProgressBar pbWait;
|
||||
|
@ -100,7 +98,6 @@ public class FragmentRules extends FragmentBase {
|
|||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
cards = prefs.getBoolean("cards", true);
|
||||
beige = prefs.getBoolean("beige", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -151,11 +148,7 @@ public class FragmentRules extends FragmentBase {
|
|||
|
||||
// Initialize
|
||||
|
||||
if (cards && !Helper.isDarkTheme(getContext()))
|
||||
view.setBackgroundColor(ContextCompat.getColor(getContext(), beige
|
||||
? R.color.lightColorBackground_cards_beige
|
||||
: R.color.lightColorBackground_cards));
|
||||
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
grpReady.setVisibility(View.GONE);
|
||||
pbWait.setVisibility(View.VISIBLE);
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ 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;
|
||||
|
@ -432,13 +431,7 @@ public class FragmentSetup extends FragmentBase {
|
|||
});
|
||||
|
||||
// Initialize
|
||||
if (!Helper.isDarkTheme(getContext())) {
|
||||
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));
|
||||
}
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
|
||||
tvNoInternet.setVisibility(View.GONE);
|
||||
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>
|
||||
|
||||
<!-- https://github.com/altercation/solarized -->
|
||||
<color name="solarizedPrimary">#073642</color>
|
||||
<color name="solarizedPrimaryDark">#002b36</color>
|
||||
<color name="solarizedAccent">#268bd2</color>
|
||||
<color name="darkSolarizedPrimary">#073642</color>
|
||||
<color name="darkSolarizedPrimaryDark">#002b36</color>
|
||||
<color name="darkSolarizedAccent">#268bd2</color>
|
||||
<color name="lightSolarizedPaper">#fdf6e3</color>
|
||||
|
||||
<!-- default: #323232 -->
|
||||
<color name="design_snackbar_background_color" tools:override="true">#222</color>
|
||||
|
|
|
@ -291,37 +291,37 @@
|
|||
|
||||
<style name="AppThemeBlueOrangeBlack" parent="AppThemeBlueOrangeDark">
|
||||
<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>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeOrangeBlueBlack" parent="AppThemeOrangeBlueDark">
|
||||
<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>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeYellowPurpleBlack" parent="AppThemeYellowPurpleDark">
|
||||
<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>
|
||||
</style>
|
||||
|
||||
<style name="AppThemePurpleYellowBlack" parent="AppThemePurpleYellowDark">
|
||||
<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>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeRedGreenBlack" parent="AppThemeRedGreenDark">
|
||||
<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>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeGreenRedBlack" parent="AppThemeGreenRedDark">
|
||||
<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>
|
||||
</style>
|
||||
|
||||
|
@ -336,7 +336,7 @@
|
|||
<item name="colorInfoForeground">@color/white</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>
|
||||
</style>
|
||||
|
||||
|
@ -393,27 +393,46 @@
|
|||
<item name="colorInfoForeground">@color/white</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>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeSolarized" parent="AppThemeBaseDark">
|
||||
<item name="themeName">black</item>
|
||||
<item name="colorPrimary">@color/solarizedPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/solarizedPrimaryDark</item>
|
||||
<item name="colorAccent">@color/solarizedAccent</item>
|
||||
<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/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="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="android:windowBackground">@drawable/black_background</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="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/darkSolarizedPrimaryDark</item>
|
||||
<item name="android:windowBackground">@drawable/background_black</item>
|
||||
<item name="colorDrawerBackground">@color/black</item>
|
||||
</style>
|
||||
|
||||
|
|
Loading…
Reference in New Issue