Karsten Franke
now browsing by tag
How to pass script data when using event handler to run a script?
When using the runScript() function passing additional information is possible.
Am I missing something?
Pierre Hébert
]]>Sneak preview… Scripted audio player using a custom view without any additional plug-ins. Pure lightning Launcher.
Sneak preview… Scripted audio player using a custom view without any additional plug-ins. Pure lightning Launcher.
]]>How to access the appdrawer by using its id of 99?
Goal is to style the appdrawer without opening it.
Access is a bit harder due to recent screen API changes. It seems.
Pierre Hébert
]]>V14a11
Editing properties of script-created items prevents other later scripted edits to work.
E.g. The color of items can’t be set via script once the item has been styled initially (accessing the properties seems to be enough already) via script before the color change is applied.
The color change works (without any code change) if no styling via script happened at the time the item was created.
]]>Not sure if this a bug but when opening the activity screen to edit the settings like layout or events of a desktop,…
You would assume the desktop paused would be fired instead.
]]>V14a10
Setting the alpha of an item lower than 255 leads to text aliasing artefacts when zoomed into the desktop although hardware acceleration is disabled for desktop and item
You would expect a clear text with sharp edges as long as hardware acceleration remains disabled.
Example script
getEvent().getScreen().getCurrentDesktop().getItemByName(“item”).getProperties().edit().setInteger(“i.alpha”,254).commit();
]]>V14a10
A script executed after desktop items have been removed throws nullpointer exception.
_____________
var items = getEvent().getScreen().getCurrentDesktop().getAllItems();
var l_item;
var d =getEvent().getScreen().getCurrentDesktop();
for(var i=items.length-1;i>=0;i–)
{
l_item=items[i];
d.removeItem(l_item);
}
getEvent().getScreen().runScript(“event”,null)
___________
The script “event” only displays an android toast message.
BTW: the desktop consists of items created by script. Executing the same script on the default desktop works.
]]>Not sure if this is a bug, but I am getting a nullpointer exception when trying to get all items of the current…
Neither of these work with v14a8
getEvent().getContainer().getAllItems()
getEvent().getScreen().getCurrentDesktop().getAllItems()
In V12 I used LL.getCurrentDesktop().getItems() which doesn’t work now either
]]>Flashing on scrolling direction change
Assign this script to a shortcut:
LL.getCurrentDesktop().getProperties().edit().setString(“scrollingDirection”,”AUTO”).commit();
And notice a short flashing. Seems like the screen gets refreshed quickly? Doesn’t look great though.
New behaviour introduced with v14a
Additionally, the container scrolls to top when the script gets executed. I would expect the container remains in its scrolling position until an explicit setPosition().
]]>Testing new screen API getitembyid() to retrieve a folder within a panel without traversing the complete hierarchy.
//Get the id of the folder
id=getEventScreen().getCurrentDesktop().getItemByName(“panel”).getContainer().getItemByName(“folder”).getId()
//Doesn’t open the folder by accessing the folder directly without traversing the hierarchy (which would be elegent)
getEventScreen().getCurrentDesktop().getItemById(id).open()
//Does open the folder. but is tedious and hard-coded hierarchy which I would want to avoid
getEventScreen().getCurrentDesktop().getItemByName(“panel”).getContainer().getItemByName(“folder”).open()
]]>