Java 类com.facebook.internal.AnalyticsEvents 实例源码

项目:kognitivo    文件:LikeActionController.java   
/**
 * Entry-point to the code that performs the like/unlike action.
 */
public void toggleLike(Activity activity, Fragment fragment, Bundle analyticsParameters) {
    boolean shouldLikeObject = !this.isObjectLiked;

    if (canUseOGPublish()) {
        // Update UI Like state optimistically
        updateLikeState(shouldLikeObject);
        if (isPendingLikeOrUnlike) {
            // If the user toggled the button quickly, and there is still a publish underway,
            // don't fire off another request. Also log this behavior.

            getAppEventsLogger().logSdkEvent(
                    AnalyticsEvents.EVENT_LIKE_VIEW_DID_UNDO_QUICKLY,
                    null,
                    analyticsParameters);
        } else if (!publishLikeOrUnlikeAsync(shouldLikeObject, analyticsParameters)) {
            // We were not able to send a graph request to unlike or like the object
            // Undo the optimistic state-update and show the dialog instead
            updateLikeState(!shouldLikeObject);
            presentLikeDialog(activity, fragment, analyticsParameters);
        }
    } else {
        presentLikeDialog(activity, fragment, analyticsParameters);
    }
}
项目:AndroidBackendlessChat    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:AndroidBackendlessChat    文件:FacebookDialog.java   
/**
 * Launches an activity in the Facebook application to present the desired dialog. This method returns a
 * PendingCall that contains a unique ID associated with this call to the Facebook application. In general,
 * a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure
 * proper processing of the results from this dialog.
 *
 * @return a PendingCall containing the unique call ID corresponding to this call to the Facebook application
 */
