mirror of
https://github.com/TrianguloY/LightningLauncher.git
synced 2024-12-26 09:58:20 +01:00
Added entry points for almost all classes (An instance of this object can be create/retrieved with...)
This commit is contained in:
parent
909a54d8f9
commit
0fb38829da
31 changed files with 61 additions and 9 deletions
|
@ -2,6 +2,7 @@ package net.pierrox.lightning_launcher.script.api;
|
|||
|
||||
/**
|
||||
* A binding links a "target" (a property) with a "formula" (a value).
|
||||
* An instance of this object can be created with {@link #Binding(String, String, boolean)}; or retrieved with {@link Item#getBindingByTarget(String)} or {@link Item#getBindings()}.
|
||||
*/
|
||||
public class Binding {
|
||||
private boolean enabled;
|
||||
|
|
|
@ -23,7 +23,9 @@ import net.pierrox.lightning_launcher.data.Utils;
|
|||
* <li>Padding bottom:<b>pb</b></li>
|
||||
* <li>Content:<b>c</b></li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* An instance of this object can be retrieved with {@link PropertyEditor#getBox(String)} or {@link PropertySet#getBox(String)}.
|
||||
*
|
||||
* Example of using the Box object to change item properties:
|
||||
* <pre>
|
||||
* var color = 0xff00ff00; // pure green
|
||||
|
|
|
@ -27,6 +27,8 @@ import org.mozilla.javascript.Scriptable;
|
|||
|
||||
/**
|
||||
* The container can be either a desktop, a folder or a panel. Its role is to manage items inside.
|
||||
*
|
||||
* An instance of this object can be retrieved with {@link Event#getContainer()}, {@link Item#getParent()}, {@link Folder#getContainer()}, {@link Panel#getContainer()}, {@link net.pierrox.lightning_launcher.script.api.screen.Screen#getContainerById(int)}, {@link net.pierrox.lightning_launcher.script.api.screen.Screen#getAllContainersById(int)} or {@link Screen#getFocusedContainer()}; or by using directly the special variable 'container' (which is the current Container) when running a 'Menu' event.
|
||||
*/
|
||||
public class Container {
|
||||
public static final int NONE = Page.NONE;
|
||||
|
|
|
@ -8,6 +8,8 @@ import net.pierrox.lightning_launcher.views.item.ItemView;
|
|||
|
||||
/**
|
||||
* A CustomView is an advance special item that can display any Android View.
|
||||
*
|
||||
* An instance of this object can be retrieved with {@link Container#addCustomView(float, float)}; or with any function that returns an {@link Item} when that returned item is a CustomView; or by using directly the special variable 'item' (which is the current CustomView) when running a 'Create/Destroy script' event.
|
||||
*/
|
||||
public class CustomView extends Item {
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,8 @@ import net.pierrox.lightning_launcher.views.ItemLayout;
|
|||
/**
|
||||
* The desktop is a kind of container, and is typically displayed as the home screen.
|
||||
* It includes all capabilities of the base container, plus some other ones specific to desktops.
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns a {@link Container} when that returned container is a Desktop; or with {@link net.pierrox.lightning_launcher.script.api.screen.HomeScreen#getDesktopByName(String)} or {@link net.pierrox.lightning_launcher.script.api.screen.Screen#getCurrentDesktop()}.
|
||||
*/
|
||||
public class Desktop extends Container {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.pierrox.lightning_launcher.views.item.ItemView;
|
|||
|
||||
/**
|
||||
* The event gather useful data dealing with the context of the event, such as which item caused the script to be executed, or what was the container at time of the event.
|
||||
* @see Lightning#getEvent_().
|
||||
* An instance of this object can be retrieved with {@link Lightning#getEvent_()}.
|
||||
*/
|
||||
public class Event {
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ import net.pierrox.lightning_launcher.data.EventAction;
|
|||
* Describe an event handler made of an action, some optional data and possibly a handler to execute after this one.
|
||||
* Handlers are chained in a linked list. The last handler in the list has no next.
|
||||
* When modifying an EventHandler acquired from {@link PropertySet#getEventHandler(String)}, you still need to call {@link PropertyEditor#setEventHandler(String, EventHandler)} to save changes.
|
||||
*
|
||||
* An instance of this object can be created with {@link #EventHandler(int, String)}; or retrieved with {@link PropertySet#getEventHandler(String)}.
|
||||
*/
|
||||
public class EventHandler {
|
||||
public static final int UNSET=0;
|
||||
|
|
|
@ -12,7 +12,9 @@ import net.pierrox.lightning_launcher.views.item.ItemView;
|
|||
import java.io.File;
|
||||
|
||||
/**
|
||||
* The folder item extends the shortcut (because it have a label and an icon) and add folder specific services such as open/close.
|
||||
* The folder item extends the shortcut (because it have a label and an icon) and add folder specific services such as open/close.
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns a {@link Shortcut} when that returned shortcut is a Folder; or with {@link Container#addFolder(String, float, float)} or {@link net.pierrox.lightning_launcher.script.api.screen.Screen#getOpenFolders()}.
|
||||
*/
|
||||
public class Folder extends Shortcut {
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ import java.lang.reflect.Field;
|
|||
* Utility class to manipulate images (icons, backgrounds, etc.).
|
||||
* This is the base class for various kind of images. Each image type (bitmap, nine patch, animation, scripted) have their own set of features.
|
||||
* Please refer to their respective documentation.
|
||||
*
|
||||
* An instance of this object can be created with {@link #createImage(String)}, {@link #createImage(String, String)}, {@link #fromDrawable(Lightning, Drawable, Item, File)}; or retrieved with {@link Folder#getWindowBackground()}, {@link net.pierrox.lightning_launcher.script.api.Item#getBoxBackground(String)}, {@link Shortcut#getDefaultIcon()}, {@link Shortcut#getCustomIcon()}, {@link Shortcut#getImage()}, {@link Shortcut#getIconLayer(String)} or {@link net.pierrox.lightning_launcher.script.api.screen.ActivityScreen#pickImage(int)}.
|
||||
*/
|
||||
public abstract class Image {
|
||||
protected Lightning mLightning;
|
||||
|
|
|
@ -12,6 +12,8 @@ import java.io.File;
|
|||
* A kind of image which can play an animation (often loaded from GIF files).
|
||||
*
|
||||
* <b>Note</b>: as of today backgrounds and icon layers do not support animations, only the first frame will be displayed.
|
||||
*
|
||||
* An instance of this object can be created with {@link Image#createAnimation(int, int, int, int, int)}; or retrieved with any function that returns an {@link Image} when that image is an ImageAnimation.
|
||||
*/
|
||||
public class ImageAnimation extends Image {
|
||||
private SharedAsyncGraphicsDrawable mDrawable;
|
||||
|
|
|
@ -19,6 +19,8 @@ import java.io.IOException;
|
|||
/**
|
||||
* Wraps a static bitmap.
|
||||
* Such an image can be loaded from file, created using {@link Image#createImage(int, int)}, or obtained from items icons.
|
||||
*
|
||||
* An instance of this object can be created with {@link Image#createImage(int, int)} or {@link Image#createTextIcon(String, int, int, int, Typeface)}; or retrieved with any function that returns an {@link Image} when that image is an ImageBitmap; or with {@link ImageAnimation#getFrameImage(int)} or {@link net.pierrox.lightning_launcher.script.api.screen.ActivityScreen#cropImage(ImageBitmap, boolean)}.
|
||||
*/
|
||||
public class ImageBitmap extends Image {
|
||||
private Bitmap mBitmap;
|
||||
|
|
|
@ -6,6 +6,8 @@ import android.graphics.drawable.NinePatchDrawable;
|
|||
|
||||
/**
|
||||
* Wraps a Nine Patch image.
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns an {@link Image} when that image is an ImageNinePatch.
|
||||
*/
|
||||
public class ImageNinePatch extends Image {
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@ import org.mozilla.javascript.Scriptable;
|
|||
/**
|
||||
* ImageScript is a way to draw images or animations without the need for intermediate bitmaps.
|
||||
* Such images are scalable and memory efficient.
|
||||
* Instances of ImageScript can be created with {@link Image#createImage(Scriptable, int, int)}.
|
||||
*
|
||||
* An instance of this object can be created with {@link Image#createImage(Scriptable, int, int)}; or retrieved with any function that returns an {@link Image} when that image is an ImageScript.
|
||||
*
|
||||
* The Scriptable object must have a "draw" function, and optionally a "pause" and "resume" functions. These functions are called with a DrawingContext instance.
|
||||
* <br/><br/>
|
||||
|
|
|
@ -7,6 +7,8 @@ import net.pierrox.android.lsvg.SvgDrawable;
|
|||
|
||||
/**
|
||||
* An image backed by a SVG document
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns an {@link Image} when that image is an ImageSvg.
|
||||
*/
|
||||
|
||||
public class ImageSvg extends Image {
|
||||
|
|
|
@ -34,6 +34,8 @@ import org.mozilla.javascript.Scriptable;
|
|||
*
|
||||
* Since Lightning V14 allows the same container to be displayed multiple times on the same screen, it is possible to retrieve
|
||||
* several Item objects linked with the same underlying data. The identifier (see {@link #getId()}) will then be the same.
|
||||
*
|
||||
* An instance of this object can be retrieved with {@link Event#getItem()}, {@link Screen#getItemById(int)}, {@link Screen#getAllItemsById(int)}, {@link Container#getAllItems()}, {@link Container#getItemById(int)}, {@link Container#getItemByName(String)}, {@link Container#cloneItem(Item)}, {@link Container#moveItem(Item, Container)}, {@link Container#getOpener()} or {@link ImageScript.DrawingContext#getItem()}; or by using directly the special variable 'item' (which is the current Item) when running a 'Menu' event.
|
||||
*/
|
||||
public class Item {
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import org.mozilla.javascript.Function;
|
|||
|
||||
/**
|
||||
* Provides an access to the popup menu, so that it can be customized.
|
||||
*
|
||||
* An instance of this object can be retrieved by using directly the special variable 'menu' (which is the current Menu) when running a 'Menu' event.
|
||||
*/
|
||||
public class Menu {
|
||||
/** Main item menu in edit mode */
|
||||
|
|
|
@ -4,6 +4,8 @@ import net.pierrox.lightning_launcher.views.item.ItemView;
|
|||
|
||||
/**
|
||||
* Represents a Page Indicator Item. No extra methods available.
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns an {@link Item} when that returned item is a PageIndicator; or with {@link Container#addPageIndicator(float, float)}.
|
||||
*/
|
||||
public class PageIndicator extends Item {
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,8 @@ import net.pierrox.lightning_launcher.views.item.ItemView;
|
|||
|
||||
/**
|
||||
* The panel is a special kind of item, providing access to items contained in this panel.
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns an {@link Item} when that returned item is a Panel; or with {@link Container#addPanel(float, float, float, float)}.
|
||||
*/
|
||||
public class Panel extends Item {
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ import java.util.LinkedHashMap;
|
|||
|
||||
/**
|
||||
* Enumeration class. Represents a Property object {@see PropertySet} {@see PropertyEditor}.
|
||||
*
|
||||
* An instance of this object can be created with {@link #getByName(String)}.
|
||||
*/
|
||||
public class Property {
|
||||
public static final int TYPE_UNKNOWN = -1;
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.HashMap;
|
|||
|
||||
/**
|
||||
* Utility to modify one or more configuration settings at once. Modify one or more properties using the same PropertyEditor, then call {@link #commit()} to validate changes.
|
||||
* This object is retrieved using {@link PropertySet#edit()}. You can chain calls this way:
|
||||
* An instance of this object can be retrieved with {@link PropertySet#edit()}. You can chain calls this way:
|
||||
* <pre><code>
|
||||
* property_set.edit()
|
||||
* .setInteger("someProperty", some_value)
|
||||
|
|
|
@ -30,6 +30,9 @@ import android.util.Pair;
|
|||
* <li>Page Indicator: item, shortcut and page indicator properties</li>
|
||||
* <li>Other objects: contains item properties only</li>
|
||||
* </ul>
|
||||
*
|
||||
* An instance of this object can be retrieved with {@link Item#getProperties()}, {@link Container#getProperties()} or {@link Configuration#getProperties()}.
|
||||
*
|
||||
* The list of supported properties can be found below. Behavior when setting a value for a property marked as read only is unspecified and can lead to data loss.
|
||||
* The same may appear when setting a value out of its bounds. These cases are currently not checked.
|
||||
*
|
||||
|
|
|
@ -4,6 +4,8 @@ import android.graphics.Rect;
|
|||
|
||||
/**
|
||||
* A rectangle class in the format left-top-rigth-bottom.
|
||||
*
|
||||
* An instance of this object can be created with {@link #RectL(Rect)} or {@link #RectL(int, int, int, int)}; or retrieved with {@link Item#getCell()} or {@link Container#getBoundingBox()}.
|
||||
*/
|
||||
public class RectL {
|
||||
private int l, t, r, b;
|
||||
|
|
|
@ -9,6 +9,8 @@ import java.util.HashMap;
|
|||
/**
|
||||
* This object is used to access script properties such as text, tag and menu attributes.
|
||||
* Warning: this API is currently experimental.
|
||||
*
|
||||
* An instance of this object can be retrieved with {@link Lightning#getCurrentScript()}, {@link Lightning#getScriptByName(String)}, {@link Lightning#getScriptByPathAndName(String, String)}, {@link Lightning#getScriptById(String)}, {@link Lightning#createScript(String, String, String, int)} or {@link Lightning#getAllScriptMatching(int)}.
|
||||
*/
|
||||
public class Script {
|
||||
public static final int FLAG_ALL = net.pierrox.lightning_launcher.script.Script.FLAG_ALL;
|
||||
|
|
|
@ -18,7 +18,9 @@ import java.io.File;
|
|||
|
||||
/**
|
||||
* 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)
|
||||
* It is used for both so called 'apps' and 'shortcuts' because these two objects are really the same thing (technically)
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns an {@link Item} when that returned item is a Shortcut; or with {@link Container#addShortcut(String, Intent, float, float)}.
|
||||
*/
|
||||
public class Shortcut extends Item {
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ import net.pierrox.lightning_launcher.views.item.ItemView;
|
|||
|
||||
/**
|
||||
* The StopPoint object allows getting and setting stop points values.
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns an {@link Item} when that returned item is a StopPoint; or with {@link Container#addStopPoint(float, float)}.
|
||||
*/
|
||||
public class StopPoint extends Item {
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.ArrayList;
|
|||
|
||||
/**
|
||||
* A VariableEditor is a tool to change the value of one or more variable.
|
||||
* This object is retrieved using {@link VariableSet#edit()}. You can chain calls this way:
|
||||
* An instance of this object can be retrieved with {@link VariableSet#edit()}. You can chain calls this way:
|
||||
* <pre><code>
|
||||
* variable_set.edit()
|
||||
* .setInteger("someVariable", some_value)
|
||||
|
|
|
@ -7,6 +7,8 @@ import net.pierrox.lightning_launcher.engine.variable.VariableManager;
|
|||
/**
|
||||
* A VariableSet object enumerates known variables with their type and value.
|
||||
* It is also the entry point to modify variable through
|
||||
*
|
||||
* An instance of this object can be retrieved with {@link Lightning#getVariables()}.
|
||||
*/
|
||||
public class VariableSet {
|
||||
|
||||
|
|
|
@ -47,8 +47,7 @@ import java.util.List;
|
|||
* These can be retrieved from the appropriate getter method.
|
||||
*
|
||||
* <p>
|
||||
* Instances can be created with the synchronous factory methods {@link #generate(android.graphics.Bitmap)} and
|
||||
* {@link #generate(android.graphics.Bitmap, int)}.
|
||||
* An instance of this object can be created with {@link #generate(android.graphics.Bitmap)} or {@link #generate(android.graphics.Bitmap, int)}.
|
||||
* <p>
|
||||
* These should be called on a background thread, ideally the one in
|
||||
* which you load your images on. Sometimes that is not possible, so asynchronous factory methods
|
||||
|
|
|
@ -15,6 +15,8 @@ import org.mozilla.javascript.Function;
|
|||
|
||||
/**
|
||||
* A screen backed with an Android Activity.
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns an {@link Screen} when that returned Screen is an ActivityScreen; or with {@link Lightning#getAppDrawerScreen()} or {@link Lightning#getLockScreen()}.
|
||||
*/
|
||||
public class ActivityScreen extends Screen {
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,8 @@ import net.pierrox.lightning_launcher.views.ItemLayout;
|
|||
|
||||
/**
|
||||
* A specialized ActivityScreen used for the main home screen.
|
||||
*
|
||||
* An instance of this object can be retrieved with any function that returns an {@link ActivityScreen} when that returned ActivityScreen is a HomeScreen; or with {@link Lightning#getHomeScreen()}.
|
||||
*/
|
||||
public class HomeScreen extends ActivityScreen {
|
||||
/**
|
||||
|
|
|
@ -25,6 +25,8 @@ import java.util.ArrayList;
|
|||
* <li>the lock screen (see {@link ActivityScreen})</li>
|
||||
* <li>the floating desktop</li>
|
||||
* </ul>
|
||||
*
|
||||
* An instance of this object can be retrieved with {@link Event#getScreen()}, {@link Item#getScreen()}, {@link Lightning#getActiveScreen()}, {@link Lightning#getFloatingScreen()}, {@link Lightning#getLiveWallpaperScreen()}, {@link Lightning#getBackgroundScreen()}
|
||||
*/
|
||||
public class Screen {
|
||||
private static final String EVENT_SOURCE_SCRIPT = "RUN_SCRIPT";
|
||||
|
|
Loading…
Reference in a new issue