本文整理匯總了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);
}
}
示例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);
}
}