public PendingCall present() {
    logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
            AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);

    if (onPresentCallback != null) {
        try {
            onPresentCallback.onPresent(activity);
        } catch (Exception e) {
            throw new FacebookException(e);
        }
    }

    if (fragment != null) {
        fragment.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    } else {
        activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    }
    return appCall;
}
项目:AndroidBackendlessChat    文件:FacebookDialog.java   
static private String getEventName(String action, boolean hasPhotos) {
    String eventName;

    if (action.equals(NativeProtocol.ACTION_FEED_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_SHARE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_MESSAGE_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_MESSAGE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_MESSAGE;
    } else if (action.equals(NativeProtocol.ACTION_OGACTIONPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_OGMESSAGEPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_MESSAGE;
    } else {
        throw new FacebookException("An unspecified action was presented");
    }
    return eventName;
}
项目:AndroidBackendlessChat    文件:FacebookDialog.java   
/**
 * Constructs a FacebookDialog with an Intent that is correctly populated to present the dialog within
 * the Facebook application.
 *
 * @return a FacebookDialog instance
 */
public FacebookDialog build() {
    validate();

    Bundle extras = new Bundle();
    putExtra(extras, NativeProtocol.EXTRA_APPLICATION_ID, applicationId);
    putExtra(extras, NativeProtocol.EXTRA_APPLICATION_NAME, applicationName);
    extras = setBundleExtras(extras);

    String action = getActionForFeatures(getDialogFeatures());
    int protocolVersion = getProtocolVersionForNativeDialog(activity, action,
            getMinVersionForFeatures(getDialogFeatures()));

    Intent intent = NativeProtocol.createPlatformActivityIntent(activity, action, protocolVersion, extras);
    if (intent == null) {
        logDialogActivity(activity, fragment,
                getEventName(action, extras.containsKey(NativeProtocol.EXTRA_PHOTOS)),
                AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_FAILED);

        throw new FacebookException(
                "Unable to create Intent; this likely means the Facebook app is not installed.");
    }
    appCall.setRequestIntent(intent);

    return new FacebookDialog(activity, fragment, appCall, getOnPresentCallback());
}
项目:chat-sdk-android-push-firebase    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:chat-sdk-android-push-firebase    文件:FacebookDialog.java   
/**
 * Launches an activity in the Facebook application to present the desired dialog. This method returns a
 * PendingCall that contains a unique ID associated with this call to the Facebook application. In general,
 * a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure
 * proper processing of the results from this dialog.
 *
 * @return a PendingCall containing the unique call ID corresponding to this call to the Facebook application
 */
public PendingCall present() {
    logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
            AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);

    if (onPresentCallback != null) {
        try {
            onPresentCallback.onPresent(activity);
        } catch (Exception e) {
            throw new FacebookException(e);
        }
    }

    if (fragment != null) {
        fragment.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    } else {
        activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    }
    return appCall;
}
项目:chat-sdk-android-push-firebase    文件:FacebookDialog.java   
static private String getEventName(String action, boolean hasPhotos) {
    String eventName;

    if (action.equals(NativeProtocol.ACTION_FEED_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_SHARE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_MESSAGE_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_MESSAGE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_MESSAGE;
    } else if (action.equals(NativeProtocol.ACTION_OGACTIONPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_OGMESSAGEPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_MESSAGE;
    } else {
        throw new FacebookException("An unspecified action was presented");
    }
    return eventName;
}
项目:chat-sdk-android-push-firebase    文件:FacebookDialog.java   
/**
 * Constructs a FacebookDialog with an Intent that is correctly populated to present the dialog within
 * the Facebook application.
 *
 * @return a FacebookDialog instance
 */
public FacebookDialog build() {
    validate();

    Bundle extras = new Bundle();
    putExtra(extras, NativeProtocol.EXTRA_APPLICATION_ID, applicationId);
    putExtra(extras, NativeProtocol.EXTRA_APPLICATION_NAME, applicationName);
    extras = setBundleExtras(extras);

    String action = getActionForFeatures(getDialogFeatures());
    int protocolVersion = getProtocolVersionForNativeDialog(activity, action,
            getMinVersionForFeatures(getDialogFeatures()));

    Intent intent = NativeProtocol.createPlatformActivityIntent(activity, action, protocolVersion, extras);
    if (intent == null) {
        logDialogActivity(activity, fragment,
                getEventName(action, extras.containsKey(NativeProtocol.EXTRA_PHOTOS)),
                AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_FAILED);

        throw new FacebookException(
                "Unable to create Intent; this likely means the Facebook app is not installed.");
    }
    appCall.setRequestIntent(intent);

    return new FacebookDialog(activity, fragment, appCall, getOnPresentCallback());
}
项目:yelo-android    文件:AuthorizationClient.java   
@Override
boolean tryAuthorize(AuthorizationRequest request) {
    applicationId = request.getApplicationId();

    Intent intent = NativeProtocol.createLoginDialog20121101Intent(context, request.getApplicationId(),
            new ArrayList<String>(request.getPermissions()),
            request.getDefaultAudience().getNativeProtocolAudience());
    if (intent == null) {
        return false;
    }

    callId = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID);

    addLoggingExtra(EVENT_EXTRAS_APP_CALL_ID, callId);
    addLoggingExtra(EVENT_EXTRAS_PROTOCOL_VERSION,
            intent.getIntExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION, 0));
    addLoggingExtra(EVENT_EXTRAS_PERMISSIONS,
            TextUtils.join(",", intent.getStringArrayListExtra(NativeProtocol.EXTRA_PERMISSIONS)));
    addLoggingExtra(EVENT_EXTRAS_WRITE_PRIVACY, intent.getStringExtra(NativeProtocol.EXTRA_WRITE_PRIVACY));
    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_START,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_START_TIME, callId);

    return tryIntent(intent, request.getRequestCode());
}
项目:yelo-android    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:BrillaMXAndroid    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:aquaplay    文件:AuthorizationClient.java   
@Override
boolean tryAuthorize(AuthorizationRequest request) {
    applicationId = request.getApplicationId();

    Intent intent = NativeProtocol.createLoginDialog20121101Intent(context, request.getApplicationId(),
            new ArrayList<String>(request.getPermissions()),
            request.getDefaultAudience().getNativeProtocolAudience());
    if (intent == null) {
        return false;
    }

    callId = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID);

    addLoggingExtra(EVENT_EXTRAS_APP_CALL_ID, callId);
    addLoggingExtra(EVENT_EXTRAS_PROTOCOL_VERSION,
            intent.getIntExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION, 0));
    addLoggingExtra(EVENT_EXTRAS_PERMISSIONS,
            TextUtils.join(",", intent.getStringArrayListExtra(NativeProtocol.EXTRA_PERMISSIONS)));
    addLoggingExtra(EVENT_EXTRAS_WRITE_PRIVACY, intent.getStringExtra(NativeProtocol.EXTRA_WRITE_PRIVACY));
    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_START,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_START_TIME, callId);

    return tryIntent(intent, request.getRequestCode());
}
项目:aquaplay    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:TP-Formation-Android    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:AutoTimeHelper    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:snake-game-aws    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:snake-game-aws    文件:FacebookDialog.java   
/**
 * Launches an activity in the Facebook application to present the desired dialog. This method returns a
 * PendingCall that contains a unique ID associated with this call to the Facebook application. In general,
 * a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure
 * proper processing of the results from this dialog.
 *
 * @return a PendingCall containing the unique call ID corresponding to this call to the Facebook application
 */
