Moved display settings

This commit is contained in:
M66B 2021-08-12 08:10:49 +02:00
parent bd88a12888
commit effa8809a9
3 changed files with 41 additions and 40 deletions

View File

@ -108,8 +108,8 @@ public class FragmentOptions extends FragmentBase {
"subscriptions",
"check_authentication", "check_reply_domain", "check_mx", "check_blocklist",
"send_pending",
"portrait2", "portrait2c", "landscape", "nav_count", "startup",
"cards", "beige", "tabular_card_bg", "shadow_unread",
"startup", "cards", "beige", "tabular_card_bg", "shadow_unread",
"portrait2", "portrait2c", "landscape", "nav_count", "navbar_colorize",
"indentation", "date", "date_bold", "threading", "threading_unread",
"highlight_unread", "highlight_color", "color_stripe",
"avatars", "bimi", "gravatars", "favicons", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
@ -121,7 +121,7 @@ public class FragmentOptions extends FragmentBase {
"contrast", "monospaced", "monospaced_pre",
"background_color", "text_color", "text_size", "text_font", "text_align", "text_separators",
"collapse_quotes", "image_placeholders", "inline_images",
"seekbar", "actionbar", "actionbar_color", "navbar_colorize",
"seekbar", "actionbar", "actionbar_color",
"autoscroll", "swipenav", "reversed", "swipe_close", "swipe_move", "autoexpand", "autoclose", "onclose",
"language_detection",
"quick_filter", "quick_scroll",

View File

@ -153,8 +153,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
private final static String[] RESET_OPTIONS = new String[]{
"theme", "startup", "cards", "beige", "tabular_card_bg", "shadow_unread",
"date", "date_bold", "navbar_colorize",
"portrait2", "portrait2c", "landscape", "nav_count",
"date", "date_bold",
"portrait2", "portrait2c", "landscape", "nav_count", "navbar_colorize",
"threading", "threading_unread", "indentation", "seekbar", "actionbar", "actionbar_color",
"highlight_unread", "highlight_color", "color_stripe",
"avatars", "bimi", "gravatars", "favicons", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
@ -188,11 +188,11 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swShadow = view.findViewById(R.id.swShadow);
swDate = view.findViewById(R.id.swDate);
swDateBold = view.findViewById(R.id.swDateBold);
swNavBarColorize = view.findViewById(R.id.swNavBarColorize);
swPortrait2 = view.findViewById(R.id.swPortrait2);
swPortrait2c = view.findViewById(R.id.swPortrait2c);
swLandscape = view.findViewById(R.id.swLandscape);
swNavMessageCount = view.findViewById(R.id.swNavMessageCount);
swNavBarColorize = view.findViewById(R.id.swNavBarColorize);
swThreading = view.findViewById(R.id.swThreading);
swThreadingUnread = view.findViewById(R.id.swThreadingUnread);
@ -343,15 +343,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swNavBarColorize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("navbar_colorize", checked).apply();
setNavigationBarColor(
checked ? Helper.resolveColor(getContext(), R.attr.colorPrimaryDark) : Color.BLACK);
}
});
swPortrait2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -384,6 +375,15 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
}
});
swNavBarColorize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("navbar_colorize", checked).apply();
setNavigationBarColor(
checked ? Helper.resolveColor(getContext(), R.attr.colorPrimaryDark) : Color.BLACK);
}
});
swThreading.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -1022,11 +1022,11 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
swDate.setChecked(prefs.getBoolean("date", true));
swDateBold.setChecked(prefs.getBoolean("date_bold", false));
swDateBold.setEnabled(swDate.isChecked());
swNavBarColorize.setChecked(prefs.getBoolean("navbar_colorize", false));
swPortrait2.setChecked(prefs.getBoolean("portrait2", false));
swPortrait2c.setChecked(prefs.getBoolean("portrait2c", false) && !swPortrait2.isChecked());
swLandscape.setChecked(prefs.getBoolean("landscape", true));
swNavMessageCount.setChecked(prefs.getBoolean("nav_count", false));
swNavBarColorize.setChecked(prefs.getBoolean("navbar_colorize", false));
swThreading.setChecked(prefs.getBoolean("threading", true));
swThreadingUnread.setChecked(prefs.getBoolean("threading_unread", false));

View File

@ -208,29 +208,6 @@
app:layout_constraintTop_toBottomOf="@id/tvDateHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swNavBarColorize"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_navbar_colorize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDateBold"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvNavBarColorizeHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_navbar_colorize_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swNavBarColorize" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvPortrait"
android:layout_width="0dp"
@ -242,7 +219,7 @@
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvNavBarColorizeHint" />
app:layout_constraintTop_toBottomOf="@id/swDateBold" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swPortrait2"
@ -343,6 +320,30 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvLandscapeHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swNavBarColorize"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_navbar_colorize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swNavMessageCount"
app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvNavBarColorizeHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_navbar_colorize_hint"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swNavBarColorize" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>