From ec35e2a1a70217993f3b033e911a1396be796edf Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 27 Jun 2021 09:31:20 +0200 Subject: [PATCH] Indent related options --- .../java/eu/faircode/email/FragmentOptionsBehavior.java | 4 ++++ .../java/eu/faircode/email/FragmentOptionsDisplay.java | 2 +- app/src/main/res/layout/fragment_options_behavior.xml | 4 ++++ app/src/main/res/layout/fragment_options_display.xml | 8 ++++++++ app/src/main/res/layout/fragment_options_encryption.xml | 1 + app/src/main/res/layout/fragment_options_misc.xml | 1 + app/src/main/res/layout/fragment_options_privacy.xml | 1 + app/src/main/res/layout/fragment_options_synchronize.xml | 1 + 8 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java index b312563119..3879c1eb97 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsBehavior.java @@ -79,6 +79,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe private SwitchCompat swExpandOne; private SwitchCompat swAutoClose; private TextView tvAutoSeenHint; + private TextView tvOnClose; private Spinner spOnClose; private Spinner spUndoTimeout; private SwitchCompat swCollapseMultiple; @@ -132,6 +133,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe swCollapseMultiple = view.findViewById(R.id.swCollapseMultiple); tvAutoSeenHint = view.findViewById(R.id.tvAutoSeenHint); swAutoClose = view.findViewById(R.id.swAutoClose); + tvOnClose = view.findViewById(R.id.tvOnClose); spOnClose = view.findViewById(R.id.spOnClose); spUndoTimeout = view.findViewById(R.id.spUndoTimeout); swAutoRead = view.findViewById(R.id.swAutoRead); @@ -337,6 +339,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { prefs.edit().putBoolean("autoclose", checked).apply(); + tvOnClose.setEnabled(!checked); spOnClose.setEnabled(!checked); } }); @@ -490,6 +493,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe break; } + tvOnClose.setEnabled(!swAutoClose.isChecked()); spOnClose.setEnabled(!swAutoClose.isChecked()); int undo_timeout = prefs.getInt("undo_timeout", 5000); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index 14603944e0..8a587b2ba2 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -962,7 +962,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swThreadingUnread.setChecked(prefs.getBoolean("threading_unread", false)); swThreadingUnread.setEnabled(swThreading.isChecked()); swIndentation.setChecked(prefs.getBoolean("indentation", false)); - swIndentation.setEnabled(swCards.isChecked()); + swIndentation.setEnabled(swCards.isChecked() && swThreading.isChecked()); swSeekbar.setChecked(prefs.getBoolean("seekbar", false)); swActionbar.setChecked(prefs.getBoolean("actionbar", true)); swActionbarColor.setChecked(prefs.getBoolean("actionbar_color", false)); diff --git a/app/src/main/res/layout/fragment_options_behavior.xml b/app/src/main/res/layout/fragment_options_behavior.xml index abc4428843..8e6cbd8dea 100644 --- a/app/src/main/res/layout/fragment_options_behavior.xml +++ b/app/src/main/res/layout/fragment_options_behavior.xml @@ -102,6 +102,7 @@ android:id="@+id/swConversationActionsReplies" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:checked="true" android:text="@string/title_advanced_conversation_actions_replies" @@ -397,6 +398,7 @@ android:id="@+id/swExpandFirst" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:checked="true" android:text="@string/title_advanced_expand_first" @@ -420,6 +422,7 @@ android:id="@+id/swExpandOne" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_expand_one" app:layout_constraintEnd_toEndOf="parent" @@ -431,6 +434,7 @@ android:id="@+id/swCollapseMultiple" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_collapse_multiple" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml index 9ee209031b..19b19bdff2 100644 --- a/app/src/main/res/layout/fragment_options_display.xml +++ b/app/src/main/res/layout/fragment_options_display.xml @@ -198,6 +198,7 @@ android:id="@+id/swDateBold" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_date_bold" app:layout_constraintEnd_toEndOf="parent" @@ -347,6 +348,7 @@ android:id="@+id/swThreadingUnread" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_threading_unread" app:layout_constraintEnd_toEndOf="parent" @@ -358,6 +360,7 @@ android:id="@+id/swIndentation" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:checked="true" android:text="@string/title_advanced_indentation" @@ -393,6 +396,7 @@ android:id="@+id/swActionbarColor" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_actionbar_color" app:layout_constraintEnd_toEndOf="parent" @@ -543,6 +547,7 @@ android:id="@+id/swIdenticons" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_identicons" app:layout_constraintEnd_toEndOf="parent" @@ -923,6 +928,7 @@ android:id="@+id/swPreviewItalic" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:checked="true" android:text="@string/title_advanced_preview_italic" @@ -935,6 +941,7 @@ android:id="@+id/tvPreviewLines" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_preview_lines" android:textAppearance="@style/TextAppearance.AppCompat.Small" @@ -947,6 +954,7 @@ android:id="@+id/spPreviewLines" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:entries="@array/linesNames" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/layout/fragment_options_encryption.xml b/app/src/main/res/layout/fragment_options_encryption.xml index 9b9d54ff92..95c5e8363f 100644 --- a/app/src/main/res/layout/fragment_options_encryption.xml +++ b/app/src/main/res/layout/fragment_options_encryption.xml @@ -211,6 +211,7 @@ android:id="@+id/swAutocryptMutual" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:checked="true" android:text="@string/title_advanced_autocrypt_mutual" diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index d42a611ff9..eeea2b0030 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -312,6 +312,7 @@ android:id="@+id/swWeekly" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_check_weekly" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/fragment_options_privacy.xml b/app/src/main/res/layout/fragment_options_privacy.xml index 5509ef68ad..f84a528415 100644 --- a/app/src/main/res/layout/fragment_options_privacy.xml +++ b/app/src/main/res/layout/fragment_options_privacy.xml @@ -92,6 +92,7 @@ android:id="@+id/swBrowseLinks" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_browse_links" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/fragment_options_synchronize.xml b/app/src/main/res/layout/fragment_options_synchronize.xml index 4b9373fcfe..3facf94ea1 100644 --- a/app/src/main/res/layout/fragment_options_synchronize.xml +++ b/app/src/main/res/layout/fragment_options_synchronize.xml @@ -540,6 +540,7 @@ android:id="@+id/swSyncSharedFolders" android:layout_width="0dp" android:layout_height="wrap_content" + android:layout_marginStart="12dp" android:layout_marginTop="12dp" android:text="@string/title_advanced_sync_shared_folders" app:layout_constraintEnd_toEndOf="parent"