Added sync/checks card

pull/200/head
M66B 3 years ago
parent 29d8c62f91
commit 21d60f706b

@ -71,6 +71,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
private TextView tvScheduleEnd; private TextView tvScheduleEnd;
private CheckBox[] cbDay; private CheckBox[] cbDay;
private ImageButton ibSchedules; private ImageButton ibSchedules;
private SwitchCompat swNodate; private SwitchCompat swNodate;
private SwitchCompat swUnseen; private SwitchCompat swUnseen;
private SwitchCompat swFlagged; private SwitchCompat swFlagged;
@ -80,13 +81,15 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
private SwitchCompat swSyncFolders; private SwitchCompat swSyncFolders;
private SwitchCompat swSyncSharedFolders; private SwitchCompat swSyncSharedFolders;
private SwitchCompat swSubscriptions; private SwitchCompat swSubscriptions;
private SwitchCompat swTuneKeepAlive;
private SwitchCompat swCheckAuthentication; private SwitchCompat swCheckAuthentication;
private SwitchCompat swCheckReply; private SwitchCompat swCheckReply;
private SwitchCompat swCheckMx; private SwitchCompat swCheckMx;
private SwitchCompat swCheckBlocklist; private SwitchCompat swCheckBlocklist;
private SwitchCompat swUseBlocklist; private SwitchCompat swUseBlocklist;
private RecyclerView rvBlocklist; private RecyclerView rvBlocklist;
private SwitchCompat swTuneKeepAlive;
private Group grpExempted; private Group grpExempted;
private AdapterAccountExempted adapter; private AdapterAccountExempted adapter;
@ -139,13 +142,15 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
swSyncFolders = view.findViewById(R.id.swSyncFolders); swSyncFolders = view.findViewById(R.id.swSyncFolders);
swSyncSharedFolders = view.findViewById(R.id.swSyncSharedFolders); swSyncSharedFolders = view.findViewById(R.id.swSyncSharedFolders);
swSubscriptions = view.findViewById(R.id.swSubscriptions); swSubscriptions = view.findViewById(R.id.swSubscriptions);
swTuneKeepAlive = view.findViewById(R.id.swTuneKeepAlive);
swCheckAuthentication = view.findViewById(R.id.swCheckAuthentication); swCheckAuthentication = view.findViewById(R.id.swCheckAuthentication);
swCheckReply = view.findViewById(R.id.swCheckReply); swCheckReply = view.findViewById(R.id.swCheckReply);
swCheckMx = view.findViewById(R.id.swCheckMx); swCheckMx = view.findViewById(R.id.swCheckMx);
swCheckBlocklist = view.findViewById(R.id.swCheckBlocklist); swCheckBlocklist = view.findViewById(R.id.swCheckBlocklist);
swUseBlocklist = view.findViewById(R.id.swUseBlocklist); swUseBlocklist = view.findViewById(R.id.swUseBlocklist);
rvBlocklist = view.findViewById(R.id.rvBlocklist); rvBlocklist = view.findViewById(R.id.rvBlocklist);
swTuneKeepAlive = view.findViewById(R.id.swTuneKeepAlive);
grpExempted = view.findViewById(R.id.grpExempted); grpExempted = view.findViewById(R.id.grpExempted);
setOptions(); setOptions();
@ -319,6 +324,13 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
} }
}); });
swTuneKeepAlive.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("tune_keep_alive", checked).apply();
}
});
swCheckAuthentication.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swCheckAuthentication.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean checked) { public void onCheckedChanged(CompoundButton buttonView, boolean checked) {
@ -360,13 +372,6 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
AdapterBlocklist badapter = new AdapterBlocklist(getContext(), DnsBlockList.getListsAvailable()); AdapterBlocklist badapter = new AdapterBlocklist(getContext(), DnsBlockList.getListsAvailable());
rvBlocklist.setAdapter(badapter); rvBlocklist.setAdapter(badapter);
swTuneKeepAlive.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("tune_keep_alive", checked).apply();
}
});
// Initialize // Initialize
FragmentDialogTheme.setBackground(getContext(), view, false); FragmentDialogTheme.setBackground(getContext(), view, false);
@ -453,13 +458,13 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
swSyncSharedFolders.setChecked(prefs.getBoolean("sync_shared_folders", false)); swSyncSharedFolders.setChecked(prefs.getBoolean("sync_shared_folders", false));
swSyncSharedFolders.setEnabled(swSyncFolders.isChecked()); swSyncSharedFolders.setEnabled(swSyncFolders.isChecked());
swSubscriptions.setChecked(prefs.getBoolean("subscriptions", false)); swSubscriptions.setChecked(prefs.getBoolean("subscriptions", false));
swTuneKeepAlive.setChecked(prefs.getBoolean("tune_keep_alive", true));
swCheckAuthentication.setChecked(prefs.getBoolean("check_authentication", true)); swCheckAuthentication.setChecked(prefs.getBoolean("check_authentication", true));
swCheckReply.setChecked(prefs.getBoolean("check_reply_domain", true)); swCheckReply.setChecked(prefs.getBoolean("check_reply_domain", true));
swCheckMx.setChecked(prefs.getBoolean("check_mx", false)); swCheckMx.setChecked(prefs.getBoolean("check_mx", false));
swCheckBlocklist.setChecked(prefs.getBoolean("check_blocklist", false)); swCheckBlocklist.setChecked(prefs.getBoolean("check_blocklist", false));
swUseBlocklist.setChecked(prefs.getBoolean("use_blocklist", false)); swUseBlocklist.setChecked(prefs.getBoolean("use_blocklist", false));
swUseBlocklist.setEnabled(swCheckBlocklist.isChecked()); swUseBlocklist.setEnabled(swCheckBlocklist.isChecked());
swTuneKeepAlive.setChecked(prefs.getBoolean("tune_keep_alive", true));
} }
private String formatHour(Context context, int minutes) { private String formatHour(Context context, int minutes) {

@ -1429,6 +1429,18 @@
app:layout_constraintTop_toBottomOf="@id/tvParseClassesHint" app:layout_constraintTop_toBottomOf="@id/tvParseClassesHint"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvAuthenticationHint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:text="@string/title_advanced_authentication_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/swAuthentication" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAuthenticationIndicator" android:id="@+id/swAuthenticationIndicator"
android:layout_width="0dp" android:layout_width="0dp"
@ -1441,7 +1453,7 @@
android:text="@string/title_advanced_authentication_indicator" android:text="@string/title_advanced_authentication_indicator"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAuthentication" app:layout_constraintTop_toBottomOf="@id/tvAuthenticationHint"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

@ -559,6 +559,50 @@
app:layout_constraintTop_toBottomOf="@id/swSyncSharedFolders" app:layout_constraintTop_toBottomOf="@id/swSyncSharedFolders"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swTuneKeepAlive"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_tune_keep_alive"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSubscriptions"
app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cardConversation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="3dp"
android:layout_marginTop="12dp"
app:cardBackgroundColor="?attr/colorCardBackground"
app:cardCornerRadius="6dp"
app:cardElevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cardAdvanced">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="6dp"
android:paddingVertical="12dp">
<eu.faircode.email.FixedTextView
android:id="@+id/tvCaptionChecks"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/title_advanced_caption_checks"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swCheckAuthentication" android:id="@+id/swCheckAuthentication"
android:layout_width="0dp" android:layout_width="0dp"
@ -568,7 +612,7 @@
android:text="@string/title_advanced_check_authentication" android:text="@string/title_advanced_check_authentication"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swSubscriptions" app:layout_constraintTop_toBottomOf="@id/tvCaptionChecks"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
@ -673,7 +717,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:text="@string/title_junk_blocklist" android:text="@string/title_advanced_use_blocklist"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvCheckBlocklistWarning" app:layout_constraintTop_toBottomOf="@id/tvCheckBlocklistWarning"
@ -689,18 +733,6 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swUseBlocklist" /> app:layout_constraintTop_toBottomOf="@id/swUseBlocklist" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swTuneKeepAlive"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_tune_keep_alive"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rvBlocklist"
app:switchPadding="12dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -322,6 +322,7 @@
<string name="title_advanced_check_reply_domain">Check reply address on synchronizing messages</string> <string name="title_advanced_check_reply_domain">Check reply address on synchronizing messages</string>
<string name="title_advanced_check_mx">Check sender email addresses on synchronizing messages</string> <string name="title_advanced_check_mx">Check sender email addresses on synchronizing messages</string>
<string name="title_advanced_check_blocklist">Check if the sender\'s domain name is on a spam block list</string> <string name="title_advanced_check_blocklist">Check if the sender\'s domain name is on a spam block list</string>
<string name="title_advanced_use_blocklist">Move messages from domains on a block list to the spam folder</string>
<string name="title_advanced_tune_keep_alive">Automatically tune the keep-alive interval</string> <string name="title_advanced_tune_keep_alive">Automatically tune the keep-alive interval</string>
<string name="title_advanced_keyboard">Show keyboard by default</string> <string name="title_advanced_keyboard">Show keyboard by default</string>
@ -372,6 +373,7 @@
<string name="title_advanced_manage_connectivity">Manage connectivity</string> <string name="title_advanced_manage_connectivity">Manage connectivity</string>
<string name="title_advanced_caption_general">General</string> <string name="title_advanced_caption_general">General</string>
<string name="title_advanced_caption_checks">Checks</string>
<string name="title_advanced_caption_list">List</string> <string name="title_advanced_caption_list">List</string>
<string name="title_advanced_caption_conversation">Conversation</string> <string name="title_advanced_caption_conversation">Conversation</string>
<string name="title_advanced_caption_message">Message</string> <string name="title_advanced_caption_message">Message</string>
@ -448,7 +450,8 @@
<string name="title_advanced_actionbar_color">Use account color as background color for conversation action bar</string> <string name="title_advanced_actionbar_color">Use account color as background color for conversation action bar</string>
<string name="title_advanced_navbar_colorize">Colorize the Android navigation bar</string> <string name="title_advanced_navbar_colorize">Colorize the Android navigation bar</string>
<string name="title_advanced_parse_classes">Parse style sheets</string> <string name="title_advanced_parse_classes">Parse style sheets</string>
<string name="title_advanced_authentication">Show a warning when the receiving server could not authenticate the message</string> <string name="title_advanced_authentication">Show authentication warnings</string>
<string name="title_advanced_authentication_hint">The underlying checks can be configured in the receive settings</string>
<string name="title_advanced_authentication_indicator">Show authentication status indicator</string> <string name="title_advanced_authentication_indicator">Show authentication status indicator</string>
<string name="title_advanced_sync_on_launch">Synchronize on start</string> <string name="title_advanced_sync_on_launch">Synchronize on start</string>

Loading…
Cancel
Save