Added confirmation for delete old messages feature

This commit is contained in:
Moez Bhatti
2016-07-10 20:59:04 -10:00
parent bf8f5590a9
commit f1788610a3
2 changed files with 14 additions and 2 deletions
@@ -459,9 +459,20 @@ public class SettingsFragment extends PreferenceFragment implements Preference.O
break;
case DELETE_OLD_MESSAGES:
DeleteOldMessagesService.setupAutoDeleteAlarm(mContext);
if ((Boolean) newValue) {
mContext.makeToast(R.string.toast_deleting_old_messages);
new QKDialog()
.setContext(mContext)
.setTitle(R.string.pref_delete_old_messages)
.setMessage(R.string.dialog_delete_old_messages)
.setPositiveButton(R.string.yes, v -> {
QKPreferences.setBoolean(QKPreference.AUTO_DELETE, true);
((CheckBoxPreference) preference).setChecked(true);
DeleteOldMessagesService.setupAutoDeleteAlarm(mContext);
mContext.makeToast(R.string.toast_deleting_old_messages);
})
.setNegativeButton(R.string.cancel, null)
.show();
return false;
}
break;
+1
View File
@@ -597,6 +597,7 @@
<string name="dialog_conversation_details_recipients">Recipients (%s)</string>
<string name="dialog_should_i_answer_title">Should I Answer? not installed</string>
<string name="dialog_should_i_answer_message">Would you like to download the app from Google Play now?</string>
<string name="dialog_delete_old_messages">Are you sure you want to automatically delete old messages?</string>
<!-- Title for audio file picker -->
<string name="select_audio">Choose audio</string>