public PendingCall present() {
    logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
            AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);

    if (onPresentCallback != null) {
        try {
            onPresentCallback.onPresent(activity);
        } catch (Exception e) {
            throw new FacebookException(e);
        }
    }

    if (fragment != null) {
        fragment.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    } else {
        activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    }
    return appCall;
}
项目:snake-game-aws    文件:FacebookDialog.java   
static private String getEventName(String action, boolean hasPhotos) {
    String eventName;

    if (action.equals(NativeProtocol.ACTION_FEED_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_SHARE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_MESSAGE_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_MESSAGE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_MESSAGE;
    } else if (action.equals(NativeProtocol.ACTION_OGACTIONPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_OGMESSAGEPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_MESSAGE;
    } else {
        throw new FacebookException("An unspecified action was presented");
    }
    return eventName;
}
项目:snake-game-aws    文件:FacebookDialog.java   
/**
 * Constructs a FacebookDialog with an Intent that is correctly populated to present the dialog within
 * the Facebook application.
 *
 * @return a FacebookDialog instance
 */
public FacebookDialog build() {
    validate();

    Bundle extras = new Bundle();
    putExtra(extras, NativeProtocol.EXTRA_APPLICATION_ID, applicationId);
    putExtra(extras, NativeProtocol.EXTRA_APPLICATION_NAME, applicationName);
    extras = setBundleExtras(extras);

    String action = getActionForFeatures(getDialogFeatures());
    int protocolVersion = getProtocolVersionForNativeDialog(activity, action,
            getMinVersionForFeatures(getDialogFeatures()));

    Intent intent = NativeProtocol.createPlatformActivityIntent(activity, action, protocolVersion, extras);
    if (intent == null) {
        logDialogActivity(activity, fragment,
                getEventName(action, extras.containsKey(NativeProtocol.EXTRA_PHOTOS)),
                AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_FAILED);

        throw new FacebookException(
                "Unable to create Intent; this likely means the Facebook app is not installed.");
    }
    appCall.setRequestIntent(intent);

    return new FacebookDialog(activity, fragment, appCall, getOnPresentCallback());
}
项目:BrainStudio    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:platform-friends-android    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:Shorcial    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:bladedroid    文件:AuthorizationClient.java   
@Override
boolean tryAuthorize(AuthorizationRequest request) {
    applicationId = request.getApplicationId();

    Intent intent = NativeProtocol.createLoginDialog20121101Intent(context, request.getApplicationId(),
            new ArrayList<String>(request.getPermissions()),
            request.getDefaultAudience().getNativeProtocolAudience());
    if (intent == null) {
        return false;
    }

    callId = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID);

    addLoggingExtra(EVENT_EXTRAS_APP_CALL_ID, callId);
    addLoggingExtra(EVENT_EXTRAS_PROTOCOL_VERSION,
            ""+intent.getIntExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION,0));
    addLoggingExtra(EVENT_EXTRAS_PERMISSIONS,
            TextUtils.join(",", intent.getStringArrayListExtra(NativeProtocol.EXTRA_PERMISSIONS)));
    addLoggingExtra(EVENT_EXTRAS_WRITE_PRIVACY, intent.getStringExtra(NativeProtocol.EXTRA_WRITE_PRIVACY));
    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_START,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_START_TIME, callId);

    return tryIntent(intent, request.getRequestCode());
}
项目:PetTinder    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:UbiNomadLib    文件:AuthorizationClient.java   
@Override
boolean tryAuthorize(AuthorizationRequest request) {
    applicationId = request.getApplicationId();

    Intent intent = NativeProtocol.createLoginDialog20121101Intent(context, request.getApplicationId(),
            new ArrayList<String>(request.getPermissions()),
            request.getDefaultAudience().getNativeProtocolAudience());
    if (intent == null) {
        return false;
    }

    callId = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID);

    addLoggingExtra(EVENT_EXTRAS_APP_CALL_ID, callId);
    addLoggingExtra(EVENT_EXTRAS_PROTOCOL_VERSION,
            intent.getIntExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION, 0));
    addLoggingExtra(EVENT_EXTRAS_PERMISSIONS,
            TextUtils.join(",", intent.getStringArrayListExtra(NativeProtocol.EXTRA_PERMISSIONS)));
    addLoggingExtra(EVENT_EXTRAS_WRITE_PRIVACY, intent.getStringExtra(NativeProtocol.EXTRA_WRITE_PRIVACY));
    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_START,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_START_TIME, callId);

    return tryIntent(intent, request.getRequestCode());
}
项目:Team-Alice    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:Team-Alice    文件:FacebookDialog.java   
/**
 * Launches an activity in the Facebook application to present the desired dialog. This method returns a
 * PendingCall that contains a unique ID associated with this call to the Facebook application. In general,
 * a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure
 * proper processing of the results from this dialog.
 *
 * @return a PendingCall containing the unique call ID corresponding to this call to the Facebook application
 */
