@Override public ShareStoryContent build() { return new ShareStoryContent(this); }
private static void validateStoryContent( ShareStoryContent storyContent, Validator validator){ if(storyContent == null || (storyContent.getBackgroundAsset() == null && storyContent.getStickerAsset() == null)) throw new FacebookException( "Must pass the Facebook app a background asset, a sticker asset, or both"); if (storyContent.getBackgroundAsset() != null) validator.validate(storyContent.getBackgroundAsset()); if (storyContent.getStickerAsset() != null) validator.validate(storyContent.getStickerAsset()); }
ShareStoryContent(final Parcel in) { super(in); this.mBackgroundAsset = in.readParcelable(ShareMedia.class.getClassLoader()); this.mStickerAsset = in.readParcelable(SharePhoto.class.getClassLoader()); this.mBackgroundColorList = readUnmodifiableStringList(in); this.mAttributionLink = in.readString(); }
@Override public Builder readFrom(final ShareStoryContent model) { if (model == null) { return this; } return super .readFrom(model) .setBackgroundAsset(model.getBackgroundAsset()) .setStickerAsset(model.getStickerAsset()) .setBackgroundColorList(model.getBackgroundColorList()) .setAttributionLink(model.getAttributionLink()) ; } }
private static Bundle create( ShareStoryContent storyContent, @Nullable Bundle mediaInfo, @Nullable Bundle stickerInfo, boolean dataErrorsFatal) { Bundle params = createBaseParameters(storyContent, dataErrorsFatal); if (mediaInfo != null){ params.putParcelable(ShareConstants.STORY_BG_ASSET, mediaInfo); } if (stickerInfo != null){ params.putParcelable(ShareConstants.STORY_INTERACTIVE_ASSET_URI, stickerInfo); } List<String> backgroundColorList = storyContent.getBackgroundColorList(); if (!Utility.isNullOrEmpty(backgroundColorList)){ params.putStringArrayList( ShareConstants.STORY_INTERACTIVE_COLOR_LIST, new ArrayList<>(backgroundColorList)); } Utility.putNonEmptyString(params, ShareConstants.STORY_DEEP_LINK_URL, storyContent.getAttributionLink()); return params; }
final UUID appCallId){ if (storyContent == null || storyContent.getBackgroundAsset() == null) { return null; media.add(storyContent.getBackgroundAsset());
final ShareStoryContent storyContent, final UUID appCallId){ if(storyContent == null || storyContent.getStickerAsset() == null){ return null; photos.add(storyContent.getStickerAsset());
public ShareStoryContent createFromParcel(final Parcel in) { return new ShareStoryContent(in); }