use of android.app.DialogFragment in project AndroidChromium by JackyAndroid.
the class ConfirmSyncDataStateMachine method cancelDialog.
private static void cancelDialog(FragmentManager fragmentManager, String tag) {
Fragment fragment = fragmentManager.findFragmentByTag(tag);
if (fragment == null)
return;
DialogFragment dialogFragment = (DialogFragment) fragment;
if (dialogFragment.getDialog() == null)
return;
dialogFragment.getDialog().cancel();
}
use of android.app.DialogFragment in project AndroidChromium by JackyAndroid.
the class AccountManagementFragment method onSignOutClicked.
@Override
public void onSignOutClicked() {
// we do not hit a native crash.
if (!ChromeSigninController.get(getActivity()).isSignedIn())
return;
final Activity activity = getActivity();
final DialogFragment clearDataProgressDialog = new ClearDataProgressDialog();
SigninManager.get(activity).signOut(null, new SigninManager.WipeDataHooks() {
@Override
public void preWipeData() {
clearDataProgressDialog.show(activity.getFragmentManager(), CLEAR_DATA_PROGRESS_DIALOG_TAG);
}
@Override
public void postWipeData() {
if (clearDataProgressDialog.isAdded()) {
clearDataProgressDialog.dismissAllowingStateLoss();
}
}
});
AccountManagementScreenHelper.logEvent(ProfileAccountManagementMetrics.SIGNOUT_SIGNOUT, mGaiaServiceType);
}
use of android.app.DialogFragment in project AisenWeiBo by wangdan.
the class VersionDialogFragment method launch.
public static void launch(Activity context) {
Fragment fragment = context.getFragmentManager().findFragmentByTag("DialogFragment");
if (fragment != null) {
context.getFragmentManager().beginTransaction().remove(fragment).commit();
}
VersionDialogFragment dialogFragment = new VersionDialogFragment();
dialogFragment.show(context.getFragmentManager(), "DialogFragment");
}
use of android.app.DialogFragment in project WordPress-Android by wordpress-mobile.
the class WPMainActivity method showVisualEditorPromoDialogIfNeeded.
private void showVisualEditorPromoDialogIfNeeded() {
if (AppPrefs.isVisualEditorPromoRequired() && AppPrefs.isVisualEditorEnabled()) {
DialogFragment newFragment = PromoDialog.newInstance(R.drawable.new_editor_promo_header, R.string.new_editor_promo_title, R.string.new_editor_promo_desc, R.string.new_editor_promo_button_label);
newFragment.show(getFragmentManager(), "visual-editor-promo");
AppPrefs.setVisualEditorPromoRequired(false);
}
}
use of android.app.DialogFragment in project WordPress-Android by wordpress-mobile.
the class SiteSettingsFragment method showRelatedPostsDialog.
private void showRelatedPostsDialog() {
DialogFragment relatedPosts = new RelatedPostsDialog();
Bundle args = new Bundle();
args.putBoolean(RelatedPostsDialog.SHOW_RELATED_POSTS_KEY, mSiteSettings.getShowRelatedPosts());
args.putBoolean(RelatedPostsDialog.SHOW_HEADER_KEY, mSiteSettings.getShowRelatedPostHeader());
args.putBoolean(RelatedPostsDialog.SHOW_IMAGES_KEY, mSiteSettings.getShowRelatedPostImages());
relatedPosts.setArguments(args);
relatedPosts.setTargetFragment(this, RELATED_POSTS_REQUEST_CODE);
relatedPosts.show(getFragmentManager(), "related-posts");
}
Aggregations