public PendingCall present() {
    logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
            AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);

    if (onPresentCallback != null) {
        try {
            onPresentCallback.onPresent(activity);
        } catch (Exception e) {
            throw new FacebookException(e);
        }
    }

    if (fragment != null) {
        fragment.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    } else {
        activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    }
    return appCall;
}
项目:CampusFeedv2    文件:AuthorizationClient.java   
@Override
boolean tryAuthorize(AuthorizationRequest request) {
    applicationId = request.getApplicationId();

    Intent intent = NativeProtocol.createLoginDialog20121101Intent(context, request.getApplicationId(),
            new ArrayList<String>(request.getPermissions()),
            request.getDefaultAudience().getNativeProtocolAudience());
    if (intent == null) {
        return false;
    }

    callId = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID);

    addLoggingExtra(EVENT_EXTRAS_APP_CALL_ID, callId);
    addLoggingExtra(EVENT_EXTRAS_PROTOCOL_VERSION,
            intent.getIntExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION, 0));
    addLoggingExtra(EVENT_EXTRAS_PERMISSIONS,
            TextUtils.join(",", intent.getStringArrayListExtra(NativeProtocol.EXTRA_PERMISSIONS)));
    addLoggingExtra(EVENT_EXTRAS_WRITE_PRIVACY, intent.getStringExtra(NativeProtocol.EXTRA_WRITE_PRIVACY));
    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_START,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_START_TIME, callId);

    return tryIntent(intent, request.getRequestCode());
}
项目:HereAStory-Android    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:WatsiAndroidApp    文件:FacebookDialog.java   
/**
 * Launches an activity in the Facebook application to present the desired dialog. This method returns a
 * PendingCall that contains a unique ID associated with this call to the Facebook application. In general,
 * a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure
 * proper processing of the results from this dialog.
 *
 * @return a PendingCall containing the unique call ID corresponding to this call to the Facebook application
 */
