Search in sources :

Example 1 with DialogFragment

use of android.app.DialogFragment in project k-9 by k9mail.

the class MessageListFragment method showDialog.

private void showDialog(int dialogId) {
    DialogFragment fragment;
    switch(dialogId) {
        case R.id.dialog_confirm_spam:
            {
                String title = getString(R.string.dialog_confirm_spam_title);
                int selectionSize = activeMessages.size();
                String message = getResources().getQuantityString(R.plurals.dialog_confirm_spam_message, selectionSize, selectionSize);
                String confirmText = getString(R.string.dialog_confirm_spam_confirm_button);
                String cancelText = getString(R.string.dialog_confirm_spam_cancel_button);
                fragment = ConfirmationDialogFragment.newInstance(dialogId, title, message, confirmText, cancelText);
                break;
            }
        case R.id.dialog_confirm_delete:
            {
                String title = getString(R.string.dialog_confirm_delete_title);
                int selectionSize = activeMessages.size();
                String message = getResources().getQuantityString(R.plurals.dialog_confirm_delete_messages, selectionSize, selectionSize);
                String confirmText = getString(R.string.dialog_confirm_delete_confirm_button);
                String cancelText = getString(R.string.dialog_confirm_delete_cancel_button);
                fragment = ConfirmationDialogFragment.newInstance(dialogId, title, message, confirmText, cancelText);
                break;
            }
        case R.id.dialog_confirm_mark_all_as_read:
            {
                String title = getString(R.string.dialog_confirm_mark_all_as_read_title);
                String message = getString(R.string.dialog_confirm_mark_all_as_read_message);
                String confirmText = getString(R.string.dialog_confirm_mark_all_as_read_confirm_button);
                String cancelText = getString(R.string.dialog_confirm_mark_all_as_read_cancel_button);
                fragment = ConfirmationDialogFragment.newInstance(dialogId, title, message, confirmText, cancelText);
                break;
            }
        default:
            {
                throw new RuntimeException("Called showDialog(int) with unknown dialog id.");
            }
    }
    fragment.setTargetFragment(this, dialogId);
    fragment.show(getFragmentManager(), getDialogTag(dialogId));
}
Also used : DialogFragment(android.app.DialogFragment)

Example 2 with DialogFragment

use of android.app.DialogFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class InputMethodsSettings method showDialogInner.

private void showDialogInner(int id) {
    DialogFragment newFragment = MyAlertDialogFragment.newInstance(id);
    newFragment.setTargetFragment(this, 0);
    newFragment.show(getFragmentManager(), "dialog " + id);
}
Also used : DialogFragment(android.app.DialogFragment)

Example 3 with DialogFragment

use of android.app.DialogFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ActionListViewSettings method showDialogInner.

private void showDialogInner(int id, int which, boolean longpress, boolean newAction) {
    DialogFragment newFragment = MyAlertDialogFragment.newInstance(id, which, longpress, newAction);
    newFragment.setTargetFragment(this, 0);
    newFragment.show(getFragmentManager(), "dialog " + id);
}
Also used : DialogFragment(android.app.DialogFragment)

Example 4 with DialogFragment

use of android.app.DialogFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class PieColor method showDialogInner.

private void showDialogInner(int id) {
    DialogFragment newFragment = MyAlertDialogFragment.newInstance(id);
    newFragment.setTargetFragment(this, 0);
    newFragment.show(getFragmentManager(), "dialog " + id);
}
Also used : DialogFragment(android.app.DialogFragment)

Example 5 with DialogFragment

use of android.app.DialogFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class BlurPersonalizations method showDialogInner.

private void showDialogInner(int id) {
    DialogFragment newFragment = MyAlertDialogFragment.newInstance(id);
    newFragment.setTargetFragment(this, 0);
    newFragment.show(getFragmentManager(), "dialog " + id);
}
Also used : DialogFragment(android.app.DialogFragment)

Aggregations

DialogFragment (android.app.DialogFragment)110 InstrumentedDialogFragment (com.android.settings.core.instrumentation.InstrumentedDialogFragment)30 Activity (android.app.Activity)13 Fragment (android.app.Fragment)13 FragmentManager (android.app.FragmentManager)8 FragmentTransaction (android.app.FragmentTransaction)7 SupportDisclaimerDialogFragment (com.android.settings.support.SupportDisclaimerDialogFragment)7 SupportPhoneDialogFragment (com.android.settings.support.SupportPhoneDialogFragment)7 SelectPhoneAccountDialogFragment (com.android.contacts.common.widget.SelectPhoneAccountDialogFragment)6 CustomDialogPreference (com.android.settingslib.CustomDialogPreference)6 CustomEditTextPreference (com.android.settingslib.CustomEditTextPreference)6 PhoneAccountHandle (android.telecom.PhoneAccountHandle)5 Bundle (android.os.Bundle)4 SelectPhoneAccountListener (com.android.contacts.common.widget.SelectPhoneAccountDialogFragment.SelectPhoneAccountListener)4 Context (android.content.Context)3 Intent (android.content.Intent)3 AlertDialog (android.app.AlertDialog)2 KeyguardManager (android.app.KeyguardManager)2 ProgressDialog (android.app.ProgressDialog)2 Point (android.graphics.Point)2