Search in sources :

Example 41 with DialogFragment

use of android.app.DialogFragment in project Fairphone by Kwamecorp.

the class LauncherTransitionable method setupBroadcastReceivers.

private void setupBroadcastReceivers() {
    // launching the application
    mBCastAppSwitcherAllApps = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            FlurryAgent.logEvent(FlurryHelper.YOUR_APPS_LAUNCH_ALL_APPS);
            Log.i(TAG, "Received a call from widget....Show all apps");
            showAllApps(true);
        }
    };
    mBCastAppSwitcherReset = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            Log.i(TAG, "Received a call from widget....Reset");
            DialogFragment newFragment = new ResetDialogFragment();
            newFragment.show(getFragmentManager(), "reset");
        }
    };
    mBCastAppSwitcherLauncher = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            String packageName = intent.getStringExtra(Launcher.APP_PACKAGE);
            String className = intent.getStringExtra(Launcher.APP_CLASS_NAME);
            Log.i(TAG, "Received a call from widget....Launch App " + packageName + " - " + className);
            Intent launchIntent = getPackageManager().getLaunchIntentForPackage(packageName);
            if (launchIntent != null) {
                launchIntent.setComponent(new ComponentName(packageName, className));
                FlurryAgent.logEvent(FlurryHelper.YOUR_APPS_LAUNCH_APP);
                startActivity(null, launchIntent, "edgeSwipeLaunch");
            }
        }
    };
    registerReceiver(mBCastAppSwitcherAllApps, new IntentFilter(APP_SWITCHER_ALL_APPS));
    registerReceiver(mBCastAppSwitcherReset, new IntentFilter(Launcher.APP_SWITCHER_RESET));
    registerReceiver(mBCastAppSwitcherLauncher, new IntentFilter(Launcher.APP_SWITCHER_LAUNCH_APP));
}
Also used : Context(android.content.Context) IntentFilter(android.content.IntentFilter) DialogFragment(android.app.DialogFragment) Intent(android.content.Intent) RecognizerIntent(android.speech.RecognizerIntent) ComponentName(android.content.ComponentName) BroadcastReceiver(android.content.BroadcastReceiver)

Example 42 with DialogFragment

use of android.app.DialogFragment in project WordPress-Android by wordpress-mobile.

the class SitePickerActivity method addSite.

public static void addSite(Activity activity, boolean isSignedInWpCom) {
    // create a new wp.com blog or add a self-hosted one
    if (isSignedInWpCom) {
        DialogFragment dialog = new AddSiteDialog();
        dialog.show(activity.getFragmentManager(), AddSiteDialog.ADD_SITE_DIALOG_TAG);
    } else {
        // user isn't signed into wp.com, so simply enable adding self-hosted
        ActivityLauncher.addSelfHostedSiteForResult(activity);
    }
}
Also used : DialogFragment(android.app.DialogFragment)

Example 43 with DialogFragment

use of android.app.DialogFragment in project WordPress-Android by wordpress-mobile.

the class StatsActivity method bumpPromoAnaylticsAndShowPromoDialogIfNecessary.

private void bumpPromoAnaylticsAndShowPromoDialogIfNecessary() {
    if (mIsUpdatingStats || mThereWasAnErrorLoadingStats) {
        // Do nothing in case of errors or when it's still loading
        return;
    }
    if (!StringUtils.isEmpty(AppPrefs.getStatsWidgetsKeys())) {
        // Stats widgets already used!!
        return;
    }
    // Bump analytics that drives the Promo widget when the loading is completed without errors.
    AppPrefs.bumpAnalyticsForStatsWidgetPromo();
    // Should we display the widget promo?
    int counter = AppPrefs.getAnalyticsForStatsWidgetPromo();
    if (counter == 3 || counter == 1000 || counter == 10000) {
        DialogFragment newFragment = PromoDialog.newInstance(R.drawable.stats_widget_promo_header, R.string.stats_widget_promo_title, R.string.stats_widget_promo_desc, R.string.stats_widget_promo_ok_btn_label);
        newFragment.show(getFragmentManager(), "promote_widget_dialog");
    }
}
Also used : DialogFragment(android.app.DialogFragment)

Example 44 with DialogFragment

use of android.app.DialogFragment in project AisenWeiBo by wangdan.

the class CustomThemeColorFragment method launch.

public static void launch(Activity context) {
    Fragment fragment = context.getFragmentManager().findFragmentByTag("DialogFragment");
    if (fragment != null) {
        context.getFragmentManager().beginTransaction().remove(fragment).commit();
    }
    CustomThemeColorFragment dialogFragment = new CustomThemeColorFragment();
    dialogFragment.show(context.getFragmentManager(), "DialogFragment");
}
Also used : Fragment(android.app.Fragment) DialogFragment(android.app.DialogFragment)

Example 45 with DialogFragment

use of android.app.DialogFragment in project AisenWeiBo by wangdan.

the class MDColorsDialogFragment method launch.

public static void launch(Activity context) {
    Fragment fragment = context.getFragmentManager().findFragmentByTag("DMColorsDialogFragment");
    if (fragment != null) {
        context.getFragmentManager().beginTransaction().remove(fragment).commit();
    }
    MDColorsDialogFragment dialogFragment = new MDColorsDialogFragment();
    dialogFragment.show(context.getFragmentManager(), "DMColorsDialogFragment");
}
Also used : Fragment(android.app.Fragment) DialogFragment(android.app.DialogFragment)

Aggregations

DialogFragment (android.app.DialogFragment)48 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