@Test public void setCancellable_makesTheDialogNotCancellable() { activityScenario.onActivity(activity -> { ProgressDialogFragment fragment = new ProgressDialogFragment(); Bundle args = new Bundle(); args.putBoolean(ProgressDialogFragment.CANCELABLE, false); fragment.setArguments(args); fragment.show(activity.getSupportFragmentManager(), "TAG"); shadowOf(getMainLooper()).idle(); assertThat(shadowOf(fragment.getDialog()).isCancelable(), equalTo(false)); }); }
@Override public void show(FragmentManager manager, String tag) { try { manager .beginTransaction() .add(this, tag) .commit(); } catch (IllegalStateException e) { Timber.w(e); } }
ProgressDialogFragment extends DialogFragment { @Override public void show(FragmentManager manager, String tag) { try { manager .beginTransaction() .add(this, tag) .commit(); } catch (IllegalStateException e) { Timber.w(e); } } }
ProgressDialogFragment extends DialogFragment { @Override public void show(FragmentManager manager, String tag) { try { manager .beginTransaction() .add(this, tag) .commit(); } catch (IllegalStateException e) { Timber.w(e); } }  }
ProgressDialogFragment extends DialogFragment { @Override public void show(FragmentManager manager, String tag) { try { manager .beginTransaction() .add(this, tag) .commit(); } catch (IllegalStateException e) { Timber.w(e); } }  void setTitle(String title); void setMessage(String message); @Override void show(FragmentManager manager, String tag); @Override Dialog onCreateDialog(Bundle savedInstanceState); @Override void onCancel(@NonNull DialogInterface dialog); View getDialogView(); }
ProgressDialogFragment extends DialogFragment { @Override public void show(FragmentManager manager, String tag) { try { manager .beginTransaction() .add(this, tag) .commit(); } catch (IllegalStateException e) { Timber.w(e); } }  void setTitle(String title); void setMessage(String message); @Override void show(FragmentManager manager, String tag); @Override Dialog onCreateDialog(Bundle savedInstanceState); @Override void onCancel(@NonNull DialogInterface dialog); View getDialogView(); static final String COLLECT_PROGRESS_DIALOG_TAG; static final String TITLE; static final String MESSAGE; static final String CANCELABLE; }