Builder
open class Builder
kotlin.Any | |
↳ | androidx.core.content.pm.ShortcutInfoCompat.Builder |
Builder class for ShortcutInfoCompat
objects.
Summary
Public constructors | |
---|---|
Public methods | |
---|---|
open ShortcutInfoCompat |
build() Creates a |
open ShortcutInfoCompat.Builder |
setActivity(@NonNull activity: ComponentName) Sets the target activity. |
open ShortcutInfoCompat.Builder |
Badges the icon before passing it over to the Launcher. |
open ShortcutInfoCompat.Builder |
setCategories(@NonNull categories: MutableSet<String!>) Sets categories for a shortcut. |
open ShortcutInfoCompat.Builder |
setDisabledMessage(@NonNull disabledMessage: CharSequence) Sets the message that should be shown when the user attempts to start a shortcut that is disabled. |
open ShortcutInfoCompat.Builder |
setExtras(@NonNull extras: PersistableBundle) Extras that the app can set for any purpose. |
open ShortcutInfoCompat.Builder |
setIcon(icon: IconCompat!) Sets an icon of a shortcut. |
open ShortcutInfoCompat.Builder |
Sets the intent of a shortcut. |
open ShortcutInfoCompat.Builder |
setIntents(@NonNull intents: Array<Intent!>) Sets multiple intents instead of a single intent, in order to launch an activity with other activities in back stack. |
open ShortcutInfoCompat.Builder |
Sets the corresponding fields indicating this shortcut is aimed for conversation. |
open ShortcutInfoCompat.Builder |
setLocusId(@Nullable locusId: LocusIdCompat?) Sets the |
open ShortcutInfoCompat.Builder |
setLongLabel(@NonNull longLabel: CharSequence) Sets the text of a shortcut. |
open ShortcutInfoCompat.Builder | |
open ShortcutInfoCompat.Builder |
setLongLived(longLived: Boolean) Sets if a shortcut would be valid even if it has been unpublished/invisible by the app (as a dynamic or pinned shortcut). |
open ShortcutInfoCompat.Builder |
Associate a person to a shortcut. |
open ShortcutInfoCompat.Builder |
setPersons(@NonNull persons: Array<Person!>) Sets multiple persons instead of a single person. |
open ShortcutInfoCompat.Builder |
Sets rank of a shortcut, which is a non-negative value that's used by the system to sort shortcuts. |
open ShortcutInfoCompat.Builder |
setShortLabel(@NonNull shortLabel: CharSequence) Sets the short title of a shortcut. |
Public constructors
Public methods
setActivity
@NonNull open fun setActivity(@NonNull activity: ComponentName): ShortcutInfoCompat.Builder
Sets the target activity. A shortcut will be shown along with this activity's icon on the launcher.
setAlwaysBadged
@NonNull open fun setAlwaysBadged(): ShortcutInfoCompat.Builder
Badges the icon before passing it over to the Launcher.
Launcher automatically badges ShortcutInfo
, so only the legacy shortcut icon, Intent.ShortcutIconResource
is badged. This field is ignored when using ShortcutInfo
on API 25 and above.
If the shortcut is associated with an activity, the activity icon is used as the badge, otherwise application icon is used.
See Also
setCategories
@NonNull open fun setCategories(@NonNull categories: MutableSet<String!>): ShortcutInfoCompat.Builder
Sets categories for a shortcut.
- Launcher apps may use this information to categorize shortcuts
- Used by the system to associate a published Sharing Shortcut with supported mimeTypes. Required for published Sharing Shortcuts with a matching category declared in share targets, defined in the app's manifest linked shortcuts xml file.
See Also
setDisabledMessage
@NonNull open fun setDisabledMessage(@NonNull disabledMessage