LightningLauncher-TrianguloY/app/llx/api_doc/html/reference/packages.html
2018-12-15 17:57:52 +01:00

314 lines
11 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="Javadoc API documentation." />
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
<title>
Package Index
</title>
<link href="./../assets/doclava-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="./../assets/customizations.css" rel="stylesheet" type="text/css" />
<script src="./../assets/search_autocomplete.js" type="text/javascript"></script>
<script src="./../assets/jquery-resizable.min.js" type="text/javascript"></script>
<script src="./../assets/doclava-developer-docs.js" type="text/javascript"></script>
<script src="./../assets/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
setToRoot("./", "./../assets/");
</script>
<script src="./../assets/doclava-developer-reference.js" type="text/javascript"></script>
<script src="./../assets/navtree_data.js" type="text/javascript"></script>
<script src="./../assets/customizations.js" type="text/javascript"></script>
<noscript>
<style type="text/css">
html,body{overflow:auto;}
#body-content{position:relative; top:0;}
#doc-content{overflow:visible;border-left:3px solid #666;}
#side-nav{padding:0;}
#side-nav .toggle-list ul {display:block;}
#resize-packages-nav{border-bottom:3px solid #666;}
</style>
</noscript>
</head>
<body class="gc-documentation">
<div id="header">
<div id="headerLeft">
</div>
<div id="headerRight">
<div id="search" >
<div id="searchForm">
<form accept-charset="utf-8" class="gsc-search-box"
onsubmit="return submit_search()">
<table class="gsc-search-box" cellpadding="0" cellspacing="0"><tbody>
<tr>
<td class="gsc-input">
<input id="search_autocomplete" class="gsc-input" type="text" size="33" autocomplete="off"
title="search developer docs" name="q"
value="search developer docs"
onFocus="search_focus_changed(this, true)"
onBlur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, './')"
onkeyup="return search_changed(event, false, './')" />
<div id="search_filtered_div" class="no-display">
<table id="search_filtered" cellspacing=0>
</table>
</div>
</td>
<td class="gsc-search-button">
<input type="submit" value="Search" title="search" id="search-button" class="gsc-search-button" />
</td>
<td class="gsc-clear-button">
<div title="clear results" class="gsc-clear-button">&nbsp;</div>
</td>
</tr></tbody>
</table>
</form>
</div><!-- searchForm -->
</div><!-- search -->
</div>
</div><!-- header -->
<div class="g-section g-tpl-240" id="body-content">
<div class="g-unit g-first side-nav-resizable" id="side-nav">
<div id="swapper">
<div id="nav-panels">
<div id="resize-packages-nav">
<div id="packages-nav">
<div id="index-links">
<a href="./packages.html" class="selected" >Package Index</a> |
<a href="./classes.html" >Class Index</a>
</div>
<ul>
<li class="api apilevel-">
<a href="./net/pierrox/lightning_launcher/prefs/package-summary.html">net.pierrox.lightning_launcher.prefs</a></li>
<li class="api apilevel-">
<a href="./net/pierrox/lightning_launcher/script/api/package-summary.html">net.pierrox.lightning_launcher.script.api</a></li>
<li class="api apilevel-">
<a href="./net/pierrox/lightning_launcher/script/api/palette/package-summary.html">net.pierrox.lightning_launcher.script.api.palette</a></li>
<li class="api apilevel-">
<a href="./net/pierrox/lightning_launcher/script/api/screen/package-summary.html">net.pierrox.lightning_launcher.script.api.screen</a></li>
<li class="api apilevel-">
<a href="./net/pierrox/lightning_launcher/script/api/svg/package-summary.html">net.pierrox.lightning_launcher.script.api.svg</a></li>
</ul><br/>
</div> <!-- end packages -->
</div> <!-- end resize-packages -->
<div id="classes-nav">
<script>
/*addLoadEvent(maxPackageHeight);*/
</script>
<p style="padding:10px">Select a package to view its members</p><br/>
</div><!-- end classes -->
</div><!-- end nav-panels -->
<div id="nav-tree" style="display:none">
<div id="index-links">
<a href="./packages.html" class="selected" >Package Index</a> |
<a href="./classes.html" >Class Index</a>
</div>
</div><!-- end nav-tree -->
</div><!-- end swapper -->
</div> <!-- end side-nav -->
<script>
if (!isMobile) {
$("<a href='#' id='nav-swap' onclick='swapNav();return false;' style='font-size:10px;line-height:9px;margin-left:1em;text-decoration:none;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>").appendTo("#side-nav");
chooseDefaultNav();
if ($("#nav-tree").is(':visible')) {
init_default_navtree("./");
} else {
addLoadEvent(function() {
scrollIntoView("packages-nav");
scrollIntoView("classes-nav");
});
}
$("#swapper").css({borderBottom:"2px solid #aaa"});
} else {
swapNav(); // tree view should be used on mobile
}
</script>
<div class="g-unit" id="doc-content">
<div id="jd-header">
<h1>Package Index</h1>
</div>
<div id="jd-content">
<div class="jd-descr">
<p><h1>Lightning Launcher Scripting API</h1>
<h2>Introduction</h2>
<p>Starting at version 10 (alpha 9.9), Lightning Launcher has support for extending its behavior through JavaScript. This is an advanced and extremly powerful feature, and for this reason it requires some care.</p>
<p>The description of LL script APIs can be found here <code><a href="./net/pierrox/lightning_launcher/script/api/package-summary.html">net.pierrox.lightning_launcher.script.api</a></code>. The LL objet is the entry point for most things.</p>
<h2>Available Android classes</h2>
<p>Some Android classes can be directly used through scripting (creation of new instances, access to static fields - aka constants - and method calls). The list of supported classes are:
<ul>
<li>Bundle</li>
<li>Color</li>
<li>ComponentName</li>
<li>Context</li>
<li>Intent</li>
<li>LinearGradient</li>
<li>Matrix</li>
<li>MotionEvent</li>
<li>Paint</li>
<li>Path</li>
<li>PorterDuff</li>
<li>PorterDuffXfermode</li>
<li>RadialGradient</li>
<li>RectF</li>
<li>Region</li>
<li>Shader</li>
<li>SweepGradient</li>
<li>Toast</li>
<li>TypeFace</li>
<li>Uri</li>
</ul>
These third party classes are also available:
<ul>
<li>TaskerIntent</li>
<li>ActionCodes</li>
</ul>
Other classes can be accessed through their fully qualified name. For instance, should you need to access accelerometers, you may want to use <code>android.hardware.Sensor.TYPE_ACCELEROMETER</code>. Using <code>LL.bindClass(String name)</code> will conveniently suppress the need for explicit package naming (<code>Sensor.TYPE_ACCELEROMETER</code> would be enough if <code>LL.bindClass("android.hardware.Sensor");</code> has been called previously.
</p>
<h2>Things to be aware of</h2>
<p>Use the new Script Editor icon (in your app drawer) to quickly edit scripts. No need to configure events and select run a script: just launch the script editor and it will open on the last edited script.</p>
<h2>DOs and DON'Ts</h2>
<h3>Use and absuse from variables</h3>
<p>API calls are expensive, and you never know what is hidden behind. It is a good idea to keep return values in local variables to minimize API calls. For instance:
<pre>
alert(LL.getEvent().getTouchX()+" / "+LL.getEvent().getTouchY()); /* BAD */
var e = LL.getEvent();
alert(e.getTouchX()+" / "+e.getTouchY()); /* BETTER */
</pre>
</p>
<h3>Not suitable for (smooth) animations</h3>
<p>While it is possible to move, rotate or change items configuration, performances may not be enough to sustain a 60Hz animation rate.</p>
<h3>Timers</h3>
<p>It is possible to set timers using setTimeout. Pay special attention to clear these timers when needed, LL won't do this for you. If you don't clear timers, you may severly increase CPU use and battery consumption.</p>
<h3>Object references</h3>
<p>Avoid keeping references to objects returned by LL APIs in the script side, otherwise you may leak data. It is possible to use <pre>self</pre> to store data that are kept between two script execution (and can be shared between scripts), but try to avoid this as much as possible.</p></p>
</div>
<table class="jd-sumtable">
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol">
<a href="./net/pierrox/lightning_launcher/prefs/package-summary.html">net.pierrox.lightning_launcher.prefs</a></td>
<td class="jd-descrcol" width="100%"></td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol">
<a href="./net/pierrox/lightning_launcher/script/api/package-summary.html">net.pierrox.lightning_launcher.script.api</a></td>
<td class="jd-descrcol" width="100%"></td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol">
<a href="./net/pierrox/lightning_launcher/script/api/palette/package-summary.html">net.pierrox.lightning_launcher.script.api.palette</a></td>
<td class="jd-descrcol" width="100%"></td>
</tr>
<tr class=" api apilevel-" >
<td class="jd-linkcol">
<a href="./net/pierrox/lightning_launcher/script/api/screen/package-summary.html">net.pierrox.lightning_launcher.script.api.screen</a></td>
<td class="jd-descrcol" width="100%"></td>
</tr>
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol">
<a href="./net/pierrox/lightning_launcher/script/api/svg/package-summary.html">net.pierrox.lightning_launcher.script.api.svg</a></td>
<td class="jd-descrcol" width="100%"></td>
</tr>
</table>
<div id="footer">
Generated by <a href="http://code.google.com/p/doclava/">Doclava</a>.
</div> <!-- end footer -->
</div><!-- end jd-content -->
</div> <!-- end doc-content -->
</div> <!-- end body-content -->
<script type="text/javascript">
init(); /* initialize doclava-developer-docs.js */
</script>
</body>
</html>