-
public class ShareSheetStyleClass for defining the share sheet properties. Defines the properties of share sheet. Use this class customise the share sheet style.
-
-
Constructor Summary
Constructors Constructor Description ShareSheetStyle(Context context, String messageTitle, String messageBody)
-
Method Summary
Modifier and Type Method Description ShareSheetStylesetDefaultURL(String url)Set a default url to share in case there is any error creating the deep link ShareSheetStylesetMoreOptionStyle(Drawable icon, String label)Set the icon and label for the option to expand the application list to see more options. ShareSheetStylesetMoreOptionStyle(@DrawableRes() int drawableIconID, @StringRes() int stringLabelID)Set the icon and label for the option to expand the application list to see more options. ShareSheetStylesetCopyUrlStyle(Drawable icon, String label, String message)Set the icon, label and success message for copy url option. ShareSheetStylesetCopyUrlStyle(@DrawableRes() int drawableIconID, @StringRes() int stringLabelID, @StringRes() int stringMessageID)Set the icon, label and success message for copy url option. ShareSheetStyleaddPreferredSharingOption(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. ShareSheetStylesetStyleResourceID(@StyleRes() int styleResourceID)Set the given style to the List View showing the share sheet ShareSheetStylesetDialogThemeResourceID(@StyleRes() int styleResourceID)Set the given style to the dialog showing the share sheet ShareSheetStylesetAsFullWidthStyle(boolean setFullWidthStyle)Sets the share dialog to full width mode. ShareSheetStylesetDividerHeight(int height)Set the height for the divider for the sharing channels in the list. ShareSheetStylesetSharingTitle(String title)Set the title for the sharing dialog ShareSheetStylesetSharingTitle(View titleView)Set the title for the sharing dialog ShareSheetStyleexcludeFromShareSheet(@NonNull() String packageName)Exclude items from the ShareSheet by package name String. ShareSheetStyleexcludeFromShareSheet(@NonNull() Array<String> packageName)Exclude items from the ShareSheet by package name array. ShareSheetStyleexcludeFromShareSheet(@NonNull() List<String> packageNames)Exclude items from the ShareSheet by package name List. ShareSheetStyleincludeInShareSheet(@NonNull() String packageName)Include items from the ShareSheet by package name String. ShareSheetStyleincludeInShareSheet(@NonNull() Array<String> packageName)Include items from the ShareSheet by package name Array. ShareSheetStyleincludeInShareSheet(@NonNull() List<String> packageNames)Include items from the ShareSheet by package name List. ShareSheetStylesetIconSize(int iconSize)Set icon size (converted to DP) for the sharing dialog List<String>getExcludedFromShareSheet()List<String>getIncludedInShareSheet()ArrayList<SharingHelper.SHARE_WITH>getPreferredOptions()DrawablegetCopyUrlIcon()DrawablegetMoreOptionIcon()StringgetMessageBody()StringgetMessageTitle()StringgetCopyURlText()StringgetDefaultURL()StringgetMoreOptionText()StringgetUrlCopiedMessage()intgetDividerHeight()StringgetSharingTitle()ViewgetSharingTitleView()booleangetIsFullWidthStyle()intgetDialogThemeResourceID()intgetStyleResourceID()intgetIconSize()-
-
Method Detail
-
setDefaultURL
ShareSheetStyle setDefaultURL(String url)
Set a default url to share in case there is any error creating the deep link
- Parameters:
url- A String with value of default url to be shared with the selected application in case deep link creation fails.
-
setMoreOptionStyle
ShareSheetStyle setMoreOptionStyle(Drawable icon, 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"
- Parameters:
icon- Drawable to set as the icon for more option.label- A String with value for the more option label.
-
setMoreOptionStyle
ShareSheetStyle setMoreOptionStyle(@DrawableRes() int drawableIconID, @StringRes() 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"
- Parameters:
drawableIconID- Resource ID for the drawable to set as the icon for more option.stringLabelID- Resource ID for String label for the more option.
-
setCopyUrlStyle
ShareSheetStyle setCopyUrlStyle(Drawable icon, String label, String message)
Set the icon, label and success message for copy url option. Default label is "Copy link".
-
setCopyUrlStyle
ShareSheetStyle setCopyUrlStyle(@DrawableRes() int drawableIconID, @StringRes() int stringLabelID, @StringRes() int stringMessageID)
Set the icon, label and success message for copy url option. Default label is "Copy link".
- Parameters:
drawableIconID- Resource ID for the drawable to set as the icon for copy url option.stringLabelID- Resource ID for the string label the copy url option.stringMessageID- Resource ID for the string message to show toast message displayed on copying a url
-
addPreferredSharingOption
ShareSheetStyle 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 beaccessed by clicking "More"
- Parameters:
preferredOption- A list of applications to be added as preferred options on the app chooser.
-
setStyleResourceID
ShareSheetStyle setStyleResourceID(@StyleRes() int styleResourceID)
Set the given style to the List View showing the share sheet
- Parameters:
styleResourceID- A Styleable resource to be applied to the share sheet list view
-
setDialogThemeResourceID
ShareSheetStyle setDialogThemeResourceID(@StyleRes() int styleResourceID)
Set the given style to the dialog showing the share sheet
- Parameters:
styleResourceID- A Styleable resource to be applied to the share sheet dialog view
-
setAsFullWidthStyle
ShareSheetStyle setAsFullWidthStyle(boolean setFullWidthStyle)
Sets the share dialog to full width mode. Full width mode will show a non modal sheet with entire screen width.
- Parameters:
setFullWidthStyle- Boolean With value true if a full width style share sheet is desired.
-
setDividerHeight
ShareSheetStyle setDividerHeight(int height)
Set the height for the divider for the sharing channels in the list. Set this to zero to remove the dividers
- Parameters:
height- The new height of the divider in pixels.
-
setSharingTitle
ShareSheetStyle setSharingTitle(String title)
Set the title for the sharing dialog
- Parameters:
title- String containing the value for the title text.
-
setSharingTitle
ShareSheetStyle setSharingTitle(View titleView)
Set the title for the sharing dialog
- Parameters:
titleView- View for setting the title.
-
excludeFromShareSheet
ShareSheetStyle excludeFromShareSheet(@NonNull() String packageName)
Exclude items from the ShareSheet by package name String.
- Parameters:
packageName- String package name to be excluded.
-
excludeFromShareSheet
ShareSheetStyle excludeFromShareSheet(@NonNull() Array<String> packageName)
Exclude items from the ShareSheet by package name array.
- Parameters:
packageName- String package name to be excluded.
-
excludeFromShareSheet
ShareSheetStyle excludeFromShareSheet(@NonNull() List<String> packageNames)
Exclude items from the ShareSheet by package name List.
- Parameters:
packageNames- List package name to be excluded.
-
includeInShareSheet
ShareSheetStyle includeInShareSheet(@NonNull() String packageName)
Include items from the ShareSheet by package name String. If only "com.Slack"is included, then only preferred sharing options + Slackwill be displayed, for example.
- Parameters:
packageName- String package name to be included.
-
includeInShareSheet
ShareSheetStyle includeInShareSheet(@NonNull() Array<String> packageName)
Include items from the ShareSheet by package name Array. If only "com.Slack"is included, then only preferred sharing options + Slackwill be displayed, for example.
- Parameters:
packageName- String package name to be included.
-
includeInShareSheet
ShareSheetStyle includeInShareSheet(@NonNull() List<String> packageNames)
Include items from the ShareSheet by package name List. If only "com.Slack"is included, then only preferred sharing options + Slackwill be displayed, for example.
- Parameters:
packageNames- List package name to be included.
-
setIconSize
ShareSheetStyle setIconSize(int iconSize)
Set icon size (converted to DP) for the sharing dialog
- Parameters:
iconSize- for setting the share sheet icon size.
-
getExcludedFromShareSheet
List<String> getExcludedFromShareSheet()
-
getIncludedInShareSheet
List<String> getIncludedInShareSheet()
-
getPreferredOptions
ArrayList<SharingHelper.SHARE_WITH> getPreferredOptions()
-
getCopyUrlIcon
Drawable getCopyUrlIcon()
-
getMoreOptionIcon
Drawable getMoreOptionIcon()
-
getMessageBody
String getMessageBody()
-
getMessageTitle
String getMessageTitle()
-
getCopyURlText
String getCopyURlText()
-
getDefaultURL
String getDefaultURL()
-
getMoreOptionText
String getMoreOptionText()
-
getUrlCopiedMessage
String getUrlCopiedMessage()
-
getDividerHeight
int getDividerHeight()
-
getSharingTitle
String getSharingTitle()
-
getSharingTitleView
View getSharingTitleView()
-
getIsFullWidthStyle
boolean getIsFullWidthStyle()
-
getDialogThemeResourceID
int getDialogThemeResourceID()
-
getStyleResourceID
int getStyleResourceID()
-
getIconSize
int getIconSize()
-
-
-
-