當前位置: 首頁>>代碼示例>>Java>>正文


Java AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG屬性代碼示例

本文整理匯總了Java中com.facebook.internal.AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG屬性的典型用法代碼示例。如果您正苦於以下問題:Java AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG屬性的具體用法?Java AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG怎麽用?Java AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.facebook.internal.AnalyticsEvents的用法示例。


在下文中一共展示了AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: presentLikeDialog

private void presentLikeDialog(
        final Activity activity,
        final Fragment fragment,
        final Bundle analyticsParameters) {
    String analyticsEvent = null;

    if (LikeDialog.canShowNativeDialog()) {
        analyticsEvent = AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG;
    } else if (LikeDialog.canShowWebFallback()) {
        analyticsEvent = AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_FALLBACK;
    } else {
        // We will get here if the user tapped the button when dialogs cannot be shown.
        logAppEventForError("present_dialog", analyticsParameters);
        Utility.logd(TAG, "Cannot show the Like Dialog on this device.");
    }

    // Using the value of analyticsEvent to see if we can show any version of the dialog.
    // Written this way just to prevent extra lines of code.
    if (analyticsEvent != null) {
        LikeContent likeContent = new LikeContent.Builder()
                .setObjectId(this.objectId)
                .setObjectType(this.objectType)
                .build();

        if (fragment != null) {
            new LikeDialog(fragment).show(likeContent);
        } else {
            new LikeDialog(activity).show(likeContent);
        }

        saveState(analyticsParameters);

        getAppEventsLogger().logSdkEvent(
                AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG,
                null,
                analyticsParameters);
    }
}
 
開發者ID:CE-KMITL-OOAD-2015,項目名稱:Move-Alarm_ORCA,代碼行數:38,代碼來源:LikeActionController.java

示例2: presentLikeDialog

private void presentLikeDialog(
        final Activity activity,
        final Fragment fragment,
        final Bundle analyticsParameters) {
    String analyticsEvent = null;

    if (LikeDialog.canShowNativeDialog()) {
        analyticsEvent = AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG;
    } else if (LikeDialog.canShowWebFallback()) {
        analyticsEvent = AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_FALLBACK;
    } else {
        // We will get here if the user tapped the button when dialogs cannot be shown.
        logAppEventForError("present_dialog", analyticsParameters);
        Utility.logd(TAG, "Cannot show the Like Dialog on this device.");

        // If we got to this point, we should ask the views to check if they should now
        // be disabled.
        broadcastAction(null, ACTION_LIKE_ACTION_CONTROLLER_UPDATED);
    }

    // Using the value of analyticsEvent to see if we can show any version of the dialog.
    // Written this way just to prevent extra lines of code.
    if (analyticsEvent != null) {
        String objectTypeString = (this.objectType != null)
                ? this.objectType.toString()
                : LikeView.ObjectType.UNKNOWN.toString();
        LikeContent likeContent = new LikeContent.Builder()
                .setObjectId(this.objectId)
                .setObjectType(objectTypeString)
                .build();

        if (fragment != null) {
            new LikeDialog(fragment).show(likeContent);
        } else {
            new LikeDialog(activity).show(likeContent);
        }

        saveState(analyticsParameters);

        getAppEventsLogger().logSdkEvent(
                AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG,
                null,
                analyticsParameters);
    }
}
 
開發者ID:eviltnan,項目名稱:kognitivo,代碼行數:45,代碼來源:LikeActionController.java


注:本文中的com.facebook.internal.AnalyticsEvents.EVENT_LIKE_VIEW_DID_PRESENT_DIALOG屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。