Google 致力于为黑人社区推动种族平等。查看具体举措

ShortcutManagerCompat

open class ShortcutManagerCompat
kotlin.Any
   ↳ androidx.core.content.pm.ShortcutManagerCompat

Helper for accessing features in android.content.pm.ShortcutManager.

Summary

Constants
static String

Key to get the shortcut ID from extras of a share intent.

static Int

Include cached shortcuts in the result.

static Int

Include dynamic shortcuts in the result.

static Int

Include manifest shortcuts in the result.

static Int

Include pinned shortcuts in the result.

Public methods
open static Boolean
addDynamicShortcuts(@NonNull context: Context, @NonNull shortcutInfoList: MutableList<ShortcutInfoCompat!>)

Publish the list of dynamic shortcuts.

open static Intent
createShortcutResultIntent(@NonNull context: Context, @NonNull shortcut: ShortcutInfoCompat)

Returns an Intent which can be used by the launcher to pin shortcut.

open static Unit
disableShortcuts(@NonNull context: Context, @NonNull shortcutIds: MutableList<String!>, @Nullable disabledMessage: CharSequence?)

Disable pinned shortcuts, showing the user a custom error message when they try to select the disabled shortcuts.

open static Unit
enableShortcuts(@NonNull context: Context, @NonNull shortcutInfoList: MutableList<ShortcutInfoCompat!>)

Re-enable pinned shortcuts that were previously disabled.

open static MutableList<ShortcutInfoCompat!>
getDynamicShortcuts(@NonNull context: Context)

Return all dynamic shortcuts from the caller app.

open static Int
getIconMaxHeight(@NonNull context: Context)

Return the max height for icons, in pixels.

open static Int
getIconMaxWidth(@NonNull context: Context)

Return the max width for icons, in pixels.

open static Int

open static MutableList<ShortcutInfoCompat!>
getShortcuts(@NonNull context: Context, matchFlags: Int)

Returns ShortcutInfoCompats that match matchFlags.

open static Boolean
isRateLimitingActive(@NonNull context: Context)

Return true when rate-limiting is active for the caller app.

open static Boolean

open static Boolean
pushDynamicShortcut(@NonNull context: Context, @NonNull shortcut: ShortcutInfoCompat)

Publish a single dynamic shortcut.

open static Unit

Delete all dynamic shortcuts from the caller app.

open static Unit
removeDynamicShortcuts(@NonNull context: Context, @NonNull shortcutIds: MutableList<String!>)

Delete dynamic shortcuts by ID.

open static Unit
removeLongLivedShortcuts(@NonNull context: Context, @NonNull shortcutIds: MutableList