public PendingCall present() {
    logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
            AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);

    if (onPresentCallback != null) {
        try {
            onPresentCallback.onPresent(activity);
        } catch (Exception e) {
            throw new FacebookException(e);
        }
    }

    if (fragment != null) {
        fragment.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    } else {
        activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    }
    return appCall;
}
项目:WatsiAndroidApp    文件:FacebookDialog.java   
/**
 * Constructs a FacebookDialog with an Intent that is correctly populated to present the dialog within
 * the Facebook application.
 *
 * @return a FacebookDialog instance
 */
public FacebookDialog build() {
    validate();

    Bundle extras = new Bundle();
    putExtra(extras, NativeProtocol.EXTRA_APPLICATION_ID, applicationId);
    putExtra(extras, NativeProtocol.EXTRA_APPLICATION_NAME, applicationName);
    extras = setBundleExtras(extras);

    String action = getActionForFeatures(getDialogFeatures());
    int protocolVersion = getProtocolVersionForNativeDialog(activity, action,
            getMinVersionForFeatures(getDialogFeatures()));

    Intent intent = NativeProtocol.createPlatformActivityIntent(activity, action, protocolVersion, extras);
    if (intent == null) {
        logDialogActivity(activity, fragment,
                getEventName(action, extras.containsKey(NativeProtocol.EXTRA_PHOTOS)),
                AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_FAILED);

        throw new FacebookException(
                "Unable to create Intent; this likely means the Facebook app is not installed.");
    }
    appCall.setRequestIntent(intent);

    return new FacebookDialog(activity, fragment, appCall, getOnPresentCallback());
}
项目:Qtino.SharingKit    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:stepout    文件:FacebookDialog.java   
/**
 * Launches an activity in the Facebook application to present the desired dialog. This method returns a
 * PendingCall that contains a unique ID associated with this call to the Facebook application. In general,
 * a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure
 * proper processing of the results from this dialog.
 *
 * @return a PendingCall containing the unique call ID corresponding to this call to the Facebook application
 */
