Refactoring

This commit is contained in:
M66B 2021-02-16 21:25:46 +01:00
parent 1d44cd05b4
commit 75d6925523
1 changed files with 4 additions and 5 deletions

View File

@ -237,6 +237,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean date; private boolean date;
private boolean cards; private boolean cards;
private boolean shadow;
private boolean threading; private boolean threading;
private boolean threading_unread; private boolean threading_unread;
private boolean indentation; private boolean indentation;
@ -268,7 +269,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean collapse_quotes; private boolean collapse_quotes;
private boolean authentication; private boolean authentication;
private boolean language_detection; private boolean language_detection;
private boolean experiments;
private List<String> languages; private List<String> languages;
private static boolean debug; private static boolean debug;
@ -513,7 +513,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ViewHolder(final View itemView, long viewType) { ViewHolder(final View itemView, long viewType) {
super(itemView); super(itemView);
if (experiments && cards) { if (cards && shadow) {
ViewGroup.MarginLayoutParams lparam = (ViewGroup.MarginLayoutParams) itemView.getLayoutParams(); ViewGroup.MarginLayoutParams lparam = (ViewGroup.MarginLayoutParams) itemView.getLayoutParams();
lparam.bottomMargin = dp1; lparam.bottomMargin = dp1;
itemView.setLayoutParams(lparam); itemView.setLayoutParams(lparam);
@ -1402,7 +1402,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} }
private void bindSeen(TupleMessageEx message) { private void bindSeen(TupleMessageEx message) {
if (experiments && cards) if (cards && shadow)
itemView.setBackground(message.unseen > 0 ? drawableSeparator : null); itemView.setBackground(message.unseen > 0 ? drawableSeparator : null);
if (textSize != 0) { if (textSize != 0) {
@ -5347,6 +5347,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.date = prefs.getBoolean("date", true); this.date = prefs.getBoolean("date", true);
this.cards = prefs.getBoolean("cards", true); this.cards = prefs.getBoolean("cards", true);
this.shadow = prefs.getBoolean("experiments", false);
this.threading = prefs.getBoolean("threading", true); this.threading = prefs.getBoolean("threading", true);
this.threading_unread = threading && prefs.getBoolean("threading_unread", false); this.threading_unread = threading && prefs.getBoolean("threading_unread", false);
this.indentation = prefs.getBoolean("indentation", false); this.indentation = prefs.getBoolean("indentation", false);
@ -5387,8 +5388,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.authentication = prefs.getBoolean("authentication", true); this.authentication = prefs.getBoolean("authentication", true);
this.language_detection = prefs.getBoolean("language_detection", false); this.language_detection = prefs.getBoolean("language_detection", false);
this.experiments = prefs.getBoolean("experiments", false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
languages = new ArrayList<>(); languages = new ArrayList<>();
LocaleList ll = context.getResources().getConfiguration().getLocales(); LocaleList ll = context.getResources().getConfiguration().getLocales();