add options to watch inbox and sentbox

This commit is contained in:
B. Petersen
2018-12-21 00:34:45 +01:00
parent f01b67c07b
commit 13765df3ee
2 changed files with 46 additions and 8 deletions
+24 -8
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:key="media_download" android:title="@string/autocrypt">
<PreferenceCategory android:title="@string/autocrypt">
<Preference android:key="pref_send_autocrypt_setup_message"
android:title="@string/autocrypt_send_asm_title"/>
@@ -12,16 +12,20 @@
android:title="@string/autocrypt_prefer_e2ee"/>
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider_explain_autocrypt"/>
<PreferenceCategory android:key="media_download" android:title="@string/pref_other">
<Preference android:key="pref_backup"
android:title="@string/pref_backup"
android:summary="@string/pref_backup_explain"/>
<Preference android:key="pref_manage_keys"
android:title="@string/pref_manage_keys"/>
<PreferenceCategory android:title="Folder"> <!-- TRANSLATION_NEEDED -->
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="true"
android:key="pref_inbox_watch"
android:title="Watch Inbox folder"/> <!-- TRANSLATION_NEEDED -->
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="true"
android:key="pref_sentbox_watch"
android:title="Watch Sent folder"/> <!-- TRANSLATION_NEEDED -->
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="true"
@@ -34,6 +38,18 @@
android:summary="Currently, just all chat messages are moved, the heuristic part is under construction"
android:title="Heuristic moves to DeltaChat folder"/> <!-- TRANSLATION_NEEDED -->
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider" />
<PreferenceCategory android:title="@string/pref_other">
<Preference android:key="pref_backup"
android:title="@string/pref_backup"
android:summary="@string/pref_backup_explain"/>
<Preference android:key="pref_manage_keys"
android:title="@string/pref_manage_keys"/>
<Preference android:key="pref_view_log"
android:title="@string/pref_view_log"/>
</PreferenceCategory>
@@ -42,6 +42,8 @@ public class AdvancedPreferenceFragment extends CorrectedPreferenceFragment
private ApplicationDcContext dcContext;
CheckBoxPreference preferE2eeCheckbox;
CheckBoxPreference inboxWatchCheckbox;
CheckBoxPreference sentboxWatchCheckbox;
CheckBoxPreference mvboxWatchCheckbox;
CheckBoxPreference mvboxMoveCheckbox;
@@ -58,6 +60,24 @@ public class AdvancedPreferenceFragment extends CorrectedPreferenceFragment
preferE2eeCheckbox = (CheckBoxPreference) this.findPreference("pref_prefer_e2ee");
preferE2eeCheckbox.setOnPreferenceChangeListener(new PreferE2eeListener());
inboxWatchCheckbox = (CheckBoxPreference) this.findPreference("pref_inbox_watch");
inboxWatchCheckbox.setOnPreferenceChangeListener((preference, newValue) -> {
// boolean enabled = (Boolean) newValue;
// dcContext.setConfigInt("inbox_watch", enabled? 1 : 0);
// return true;
Toast.makeText(getActivity(), "Not yet implemented.", Toast.LENGTH_LONG).show();
return false;
});
sentboxWatchCheckbox = (CheckBoxPreference) this.findPreference("pref_sentbox_watch");
sentboxWatchCheckbox.setOnPreferenceChangeListener((preference, newValue) -> {
// boolean enabled = (Boolean) newValue;
// dcContext.setConfigInt("sentbox_watch", enabled? 1 : 0);
// return true;
Toast.makeText(getActivity(), "Not yet implemented.", Toast.LENGTH_LONG).show();
return false;
});
mvboxWatchCheckbox = (CheckBoxPreference) this.findPreference("pref_mvbox_watch");
mvboxWatchCheckbox.setOnPreferenceChangeListener((preference, newValue) -> {
boolean enabled = (Boolean) newValue;
@@ -99,6 +119,8 @@ public class AdvancedPreferenceFragment extends CorrectedPreferenceFragment
((ApplicationPreferencesActivity) getActivity()).getSupportActionBar().setTitle(R.string.menu_advanced);
preferE2eeCheckbox.setChecked(0!=dcContext.getConfigInt("e2ee_enabled", DcContext.DC_PREF_DEFAULT_E2EE_ENABLED));
inboxWatchCheckbox.setChecked(0!=dcContext.getConfigInt("inbox_watch", 1));
sentboxWatchCheckbox.setChecked(0!=dcContext.getConfigInt("sentbox_watch", 1));
mvboxWatchCheckbox.setChecked(0!=dcContext.getConfigInt("mvbox_watch", 1));
mvboxMoveCheckbox.setChecked(0!=dcContext.getConfigInt("mvbox_move", 1));
}