private static void show( final FragmentWrapper fragmentWrapper, final GameRequestContent gameRequestContent) { new GameRequestDialog(fragmentWrapper).show(gameRequestContent); }
@Override public boolean onActivityResult(int resultCode, Intent data) { return ShareInternalUtility.handleActivityResult( getRequestCode(), resultCode, data, resultProcessor); } });
GameRequestDialog requestDialog = new GameRequestDialog(activity); requestDialog.registerCallback(callbackManager, new FacebookCallback<GameRequestDialog.Result>() { public void onSuccess(GameRequestDialog.Result result) { requestDialog.show(content);
gameRequestDialog = new GameRequestDialog(this); callbackManager = CallbackManager.Factory.create(); gameRequestDialog.registerCallback( callbackManager, new FacebookCallback<GameRequestDialog.Result>() {
/** * 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); }
@Override public AppCall createAppCall(final GameRequestContent content) { GameRequestValidation.validate(content); AppCall appCall = createBaseAppCall(); DialogPresenter.setupAppCallForWebDialog( appCall, GAME_REQUEST_DIALOG, WebDialogParameters.create(content)); return appCall; }
/** * 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); }
/** * 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); }
@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; }
@Override protected AppCall createBaseAppCall() { return new AppCall(getRequestCode()); }
@Override protected void registerCallbackImpl( final CallbackManagerImpl callbackManager, final FacebookCallback<Result> callback) { final ResultProcessor resultProcessor = (callback == null) ? null : new ResultProcessor(callback) { @Override public void onSuccess(AppCall appCall, Bundle results) { if (results != null) { callback.onSuccess(new Result(results)); } else { onCancel(appCall); } } }; callbackManager.registerCallback( getRequestCode(), new CallbackManagerImpl.Callback() { @Override public boolean onActivityResult(int resultCode, Intent data) { return ShareInternalUtility.handleActivityResult( getRequestCode(), resultCode, data, resultProcessor); } }); }