move 'show classic emails'-option from 'advanced' to 'chats and media'

This commit is contained in:
B. Petersen
2019-05-15 00:57:57 +02:00
parent 76cfe5f197
commit d1e902b1a3
4 changed files with 26 additions and 23 deletions
-11
View File
@@ -14,17 +14,6 @@
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider_explain_autocrypt"/>
<PreferenceCategory android:title="@string/pref_email_interaction_title">
<org.thoughtcrime.securesms.preferences.widgets.ListPreferenceWithSummary
android:key="pref_show_emails"
android:title="@string/pref_show_emails"
android:dependency="pref_show_emails"
android:entries="@array/pref_show_emails_entries"
android:entryValues="@array/pref_show_emails_values" />
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider" />
<PreferenceCategory android:title="@string/pref_imap_folder_handling">
+11
View File
@@ -24,6 +24,17 @@
android:title="@string/pref_enter_sends"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_email_interaction_title">
<org.thoughtcrime.securesms.preferences.widgets.ListPreferenceWithSummary
android:key="pref_show_emails"
android:title="@string/pref_show_emails"
android:dependency="pref_show_emails"
android:entries="@array/pref_show_emails_entries"
android:entryValues="@array/pref_show_emails_values" />
</PreferenceCategory>
<!--
<PreferenceCategory android:layout="@layout/preference_divider"/>
@@ -47,7 +47,6 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
CheckBoxPreference sentboxWatchCheckbox;
CheckBoxPreference mvboxWatchCheckbox;
CheckBoxPreference mvboxMoveCheckbox;
ListPreferenceWithSummary showEmails;
@Override
public void onCreate(Bundle paramBundle) {
@@ -84,13 +83,6 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
return true;
});
showEmails = (ListPreferenceWithSummary) this.findPreference("pref_show_emails");
showEmails.setOnPreferenceChangeListener((preference, newValue) -> {
updateListSummary(preference, newValue);
dcContext.setConfigInt("show_emails", Util.objectToInt(newValue));
return true;
});
this.findPreference("pref_compression")
.setOnPreferenceChangeListener(new ListSummaryListener());
@@ -146,10 +138,6 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
mvboxWatchCheckbox.setChecked(0!=dcContext.getConfigInt("mvbox_watch"));
mvboxMoveCheckbox.setChecked(0!=dcContext.getConfigInt("mvbox_move"));
String value = Integer.toString(dcContext.getConfigInt("show_emails"));
showEmails.setValue(value);
updateListSummary(showEmails, value);
initializeListSummary((ListPreferenceWithSummary) findPreference("pref_compression"));
}
@@ -19,13 +19,17 @@ import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.connect.ApplicationDcContext;
import org.thoughtcrime.securesms.connect.DcHelper;
import org.thoughtcrime.securesms.permissions.Permissions;
import org.thoughtcrime.securesms.preferences.widgets.ListPreferenceWithSummary;
import org.thoughtcrime.securesms.util.Prefs;
import org.thoughtcrime.securesms.util.Util;
public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment {
private static final String TAG = ChatsPreferenceFragment.class.getSimpleName();
private ApplicationDcContext dcContext;
ListPreferenceWithSummary showEmails;
// CheckBoxPreference trimEnabledCheckbox;
@Override
@@ -36,6 +40,13 @@ public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment {
findPreference(Prefs.MESSAGE_BODY_TEXT_SIZE_PREF)
.setOnPreferenceChangeListener(new ListSummaryListener());
showEmails = (ListPreferenceWithSummary) this.findPreference("pref_show_emails");
showEmails.setOnPreferenceChangeListener((preference, newValue) -> {
updateListSummary(preference, newValue);
dcContext.setConfigInt("show_emails", Util.objectToInt(newValue));
return true;
});
// trimEnabledCheckbox = (CheckBoxPreference) findPreference("pref_trim_threads");
// trimEnabledCheckbox.setOnPreferenceChangeListener(new TrimEnabledListener());
//
@@ -57,6 +68,10 @@ public class ChatsPreferenceFragment extends ListSummaryPreferenceFragment {
super.onResume();
((ApplicationPreferencesActivity)getActivity()).getSupportActionBar().setTitle(R.string.pref_chats_and_media);
String value = Integer.toString(dcContext.getConfigInt("show_emails"));
showEmails.setValue(value);
updateListSummary(showEmails, value);
// trimEnabledCheckbox.setChecked(0!=dcContext.getConfigInt("trim_enabled", DcContext.DC_PREF_DEFAULT_TRIM_ENABLED));
}