public PendingCall present() {
    logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
            AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);

    if (onPresentCallback != null) {
        try {
            onPresentCallback.onPresent(activity);
        } catch (Exception e) {
            throw new FacebookException(e);
        }
    }

    if (fragment != null) {
        fragment.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    } else {
        activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    }
    return appCall;
}
项目:StoryTeller    文件:UserSettingsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false);
    loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button);
    loginButton.setProperties(loginButtonProperties);
    loginButton.setFragment(this);
    loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE);

    Session session = getSession();
    if (session != null && !session.equals(Session.getActiveSession())) {
        loginButton.setSession(session);
    }
    connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name);

    // if no background is set for some reason, then default to Facebook blue
    if (view.getBackground() == null) {
        view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue));
    } else {
        view.getBackground().setDither(true);
    }
    return view;
}
项目:Qtino.SharingKit    文件:FacebookDialog.java   
static private String getEventName(String action, boolean hasPhotos) {
    String eventName;

    if (action.equals(NativeProtocol.ACTION_FEED_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_SHARE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_MESSAGE_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_MESSAGE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_MESSAGE;
    } else if (action.equals(NativeProtocol.ACTION_OGACTIONPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_OGMESSAGEPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_MESSAGE;
    } else {
        throw new FacebookException("An unspecified action was presented");
    }
    return eventName;
}
项目:StoryTeller    文件:FacebookDialog.java   
/**
 * Launches an activity in the Facebook application to present the desired dialog. This method returns a
 * PendingCall that contains a unique ID associated with this call to the Facebook application. In general,
 * a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure
 * proper processing of the results from this dialog.
 *
 * @return a PendingCall containing the unique call ID corresponding to this call to the Facebook application
 */
public PendingCall present() {
    logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
            AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);

    if (onPresentCallback != null) {
        try {
            onPresentCallback.onPresent(activity);
        } catch (Exception e) {
            throw new FacebookException(e);
        }
    }

    if (fragment != null) {
        fragment.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    } else {
        activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    }
    return appCall;
}
项目:maven-multilib-sample-app    文件:AuthorizationClient.java   
@Override
boolean tryAuthorize(AuthorizationRequest request) {
    applicationId = request.getApplicationId();

    Intent intent = NativeProtocol.createLoginDialog20121101Intent(context, request.getApplicationId(),
            new ArrayList<String>(request.getPermissions()),
            request.getDefaultAudience().getNativeProtocolAudience());
    if (intent == null) {
        return false;
    }

    callId = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID);

    addLoggingExtra(EVENT_EXTRAS_APP_CALL_ID, callId);
    addLoggingExtra(EVENT_EXTRAS_PROTOCOL_VERSION,
            intent.getIntExtra(NativeProtocol.EXTRA_PROTOCOL_VERSION, 0));
    addLoggingExtra(EVENT_EXTRAS_PERMISSIONS,
            TextUtils.join(",", intent.getStringArrayListExtra(NativeProtocol.EXTRA_PERMISSIONS)));
    addLoggingExtra(EVENT_EXTRAS_WRITE_PRIVACY, intent.getStringExtra(NativeProtocol.EXTRA_WRITE_PRIVACY));
    logEvent(AnalyticsEvents.EVENT_NATIVE_LOGIN_DIALOG_START,
            AnalyticsEvents.PARAMETER_NATIVE_LOGIN_DIALOG_START_TIME, callId);

    return tryIntent(intent, request.getRequestCode());
}
项目:Nefete    文件:FacebookDialog.java   
/**
 * Launches an activity in the Facebook application to present the desired dialog. This method returns a
 * PendingCall that contains a unique ID associated with this call to the Facebook application. In general,
 * a calling Activity should use UiLifecycleHelper to handle incoming activity results, in order to ensure
 * proper processing of the results from this dialog.
 *
 * @return a PendingCall containing the unique call ID corresponding to this call to the Facebook application
 */
public PendingCall present() {
    logDialogActivity(activity, fragment, getEventName(appCall.getRequestIntent()),
            AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED);

    if (onPresentCallback != null) {
        try {
            onPresentCallback.onPresent(activity);
        } catch (Exception e) {
            throw new FacebookException(e);
        }
    }

    if (fragment != null) {
        fragment.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    } else {
        activity.startActivityForResult(appCall.getRequestIntent(), appCall.getRequestCode());
    }
    return appCall;
}
项目:FacebookImageShareIntent    文件:FacebookDialog.java   
static private String getEventName(String action, boolean hasPhotos) {
    String eventName;

    if (action.equals(NativeProtocol.ACTION_FEED_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_SHARE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_MESSAGE_DIALOG)) {
        eventName = hasPhotos ?
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_PHOTO_MESSAGE :
                AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_MESSAGE;
    } else if (action.equals(NativeProtocol.ACTION_OGACTIONPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_SHARE;
    } else if (action.equals(NativeProtocol.ACTION_OGMESSAGEPUBLISH_DIALOG)) {
        eventName = AnalyticsEvents.EVENT_NATIVE_DIALOG_TYPE_OG_MESSAGE;
    } else {
        throw new FacebookException("An unspecified action was presented");
    }
    return eventName;
}