Search in sources :

Example 21 with DialogFragment

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();
}
Also used : DialogFragment(android.app.DialogFragment) Fragment(android.app.Fragment) DialogFragment(android.app.DialogFragment)

Example 22 with DialogFragment

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);
}
Also used : DialogFragment(android.app.DialogFragment) Activity(android.app.Activity)

Example 23 with DialogFragment

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");
}
Also used : Fragment(android.app.Fragment) DialogFragment(android.app.DialogFragment)

Example 24 with 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);
    }
}
Also used : DialogFragment(android.app.DialogFragment)

Example 25 with DialogFragment

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");
}
Also used : Bundle(android.os.Bundle) DialogFragment(android.app.DialogFragment)

Aggregations

DialogFragment (android.app.DialogFragment)45 Fragment (android.app.Fragment)10 FragmentManager (android.app.FragmentManager)7 FragmentTransaction (android.app.FragmentTransaction)7 ConfirmationDialogFragment (com.fsck.k9.fragment.ConfirmationDialogFragment)3 Intent (android.content.Intent)2 Bundle (android.os.Bundle)2 View (android.view.View)2 TextView (android.widget.TextView)2 GPSAlertDialogFragment (com.agup.gps.fragments.GPSAlertDialogFragment)2 NetworkAlertDialogFragment (com.agup.gps.fragments.NetworkAlertDialogFragment)2 BackupAccountsDialogFragment (com.decad3nce.aegis.Fragments.BackupAccountsDialogFragment)2 ProgressDialogFragment (com.fsck.k9.fragment.ProgressDialogFragment)2 BaseFragment (it.gmariotti.cardslib.demo.fragment.BaseFragment)2 Activity (android.app.Activity)1 DevicePolicyManager (android.app.admin.DevicePolicyManager)1 BroadcastReceiver (android.content.BroadcastReceiver)1 ComponentName (android.content.ComponentName)1 Context (android.content.Context)1 IntentFilter (android.content.IntentFilter)1