public static class Branch.ShareLinkBuilder
extends java.lang.Object
Class for building a share link dialog.This creates a chooser for selecting application for sharing a link created with given parameters.
Constructor and Description |
---|
ShareLinkBuilder(android.app.Activity activity,
BranchShortLinkBuilder shortLinkBuilder)
*
|
ShareLinkBuilder(android.app.Activity activity,
org.json.JSONObject parameters)
Creates options for sharing a link with other Applications.
|
Modifier and Type | Method and Description |
---|---|
Branch.ShareLinkBuilder |
addParam(java.lang.String key,
java.lang.String value)
Add the given key value to the deep link parameters
|
Branch.ShareLinkBuilder |
addPreferredSharingOption(SharingHelper.SHARE_WITH preferredOption)
Adds application to the preferred list of applications which are shown on share dialog.
|
Branch.ShareLinkBuilder |
addPreferredSharingOptions(java.util.ArrayList<SharingHelper.SHARE_WITH> preferredOptions)
Adds application to the preferred list of applications which are shown on share dialog.
|
Branch.ShareLinkBuilder |
addTag(java.lang.String tag)
Adds the given tag an iterable
Collection of String tags associated with a deep
link. |
Branch.ShareLinkBuilder |
addTags(java.util.ArrayList<java.lang.String> tags)
Adds the given tag an iterable
Collection of String tags associated with a deep
link. |
Branch.ShareLinkBuilder |
excludeFromShareSheet(java.util.List<java.lang.String> packageNames)
Exclude items from the ShareSheet by package name List.
|
Branch.ShareLinkBuilder |
excludeFromShareSheet(java.lang.String packageName)
Exclude items from the ShareSheet by package name String.
|
Branch.ShareLinkBuilder |
excludeFromShareSheet(java.lang.String[] packageName)
Exclude items from the ShareSheet by package name array.
|
android.app.Activity |
getActivity() |
Branch |
getBranch() |
Branch.BranchLinkShareListener |
getCallback() |
Branch.IChannelProperties |
getChannelPropertiesCallback() |
android.graphics.drawable.Drawable |
getCopyUrlIcon() |
java.lang.String |
getCopyURlText() |
java.lang.String |
getDefaultURL() |
int |
getDialogThemeResourceID() |
int |
getDividerHeight() |
int |
getIconSize() |
boolean |
getIsFullWidthStyle() |
android.graphics.drawable.Drawable |
getMoreOptionIcon() |
java.lang.String |
getMoreOptionText() |
java.util.ArrayList<SharingHelper.SHARE_WITH> |
getPreferredOptions() |
java.lang.String |
getShareMsg() |
java.lang.String |
getShareSub() |
java.lang.String |
getSharingTitle() |
android.view.View |
getSharingTitleView() |
BranchShortLinkBuilder |
getShortLinkBuilder() |
int |
getStyleResourceID() |
java.lang.String |
getUrlCopiedMessage() |
Branch.ShareLinkBuilder |
includeInShareSheet(java.util.List<java.lang.String> packageNames)
Include items from the ShareSheet by package name List.
|
Branch.ShareLinkBuilder |
includeInShareSheet(java.lang.String packageName)
Include items from the ShareSheet by package name String.
|
Branch.ShareLinkBuilder |
includeInShareSheet(java.lang.String[] packageName)
Include items from the ShareSheet by package name Array.
|
Branch.ShareLinkBuilder |
setAlias(java.lang.String alias)
Sets the alias for this link.
|
Branch.ShareLinkBuilder |
setAsFullWidthStyle(boolean setFullWidthStyle)
Sets the share dialog to full width mode.
|
Branch.ShareLinkBuilder |
setCallback(Branch.BranchLinkShareListener callback)
Adds a callback to get the sharing status.
|
Branch.ShareLinkBuilder |
setChannelProperties(Branch.IChannelProperties channelPropertiesCallback) |
Branch.ShareLinkBuilder |
setCopyUrlStyle(android.graphics.drawable.Drawable icon,
java.lang.String label,
java.lang.String message)
Set the icon, label and success message for copy url option.
|
Branch.ShareLinkBuilder |
setCopyUrlStyle(int drawableIconID,
int stringLabelID,
int stringMessageID)
Set the icon, label and success message for copy url option.
|
Branch.ShareLinkBuilder |
setDefaultURL(java.lang.String url)
Set a default url to share in case there is any error creating the deep link
|
Branch.ShareLinkBuilder |
setDialogThemeResourceID(int styleResourceID)
Sets the given resource id as the theme id for share sheet dialog view.
|
Branch.ShareLinkBuilder |
setDividerHeight(int height)
Set the height for the divider for the sharing channels in the list.
|
Branch.ShareLinkBuilder |
setFeature(java.lang.String feature)
Adds a feature that make use of the link.
|
Branch.ShareLinkBuilder |
setIconSize(int iconSize)
Set icon size for the sharing dialog
|
Branch.ShareLinkBuilder |
setMatchDuration(int matchDuration)
Sets the amount of time that Branch allows a click to remain outstanding.
|
Branch.ShareLinkBuilder |
setMessage(java.lang.String message)
Sets the message to be shared with the link.
|
Branch.ShareLinkBuilder |
setMoreOptionStyle(android.graphics.drawable.Drawable icon,
java.lang.String label)
Set the icon and label for the option to expand the application list to see more options.
|
Branch.ShareLinkBuilder |
setMoreOptionStyle(int drawableIconID,
int stringLabelID)
Set the icon and label for the option to expand the application list to see more options.
|
Branch.ShareLinkBuilder |
setSharingTitle(java.lang.String title)
Set the title for the sharing dialog
|
Branch.ShareLinkBuilder |
setSharingTitle(android.view.View titleView)
Set the title for the sharing dialog
|
void |
setShortLinkBuilderInternal(BranchShortLinkBuilder shortLinkBuilder) |
Branch.ShareLinkBuilder |
setStage(java.lang.String stage)
Adds a stage application or user flow associated with this link.
|
void |
setStyleResourceID(int resourceID)
Set the given style to the List View showing the share sheet
|
Branch.ShareLinkBuilder |
setSubject(java.lang.String subject)
Sets the subject of this message.
|
void |
shareLink()
Creates an application selector dialog and share a link with user selected sharing option.
|
public ShareLinkBuilder(android.app.Activity activity, org.json.JSONObject parameters)
Creates options for sharing a link with other Applications. Creates a builder for sharing the link with user selected clients
activity
- The Activity
to show the dialog for choosing sharing application.parameters
- A JSONObject
value containing the deep link params.public ShareLinkBuilder(android.app.Activity activity, BranchShortLinkBuilder shortLinkBuilder)
Creates options for sharing a link with other Applications. Creates a builder for sharing the link with user selected clients
activity
- The Activity
to show the dialog for choosing sharing application.shortLinkBuilder
- An instance of BranchShortLinkBuilder
to create link to be sharedpublic Branch.ShareLinkBuilder setMessage(java.lang.String message)
Sets the message to be shared with the link.
message
- A String
to be shared with the linkBranch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setSubject(java.lang.String subject)
Sets the subject of this message. This will be added to Email and SMS Application capable of handling subject in the message.
subject
- A String
subject of this message.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder addTag(java.lang.String tag)
Adds the given tag an iterable Collection
of String
tags associated with a deep
link.
tag
- A String
to be added to the iterable Collection
of String
tags associated with a deep
link.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder addTags(java.util.ArrayList<java.lang.String> tags)
Adds the given tag an iterable Collection
of String
tags associated with a deep
link.
tags
- A List
of tags to be added to the iterable Collection
of String
tags associated with a deep
link.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setFeature(java.lang.String feature)
Adds a feature that make use of the link.
feature
- A String
value identifying the feature that the link makes use of.
Should not exceed 128 characters.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setStage(java.lang.String stage)
Adds a stage application or user flow associated with this link.
stage
- A String
value identifying the stage in an application or user flow
process. Should not exceed 128 characters.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setCallback(Branch.BranchLinkShareListener callback)
Adds a callback to get the sharing status.
callback
- A Branch.BranchLinkShareListener
instance for getting sharing status.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setChannelProperties(Branch.IChannelProperties channelPropertiesCallback)
channelPropertiesCallback
- A Branch.IChannelProperties
instance for customizing sharing properties for channels.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder addPreferredSharingOption(SharingHelper.SHARE_WITH preferredOption)
Adds application to the preferred list of applications which are shown on share dialog. Only these options will be visible when the application selector dialog launches. Other options can be accessed by clicking "More"
preferredOption
- A list of applications to be added as preferred options on the app chooser.
Preferred applications are defined in SharingHelper.SHARE_WITH
.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder addPreferredSharingOptions(java.util.ArrayList<SharingHelper.SHARE_WITH> preferredOptions)
Adds application to the preferred list of applications which are shown on share dialog. Only these options will be visible when the application selector dialog launches. Other options can be accessed by clicking "More"
preferredOptions
- A list of applications to be added as preferred options on the app chooser.
Preferred applications are defined in SharingHelper.SHARE_WITH
.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder addParam(java.lang.String key, java.lang.String value)
key
- A String
with value for the key for the deep link paramsvalue
- A String
with deep link parameters valueBranch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setDefaultURL(java.lang.String url)
Set a default url to share in case there is any error creating the deep link
url
- A String
with value of default url to be shared with the selected application in case deep link creation fails.Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setMoreOptionStyle(android.graphics.drawable.Drawable icon, java.lang.String label)
Set the icon and label for the option to expand the application list to see more options. Default label is set to "More"
icon
- Drawable to set as the icon for more option. Default icon is system menu_more icon.label
- A String
with value for the more option label. Default label is "More"Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setMoreOptionStyle(int drawableIconID, int stringLabelID)
Set the icon and label for the option to expand the application list to see more options. Default label is set to "More"
drawableIconID
- Resource ID for the drawable to set as the icon for more option. Default icon is system menu_more icon.stringLabelID
- Resource ID for String label for the more option. Default label is "More"Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setCopyUrlStyle(android.graphics.drawable.Drawable icon, java.lang.String label, java.lang.String message)
Set the icon, label and success message for copy url option. Default label is "Copy link".
icon
- Drawable to set as the icon for copy url option. Default icon is system menu_save iconlabel
- A String
with value for the copy url option label. Default label is "Copy link"message
- A String
with value for a toast message displayed on copying a url.
Default message is "Copied link to clipboard!"Branch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setCopyUrlStyle(int drawableIconID, int stringLabelID, int stringMessageID)
Set the icon, label and success message for copy url option. Default label is "Copy link".
drawableIconID
- Resource ID for the drawable to set as the icon for copy url option. Default icon is system menu_save iconstringLabelID
- Resource ID for the string label the copy url option. Default label is "Copy link"stringMessageID
- Resource ID for the string message to show toast message displayed on copying a urlBranch.ShareLinkBuilder
instance.public Branch.ShareLinkBuilder setAlias(java.lang.String alias)
Sets the alias for this link.
alias
- Link 'alias' can be used to label the endpoint on the link.
For example: http://bnc.lt/AUSTIN28. Should not exceed 128 characters
public Branch.ShareLinkBuilder setMatchDuration(int matchDuration)
Sets the amount of time that Branch allows a click to remain outstanding.
matchDuration
- A Integer
value specifying the time that Branch allows a click to
remain outstanding and be eligible to be matched with a new app session.public Branch.ShareLinkBuilder setAsFullWidthStyle(boolean setFullWidthStyle)
Sets the share dialog to full width mode. Full width mode will show a non modal sheet with entire screen width.
setFullWidthStyle
- Boolean
With value true if a full width style share sheet is desired.public Branch.ShareLinkBuilder setDialogThemeResourceID(int styleResourceID)
Sets the given resource id as the theme id for share sheet dialog view.
styleResourceID
- the id of the theme to be applied to the share sheet dialog.public Branch.ShareLinkBuilder setDividerHeight(int height)
height
- The new height of the divider in pixels.public Branch.ShareLinkBuilder setSharingTitle(java.lang.String title)
title
- String
containing the value for the title text.public Branch.ShareLinkBuilder setSharingTitle(android.view.View titleView)
titleView
- View
for setting the title.public Branch.ShareLinkBuilder setIconSize(int iconSize)
iconSize
- int
for setting the share sheet icon size.public Branch.ShareLinkBuilder excludeFromShareSheet(java.lang.String packageName)
packageName
- String
package name to be excluded.public Branch.ShareLinkBuilder excludeFromShareSheet(java.lang.String[] packageName)
packageName
- String[]
package name to be excluded.public Branch.ShareLinkBuilder excludeFromShareSheet(java.util.List<java.lang.String> packageNames)
packageNames
- List
package name to be excluded.public Branch.ShareLinkBuilder includeInShareSheet(java.lang.String packageName)
packageName
- String
package name to be included.public Branch.ShareLinkBuilder includeInShareSheet(java.lang.String[] packageName)
packageName
- String[]
package name to be included.public Branch.ShareLinkBuilder includeInShareSheet(java.util.List<java.lang.String> packageNames)
packageNames
- List
package name to be included.public void setStyleResourceID(int resourceID)
Set the given style to the List View showing the share sheet
resourceID
- A Styleable resource to be applied to the share sheet list viewpublic void setShortLinkBuilderInternal(BranchShortLinkBuilder shortLinkBuilder)
public void shareLink()
Creates an application selector dialog and share a link with user selected sharing option. The link is created with the parameters provided to the builder.
public android.app.Activity getActivity()
public java.util.ArrayList<SharingHelper.SHARE_WITH> getPreferredOptions()
public Branch getBranch()
public java.lang.String getShareMsg()
public java.lang.String getShareSub()
public Branch.BranchLinkShareListener getCallback()
public Branch.IChannelProperties getChannelPropertiesCallback()
public java.lang.String getDefaultURL()
public android.graphics.drawable.Drawable getMoreOptionIcon()
public java.lang.String getMoreOptionText()
public android.graphics.drawable.Drawable getCopyUrlIcon()
public java.lang.String getCopyURlText()
public java.lang.String getUrlCopiedMessage()
public BranchShortLinkBuilder getShortLinkBuilder()
public boolean getIsFullWidthStyle()
public int getDialogThemeResourceID()
public int getDividerHeight()
public java.lang.String getSharingTitle()
public android.view.View getSharingTitleView()
public int getStyleResourceID()
public int getIconSize()