use of com.moez.QKSMS.ui.messagelist.MessageListActivity in project qksms by moezbhatti.
the class ConversationSettingsDialog method onPreferenceClick.
public boolean onPreferenceClick(Preference preference) {
switch(preference.getKey()) {
case SettingsFragment.THEME:
ThemeManager.showColorPickerDialogForConversation(mContext, mConversationPrefs);
break;
case SettingsFragment.NOTIFICATION_LED_COLOR:
ColorPickerDialog ledColorPickerDialog = new ColorPickerDialog();
ledColorPickerDialog.initialize(R.string.pref_theme_led, mLedColors, Integer.parseInt(mConversationPrefs.getNotificationLedColor()), 3, 2);
ledColorPickerDialog.setOnColorSelectedListener(color -> mConversationPrefs.putString(SettingsFragment.NOTIFICATION_LED_COLOR, "" + color));
ledColorPickerDialog.show(getActivity().getFragmentManager(), "colorpicker");
break;
case SettingsFragment.NOTIFICATION_TONE:
Intent intent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI, getRingtoneUri());
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_DEFAULT_URI, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION);
intent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, getString(R.string.pref_ringtone));
intent.putExtra(ARG_THREAD_ID, mThreadId);
((MessageListActivity) getActivity()).getResultForThreadId(mThreadId);
getActivity().startActivityForResult(intent, RINGTONE_REQUEST_CODE);
break;
}
return true;
}
use of com.moez.QKSMS.ui.messagelist.MessageListActivity in project qksms by moezbhatti.
the class DialogHelper method showDeleteConversationsDialog.
public static void showDeleteConversationsDialog(final QKActivity context, final Set<Long> threadIds) {
new DefaultSmsHelper(context, R.string.not_default_delete).showIfNotDefault(null);
// Make a copy so the list isn't reset when multi-select is disabled
Set<Long> threads = new HashSet<>(threadIds);
new QKDialog().setContext(context).setTitle(R.string.delete_conversation).setMessage(context.getString(R.string.delete_confirmation, threads.size())).setPositiveButton(R.string.yes, v -> {
Log.d(TAG, "Deleting threads: " + Arrays.toString(threads.toArray()));
Conversation.ConversationQueryHandler handler = new Conversation.ConversationQueryHandler(context.getContentResolver(), context);
Conversation.startDelete(handler, 0, false, threads);
Conversation.asyncDeleteObsoleteThreads(handler, 0);
if (context instanceof MessageListActivity) {
context.onBackPressed();
}
}).setNegativeButton(R.string.cancel, null).show();
}
Aggregations