java.lang.Object | |
↳ | net.pierrox.lightning_launcher.script.api.screen.Screen |
Known Direct Subclasses |
Known Indirect Subclasses |
The screen is the surface where user interactions occur. Example of known screens are:
HomeScreen
)ActivityScreen
)ActivityScreen
)Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Container[] |
getAllContainersById(int id)
Returns all containers for a given id.
| ||||||||||
Item[] |
getAllItemsById(int id)
Returns all items for a given id.
| ||||||||||
Container |
getContainerById(int id)
Returns the first container found with this id.
| ||||||||||
Context |
getContext()
Return the Android Context this screen is linked with (an activity context for the home, app drawer and lock screens, a service context for the floating desktop).
| ||||||||||
Desktop |
getCurrentDesktop()
Returns the currently displayed desktop.
| ||||||||||
Container |
getFocusedContainer()
Returns the focused container.
| ||||||||||
Item |
getItemById(int id)
Returns an item by its id.
| ||||||||||
float |
getLastTouchScreenX()
Absolute X position in the screen space of the last touch event.
| ||||||||||
float |
getLastTouchScreenY()
Absolute Y position in the screen space of the last touch event.
| ||||||||||
float |
getLastTouchX()
Absolute X position in the container space of the last touch event.
| ||||||||||
float |
getLastTouchY()
Absolute Y position in the container space of the last touch event.
| ||||||||||
Folder[] |
getOpenFolders()
Returns the list of currently open folders.
| ||||||||||
boolean |
isPaused()
Returns whether the current screen is paused.
| ||||||||||
void |
runAction(int action, String data)
Same as #runAction(int,Item,String) with a null item and data.
| ||||||||||
void |
runAction(int action, Item item, String data)
Run a Lightning action.
| ||||||||||
void |
runAction(int action)
Same as #runAction(int,String) with a null data.
| ||||||||||
void |
runScript(String name, String data)
Run another script.
| ||||||||||
void |
runScript(String path, String name, String data)
Run another script.
| ||||||||||
boolean |
startActivity(Intent intent)
Start an activity.
| ||||||||||
String | toString() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Returns all containers for a given id. Warning: this is an expensive call.
Returns all items for a given id. Warning: this is an expensive call.
Returns the first container found with this id. As of Lightning V14, a single container may be displayed at several locations. This function returns the first one found, in no particular order. Calling this function can possibly be expensive because the container and its parents may have to be loaded on the fly.
Return the Android Context this screen is linked with (an activity context for the home, app drawer and lock screens, a service context for the floating desktop). This is meant to be used with Android services.
Returns the focused container. The focused container is usually the last touched container, or the last open folder. This can be either a desktop, folder or panel.
Returns an item by its id. This is a shortcut avoiding to traverse the list of all desktops and folders.
id | item identifier |
---|
Absolute X position in the screen space of the last touch event. This function returns Integer.MIN_VALUE if no touch has been registered yet.
Absolute Y position in the screen space of the last touch event. This function returns Integer.MIN_VALUE if no touch has been registered yet.
Absolute X position in the container space of the last touch event. This function returns Integer.MIN_VALUE if no touch has been registered yet.
Absolute Y position in the container space of the last touch event. This function returns Integer.MIN_VALUE if no touch has been registered yet.
Returns the list of currently open folders. This function returns the opener item, not the container itself. This method will return null when the script is executed in the background.
Returns whether the current screen is paused. It often means it is not displayed.
Same as #runAction(int,Item,String) with a null item and data.
Run a Lightning action. This method does nothing when the script is run in background.
action | action code (one of the values defined in EventHandler |
---|---|
item | item to be used as the target (only useful with actions requiring an item) |
data | optional data to send to be used by the action, use null if none |
Same as #runAction(int,String) with a null data.
Run another script. Same as calling runScript(null, name, data) with a null path.
Run another script.
Optional data can be transmitted to the called script and retrieved using getData()
.
path | path of the script (null to look in all directories) |
---|---|
name | name of the script as found in the script editor, optionally prefixed with its path |
data | optional data to send to the script. Use JSON to pass more than a string. |
Start an activity.
Example:
var intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.pierrox.net/")
LL.startActivity(intent);
intent | intent to start the activity |
---|