目录

shortcut-button (1083+)

Overview

Adds a home screen shortcut.

To use this element without affecting user experience, you must tell users that an icon is added to the home screen after this element is tapped.

Application Scope

Item

Description

Applicable devices

Mobile phones, tablets, and telematics devices

Applicable regions

Global

Subelements

None

Attribute

In addition to general attributes, the attribute listed in the following table is supported.

Attribute

Type

Default Value

Mandatory

Description

value

string

-

No

Text of the element.

Styles

In addition to common styles, the styles listed in the following table are supported.

Attribute

Type

Default Value

Mandatory

Description

color

color

rgba(0, 0, 0, 0.87)

No

Initial text color of a button.

font-size

number

37.5px

No

Font size.

width

length | percentage

128px

No

Element width.

height

length

70px

No

Element height.

Events

In addition to common events, the events listed in the following table are supported.

Attribute

Parameter

Description

click

{eventStatusCode: eventStatusCodeValue, eventMessage: eventMessageValue}

A user taps the element.

  • eventStatusCode:
    • Returns 200 if the shortcut already exists.
    • Returns 200 if no permission to add the shortcut.
    • Returns 0 when the shortcut is added successfully.
  • eventMessage:
    • Returns shortcut already exists when the shortcut already exists.
    • Returns createShortCut failed if there is no permission to add the shortcut.
    • Returns createShortCut success when the shortcut is added successfully.
NOTE:

For Android 8 and earlier versions, eventStatusCode returns 0 and eventMessage returns createShortCut success no matter whether a shortcut is added successfully.

Version Change History

Version

Date

Description

1083

2022-03-21

First official release.