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));
}
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);
}
}
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");
}
}
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");
}
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");
}
Aggregations