Example usage for android.support.v4.app DialogFragment show

List of usage examples for android.support.v4.app DialogFragment show

Introduction

In this page you can find the example usage for android.support.v4.app DialogFragment show.

Prototype

public int show(FragmentTransaction transaction, String tag) 

Source Link

Document

Display the dialog, adding the fragment using an existing transaction and then committing the transaction.

Usage

From source file:com.battlelancer.seriesguide.ui.dialogs.AddDialogFragment.java

/**
 * Display a dialog which asks if the user wants to add the given show to his show database. If
 * necessary an AsyncTask will be started which takes care of adding the show.
 *//*  w  w w.  j  a  va 2 s . c  o  m*/
public static void showAddDialog(SearchResult show, 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("dialog");
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);

    // Create and show the dialog.
    DialogFragment newFragment = AddDialogFragment.newInstance(show);
    newFragment.show(ft, "dialog");
}

From source file:com.battlelancer.seriesguide.ui.dialogs.AddListDialogFragment.java

/**
 * Display a dialog which allows to edit the title of this list or remove
 * it.//from w w w.  j a v  a  2s.  c o m
 */
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");
}

From source file:com.dm.material.dashboard.candybar.fragments.dialog.LanguagesFragment.java

public static void showLanguageChooser(@NonNull FragmentManager fm) {
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag(TAG);
    if (prev != null) {
        ft.remove(prev);// ww w .j a  va2  s  . co  m
    }

    try {
        DialogFragment dialog = LanguagesFragment.newInstance();
        dialog.show(ft, TAG);
    } catch (IllegalArgumentException | IllegalStateException ignored) {
    }
}

From source file:com.dm.wallpaper.board.fragments.dialogs.FilterFragment.java

public static void showFilterDialog(FragmentManager fm, boolean isMuzei) {
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag(TAG);
    if (prev != null) {
        ft.remove(prev);/*from   w w  w . j  av a  2 s.  co  m*/
    }

    try {
        DialogFragment dialog = FilterFragment.newInstance(isMuzei);
        dialog.show(ft, TAG);
    } catch (IllegalArgumentException | IllegalStateException ignored) {
    }
}

From source file:com.feathercoin.wallet.feathercoin.ui.EditAddressBookEntryFragment.java

public static void edit(final FragmentManager fm, final String address, final String suggestedAddressLabel) {
    final DialogFragment newFragment = EditAddressBookEntryFragment.instance(address, suggestedAddressLabel);
    newFragment.show(fm, FRAGMENT_TAG);
}

From source file:cc.mintcoin.wallet.ui.EditAddressBookEntryFragment.java

public static void edit(final FragmentManager fm, @Nonnull final String address,
        @Nullable final String suggestedAddressLabel) {
    final DialogFragment newFragment = EditAddressBookEntryFragment.instance(address, suggestedAddressLabel);
    newFragment.show(fm, FRAGMENT_TAG);
}

From source file:com.dm.wallpaper.board.fragments.dialogs.RefreshDurationFragment.java

public static void showRefreshDurationDialog(FragmentManager fm, int rotateTime, boolean isMinute) {
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag(TAG);
    if (prev != null) {
        ft.remove(prev);/*from  w ww  .  jav a 2  s  . co m*/
    }

    try {
        DialogFragment dialog = RefreshDurationFragment.newInstance(rotateTime, isMinute);
        dialog.show(ft, TAG);
    } catch (IllegalStateException | IllegalArgumentException ignored) {
    }
}

From source file:com.doctoror.fuckoffmusicplayer.presentation.library.DeleteItemDialogFragment.java

public static void show(@NonNull final Context context,
        @NonNull final Class<? extends DeleteItemDialogFragment> tClass,
        @NonNull final FragmentManager fragmentManager, @NonNull final String tag, final long targetId,
        @Nullable final String targetName) {
    final DialogFragment f = (DialogFragment) Fragment.instantiate(context, tClass.getCanonicalName(),
            createArguments(targetId, targetName));
    f.show(fragmentManager, tag);
}

From source file:com.dm.material.dashboard.candybar.fragments.dialog.AboutFragment.java

public static void showAbout(FragmentManager fm) {
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag(TAG);
    if (prev != null) {
        ft.remove(prev);/*  ww  w  .jav  a 2  s.  co  m*/
    }
    ft.addToBackStack(null);

    DialogFragment dialog = AboutFragment.newInstance();
    dialog.show(ft, TAG);
}

From source file:com.maxwen.wallpaper.board.fragments.dialogs.WallpaperApplyFragment.java

public static void showWallpaperApply(FragmentManager fm, final RectF rectF, final String url,
        final String name) {
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag(TAG);
    if (prev != null) {
        ft.remove(prev);/*w w w. j a  v  a 2 s. c  om*/
    }

    try {
        DialogFragment dialog = WallpaperApplyFragment.newInstance(rectF, url, name);
        dialog.show(ft, TAG);
    } catch (IllegalStateException | IllegalArgumentException ignored) {
    }
}