/** * Shows a {@link GameRequestDialog} to send a request, using * the passed in activity. No callback will be invoked. * * @param fragment android.app.Fragment hosting the dialog. * @param gameRequestContent Content of the request. */ public static void show( final android.app.Fragment fragment, final GameRequestContent gameRequestContent) { show(new FragmentWrapper(fragment), gameRequestContent); }
private static void show( final FragmentWrapper fragmentWrapper, final GameRequestContent gameRequestContent) { new GameRequestDialog(fragmentWrapper).show(gameRequestContent); }
/** * Shows a {@link GameRequestDialog} to send a request, using * the passed in activity. No callback will be invoked. * * @param activity Activity hosting the dialog. * @param gameRequestContent Content of the request. */ public static void show(final Activity activity, final GameRequestContent gameRequestContent) { new GameRequestDialog(activity).show(gameRequestContent); }
/** * Shows a {@link GameRequestDialog} to send a request, using * the passed in activity. No callback will be invoked. * * @param fragment android.support.v4.app.Fragment hosting the dialog. * @param gameRequestContent Content of the request. */ public static void show( final Fragment fragment, final GameRequestContent gameRequestContent) { show(new FragmentWrapper(fragment), gameRequestContent); }
@Override public boolean onOptionsItemSelected(MenuItem item) { if (item.equals(settings)) { showFragment(SETTINGS, true); return true; } else if (item.equals(challenge)) { GameRequestContent newGameRequestContent = new GameRequestContent.Builder() .setTitle(getString(R.string.challenge_dialog_title)) .setMessage(getString(R.string.challenge_dialog_message)) .build(); gameRequestDialog.show(this, newGameRequestContent); return true; } else if (item.equals(share)) { RpsFragment fragment = (RpsFragment) fragments[RPS]; fragment.shareUsingAutomaticDialog(); return true; } else if (item.equals(message)) { RpsFragment fragment = (RpsFragment) fragments[RPS]; fragment.shareUsingMessengerDialog(); return true; } return false; }
requestDialog.show(content);