java.lang.Object | ||
↳ | net.pierrox.lightning_launcher.script.api.Item | |
↳ | net.pierrox.lightning_launcher.script.api.Shortcut |
![]() |
A shortcut is a label and an icon, tapping on it will usually launch an app. It is used for both so called 'apps' and 'shortcuts' because these two objects are really the same thing (technically)
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Image |
getCustomIcon()
Retrieve the custom icon file associated with this shortcut.
| ||||||||||
Image |
getDefaultIcon()
Retrieve the default icon file associated to this shortcut.
| ||||||||||
Image |
getIconLayer(String which)
Retrieve the image currently used in a shortcut icon layer.
| ||||||||||
Image |
getImage()
Retrieves the live image for this shortcut as displayed on a given screen
This is the image which results in compositing the default or custom icon with various options, such as reflection.
| ||||||||||
Intent |
getIntent()
Return the intent associated with this shortcut
| ||||||||||
String |
getLabel()
Returns the label of this shortcut.
| ||||||||||
void |
launch()
Launch the intent associated with this shortcut.
| ||||||||||
void |
setCustomIcon(Image image)
Set a new custom icon for this item.
| ||||||||||
void |
setDefaultIcon(Image image)
Set a new icon for this item.
| ||||||||||
void |
setIconLayer(Image image, String which, boolean persistent)
Set an icon layer image (background, overlay, mask), persistently.
| ||||||||||
void |
setIconLayer(Image image, String which)
Set an icon layer image (background, overlay, mask).
| ||||||||||
void |
setImage(Image image)
Replaces the current live image on a given screen.
| ||||||||||
void |
setIntent(Intent intent)
Set the intent launched by this shortcut.
| ||||||||||
void |
setLabel(String label, boolean persistent)
Set the label of this shortcut, possibly making the change persistent.
| ||||||||||
void |
setLabel(String label)
Set the label of this shortcut.
| ||||||||||
String |
toString()
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Retrieve the custom icon file associated with this shortcut. The custom icon overrides the default icon but the default icon is kept so that the shortcut can be reverted to its original state.
Retrieve the default icon file associated to this shortcut. For an app this is the original icon defined by the package.
Retrieve the image currently used in a shortcut icon layer. This image can be shared amongst several items.
which | either "b" for background, "o" for overlay, "m" for mask |
---|
Retrieves the live image for this shortcut as displayed on a given screen This is the image which results in compositing the default or custom icon with various options, such as reflection. This image is in RAM only.
Return the intent associated with this shortcut
Returns the label of this shortcut.
Launch the intent associated with this shortcut. This generic method does nothing when the script is run in background: in this context an app or shortcut can be launched using LL.getContext().startActivity(item.getIntent)); instead.
Set a new custom icon for this item. Saving animations is experimental.
Set a new icon for this item. Saving animations is experimental.
image | using a null object will delete the icon |
---|
Set an icon layer image (background, overlay, mask), persistently. This method behaves differently according to the persistent parameter. If set to false, the method will behave as #setIconLayer(Image,String), otherwise the modification will be persistent and will only affect this item. Usage of ImageAnimation is currently not supported (only the first frame will be displayed).
which | either "b" for background, "o" for overlay, "m" for mask |
---|---|
persistent | whether to save changes and affect only this item |
Set an icon layer image (background, overlay, mask). Note: since the image is set on the shortcut configuration, which can be shared by several items, it may be that the modification is visible on other items Usage of ImageAnimation is currently not supported.
which | either "b" for background, "o" for overlay, "m" for mask |
---|
Replaces the current live image on a given screen. This is done in RAM only and has no impact on default or custom icons.
Set the intent launched by this shortcut.
Set the label of this shortcut, possibly making the change persistent.
label | new value for the label |
---|
Set the label of this shortcut. Note that changes will not be persisted, and the item can still be retrieved using its original name. Same as calling
setLabel(label, false);.
label | new value for the label |
---|