Search in sources :

Example 21 with DialogFragment

use of android.support.v4.app.DialogFragment in project SeriesGuide by UweTrottmann.

the class AddListDialogFragment method showAddListDialog.

/**
     * Display a dialog which allows to edit the title of this list or remove it.
     */
public static void showAddListDialog(FragmentManager fm) {
    // DialogFragment.show() will take care of adding the fragment
    // in a transaction. We also want to remove any currently showing
    // dialog, so make our own transaction and take care of that here.
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag("addlistdialog");
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);
    // Create and show the dialog.
    DialogFragment newFragment = AddListDialogFragment.newInstance();
    newFragment.show(ft, "addlistdialog");
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) AppCompatDialogFragment(android.support.v7.app.AppCompatDialogFragment) DialogFragment(android.support.v4.app.DialogFragment) Fragment(android.support.v4.app.Fragment)

Example 22 with DialogFragment

use of android.support.v4.app.DialogFragment in project material-dialogs by afollestad.

the class ColorChooserDialog method dismissIfNecessary.

private void dismissIfNecessary(AppCompatActivity context, String tag) {
    Fragment frag = context.getSupportFragmentManager().findFragmentByTag(tag);
    if (frag != null) {
        ((DialogFragment) frag).dismiss();
        context.getSupportFragmentManager().beginTransaction().remove(frag).commit();
    }
}
Also used : DialogFragment(android.support.v4.app.DialogFragment) DialogFragment(android.support.v4.app.DialogFragment) Fragment(android.support.v4.app.Fragment)

Example 23 with DialogFragment

use of android.support.v4.app.DialogFragment in project material-dialogs by afollestad.

the class FileChooserDialog method show.

public void show(FragmentActivity context) {
    final String tag = getBuilder().tag;
    Fragment frag = context.getSupportFragmentManager().findFragmentByTag(tag);
    if (frag != null) {
        ((DialogFragment) frag).dismiss();
        context.getSupportFragmentManager().beginTransaction().remove(frag).commit();
    }
    show(context.getSupportFragmentManager(), tag);
}
Also used : DialogFragment(android.support.v4.app.DialogFragment) DialogFragment(android.support.v4.app.DialogFragment) Fragment(android.support.v4.app.Fragment)

Example 24 with DialogFragment

use of android.support.v4.app.DialogFragment in project barcodescanner by dm77.

the class FullScannerActivity method showMessageDialog.

public void showMessageDialog(String message) {
    DialogFragment fragment = MessageDialogFragment.newInstance("Scan Results", message, this);
    fragment.show(getSupportFragmentManager(), "scan_results");
}
Also used : DialogFragment(android.support.v4.app.DialogFragment)

Example 25 with DialogFragment

use of android.support.v4.app.DialogFragment in project barcodescanner by dm77.

the class FullScannerActivity method closeDialog.

public void closeDialog(String dialogName) {
    FragmentManager fragmentManager = getSupportFragmentManager();
    DialogFragment fragment = (DialogFragment) fragmentManager.findFragmentByTag(dialogName);
    if (fragment != null) {
        fragment.dismiss();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) DialogFragment(android.support.v4.app.DialogFragment)

Aggregations

DialogFragment (android.support.v4.app.DialogFragment)85 Fragment (android.support.v4.app.Fragment)31 FragmentTransaction (android.support.v4.app.FragmentTransaction)24 Bundle (android.os.Bundle)10 FragmentManager (android.support.v4.app.FragmentManager)9 View (android.view.View)8 SherlockDialogFragment (com.actionbarsherlock.app.SherlockDialogFragment)8 TextView (android.widget.TextView)7 AlertDialog (android.app.AlertDialog)5 DialogInterface (android.content.DialogInterface)4 OnClickListener (android.content.DialogInterface.OnClickListener)4 Intent (android.content.Intent)4 ListFragment (android.support.v4.app.ListFragment)4 AppCompatDialogFragment (android.support.v7.app.AppCompatDialogFragment)4 OnClickListener (android.view.View.OnClickListener)4 Button (android.widget.Button)4 ItemPinnedMessageDialogFragment (com.h6ah4i.android.example.advrecyclerview.common.fragment.ItemPinnedMessageDialogFragment)4 ProgressDialogFragment (com.wada811.android.dialogfragments.material.ProgressDialogFragment)4 Dialog (android.app.Dialog)3 ProgressDialogFragment (com.wada811.android.dialogfragments.traditional.ProgressDialogFragment)3