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

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

Introduction

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

Prototype

public void setArguments(Bundle args) 

Source Link

Document

Supply the construction arguments for this fragment.

Usage

From source file:com.coinblesk.client.ui.dialogs.ProgressSuccessOrFailDialog.java

public static DialogFragment newInstance(String dialogTitle) {
    DialogFragment fragment = new ProgressSuccessOrFailDialog();
    Bundle args = new Bundle();
    args.putSerializable(ARG_STATE, State.PROGRESS);
    args.putString(ARG_TITLE, dialogTitle);
    fragment.setArguments(args);
    return fragment;
}

From source file:ua.com.spacetv.mycookbook.fragments.FragTopCategory.java

public static void showDialog(int idDialog, String nameForAction) {
    Bundle bundle = new Bundle();
    bundle.putInt(ID_DIALOG, idDialog);/*from w w w .  java2  s. c o m*/
    bundle.putString(NAME_FOR_ACTION, nameForAction);
    FragmentTransaction ft = mFrManager.beginTransaction();
    Fragment fragment = mFrManager.findFragmentByTag(TAG_DIALOG);
    if (fragment != null) {
        ft.remove(fragment);
    }
    ft.addToBackStack(null);

    DialogFragment dialogFragment = new FragDialog();
    dialogFragment.setArguments(bundle);
    dialogFragment.show(mFrManager, TAG_DIALOG);
    ft.commit();
}

From source file:com.ultramegasoft.flavordex2.dialog.AppImportDialog.java

/**
 * Show the dialog./*  ww  w.  j  a  v a  2s . c om*/
 *
 * @param fm  The FragmentManager to use
 * @param app The source app
 */
public static void showDialog(@NonNull FragmentManager fm, int app) {
    final DialogFragment fragment = new AppImportDialog();

    final Bundle args = new Bundle();
    args.putInt(ARG_APP, app);
    fragment.setArguments(args);

    fragment.show(fm, TAG);
}

From source file:de.schildbach.wallet.ui.backup.RestoreWalletFromExternalDialogFragment.java

public static void show(final FragmentManager fm, final Uri backupUri) {
    final DialogFragment newFragment = new RestoreWalletFromExternalDialogFragment();
    final Bundle args = new Bundle();
    args.putParcelable(KEY_BACKUP_URI, backupUri);
    newFragment.setArguments(args);
    newFragment.show(fm, FRAGMENT_TAG);/*from   w w w .j  a v  a 2  s  .  c  o  m*/
}

From source file:com.ultramegasoft.flavordex2.dialog.ConfirmationDialog.java

/**
 * Show a confirmation dialog./* w  w  w.  j a v a 2s  . c om*/
 *
 * @param fm          The FragmentManager to use
 * @param target      The Fragment to notify of the result
 * @param requestCode A number to identify this request
 * @param title       The dialog title
 * @param message     The dialog message
 * @param icon        Resource ID for the dialog icon
 * @param data        An Intent to store additional data
 */
public static void showDialog(@NonNull FragmentManager fm, @Nullable Fragment target, int requestCode,
        @Nullable String title, @Nullable String message, int icon, @Nullable Intent data) {
    final DialogFragment fragment = new ConfirmationDialog();
    fragment.setTargetFragment(target, requestCode);

    final Bundle args = new Bundle();
    args.putString(ARG_TITLE, title);
    args.putString(ARG_MESSAGE, message);
    args.putInt(ARG_ICON, icon);
    args.putParcelable(ARG_DATA, data);
    fragment.setArguments(args);

    fragment.show(fm, TAG);
}

From source file:ua.com.spacetv.mycookbook.fragments.FragSubCategory.java

public static void showDialog(int idDialog, String nameForAction) {
    Bundle bundle = new Bundle();
    bundle.putInt(ID_DIALOG, idDialog);/*from  ww  w.  j a v a 2  s .c o  m*/
    bundle.putString(NAME_FOR_ACTION, nameForAction);
    FragmentTransaction ft = mFrManager.beginTransaction();
    Fragment fragment = mFrManager.findFragmentByTag(TAG_DIALOG);
    if (fragment != null) {
        ft.remove(fragment);
    }
    ft.addToBackStack(null);

    DialogFragment dialogFragment = new FragDialog();
    dialogFragment.setArguments(bundle);
    dialogFragment.show(mFrManager, TAG_DIALOG);
}

From source file:com.ultramegasoft.flavordex2.dialog.CatDeleteDialog.java

/**
 * Show the confirmation dialog to delete a category.
 *
 * @param fm          The FragmentManager to use
 * @param target      The Fragment to send the result to
 * @param requestCode The code to identify the request
 * @param catId       The database ID for the category
 *//*from w  w  w.j  ava2  s. c  o  m*/
public static void showDialog(@NonNull FragmentManager fm, @Nullable Fragment target, int requestCode,
        long catId) {
    if (catId > 0) {
        final DialogFragment fragment = new CatDeleteDialog();
        fragment.setTargetFragment(target, requestCode);

        final Bundle args = new Bundle();
        args.putLong(ARG_CAT_ID, catId);
        fragment.setArguments(args);

        fragment.show(fm, TAG);
    }
}

From source file:de.schildbach.wallet.ui.ReportIssueDialogFragment.java

public static void show(final FragmentManager fm, final int titleResId, final int messageResId,
        final String subject, final String contextualData) {
    final DialogFragment newFragment = new ReportIssueDialogFragment();
    final Bundle args = new Bundle();
    args.putInt(KEY_TITLE, titleResId);//from w  ww  .  j av a  2  s.com
    args.putInt(KEY_MESSAGE, messageResId);
    args.putString(KEY_SUBJECT, subject);
    args.putString(KEY_CONTEXTUAL_DATA, contextualData);
    newFragment.setArguments(args);
    newFragment.show(fm, FRAGMENT_TAG);
}

From source file:com.ultramegasoft.flavordex2.dialog.AppChooserDialog.java

/**
 * Show the dialog.//from ww  w .jav  a  2s.  c om
 *
 * @param fm          The FragmentManager to use
 * @param multiChoice Whether to allow multiple selections
 */
public static void showDialog(@NonNull FragmentManager fm, boolean multiChoice) {
    final DialogFragment fragment = new AppChooserDialog();

    final Bundle args = new Bundle();
    args.putBoolean(ARG_MULTI_CHOICE, multiChoice);
    fragment.setArguments(args);

    fragment.show(fm, TAG);
}

From source file:com.vuze.android.remote.dialog.DialogFragmentFilterBy.java

public static void openFilterByDialog(Fragment fragment, SessionInfo sessionInfo, String id) {
    DialogFragment dlg = null;
    if (sessionInfo.getSupportsTags()) {
        List<Map<?, ?>> allTags = sessionInfo.getTags();

        if (allTags != null && allTags.size() > 0) {
            dlg = new DialogFragmentFilterByTags();
        }/*from  w  w  w  .ja  v  a2 s  .  co m*/
    }

    if (dlg == null) {
        dlg = new DialogFragmentFilterBy();
    }
    dlg.setTargetFragment(fragment, 0);
    Bundle bundle = new Bundle();
    bundle.putString(SessionInfoManager.BUNDLE_KEY, id);
    dlg.setArguments(bundle);
    AndroidUtils.showDialog(dlg, fragment.getFragmentManager(), "OpenFilterDialog");
}