now browsing by category

 

Is it possible to change a Panels Transparency in a script?

Is it possible to change a Panels Transparency in a script?

from 0 to 255…

]]>

Hello all you script-maniacs, here’s a demo and description of some issues I am still stumbling upon.

Hello all you script-maniacs, here’s a demo and description of some issues I am still stumbling upon. Maybe any of you can help me out.

I don’t know wether these are bugs or intended (though unexpected) behaviours — if so, how to do it right?

Problems:

(1) Collapsing panels to 0px height

(2) Changing properties of items inside a panel not persistent

Collapsing to 0px – Intro

I want to collapse a panel to 0px height by script.

This requires

– panel dettached from grid — obviously

– rows set to NUM, not ROWS

– FitDesktopToItems = false

Collapsing to 0px – Issue 1

If FitDesktopToItems is “true” (what’s the preferable setting), instead of shrinking to 0px the panel is sized to a height which is, well, fit to the height of all items included.

Collapsing to 0px – Issue 2

If FitDesktopToItems is “false”, the panel is shrunk… but only if there aren’t any paddings, margins or borders at top or bottom! Otherwise instead of 0px the panel’s height is the sum of all top plus bottom paddings, margins and borders.

My current very ugly workaround is setting to 1px (which works good, with only a few border’s pixels remaining left and right) and changing Visibility to false.

Changing item properties

If I change properties of items inside a panel via script (like transparency, color, bold/italic/normal), it seems to work… but only until properties of the panel are changed. Or better: even edit()/commit() without changing anything is executed. Doing so causes the item’s properties to revert to their previous values; not default (think: inheritance). They seem to be “persisted” however after a while, a restart of LL, … I don’t know…

I tried starting “edit()” of the panel item and/or container before changing the item’s properties and commit() afterwards, but this did not help. IIRC it immediately causes reverting.

Am I doing something wrong or is this a bug?

DEMO Template

Here’s a template with the demo screen and scripts.

https://app.box.com/LL20140617Demo

Functions:

– “Mark items” (_script1): toggles transparency of the items inside the panel

– “Edit panel” (_script2):

  – Answering “Change panel properties” with “Cancel” only does edit().commit() for container (this commit reverts the item changes) and item (this does not)

  – “OK” allows to change some properties: RowMode, FitDesktopToItems, Dettach, Borders/Margins/Padding through series of confirm-dialogs

– “Toggle panel”: allows to collapse/expand the panel height to 2 rows, 0px or 1px through series of confirm-dialogs.

]]>

double click to launch

double click to launch

This is a small script I made in the alpha. I thought I had updated it…it seems I forgot 😛

But now I updated it to allow custom tap/doble tap!

Instructions:

Set the script in an event of the items you want. You may want to set it in the tap action, but nobody says you can’t set it in a swipe or something else. By default it will launch the item when single tap, and go to the main desktop when double tap. But of course you can (and may) change them to what you want, you will need to know scripting to do so.

With widgets it works ok, but the widget always get executed when tap, and perform the launch action will send a error. You can use this for example to do nothing when tap, and something when double tap (even thought the widget will get both clicks! )

———————————-

//time in milliseconds between clicks

var delta = 250;

function singletap(){

//action to execute in single tap

item.launch();

}

function doubletap(){

//action to execute in double tap

LL.goToDesktop(LL.getHomeDesktop().getId());

}

var event=LL.getEvent();

var item=event.getItem();

var id=item.getId();

var time=event.getDate();

var data = JSON.parse(LL.getScriptTag())||[-1,-1];

if(data[0]==id && time < ( data[1] + delta) ){

LL.setScriptTag(null);

doubletap();

}else{

LL.setScriptTag(JSON.stringify([id,time]));

setTimeout(function(){data2=JSON.parse(LL.getScriptTag())||[-1,-1];if(data2[0]==id&&data2[1]==time)singletap();},delta);

}

]]>

Anyone got a script to update zooper widgets? While I’m making them they take too long to refresh to new mods.

Anyone got a script to update zooper widgets? While I’m making them they take too long to refresh to new mods.

]]>

Pinch gestures

Pinch gestures

This script will allow you to launch custom scripts/items with the pinch in / pinch out gestures.

I couldn’t test myself a lot, but it should work. Anyway it only move the desktop position so your items are safe 😉

Instructions: set it in the position changed event. And allow zoom (it is necessary to catch the events, but it won’t zoom)

By default it will launch the items in the same container labeled “pinch in” , “pinch out” respectively. But of course you can change it if you know to run custom code (it is commented)

——————————————————–

var cont = LL.getEvent().getContainer();

var scal=cont.getPositionScale();

var date = LL.getEvent().getDate();

var data = JSON.parse(LL.getScriptTag())||[-1,cont.getPositionX(),cont.getPositionY()];

if(scal!=1){

if(date-data[0]>250){

if(scal<1){

//when pinch in

var item=cont.getItemByLabel(“pinch in”)

if(item!=null)item.launch();

}else{

//when pinch out

var item=cont.getItemByLabel(“pinch out”)

if(item!=null)item.launch();

}

}

cont.setPosition(data[1],data[2],1,false);

LL.setScriptTag(JSON.stringify([date,data[1],data[2]]));

}else{

LL.setScriptTag(JSON.stringify([-1,cont.getPositionX(),cont.getPositionY()]));

}

]]>

Does anybody have a backup of the always there bar script…its a pain to copy and paste from wiki,the spacing and…

Does anybody have a backup of the always there bar script…its a pain to copy and paste from wiki,the spacing and everything is messed up…or does anyone know an easy way to copy and paste…thanks in advance

]]>

Folder dim script has received an update and is now in wiki.

Folder dim script has received an update and is now in wiki.

http://www.pierrox.net/android/applications/lightning_launcher/wiki/doku.php?id=script_dim_bg

* setup is easier

* only one script

http://www.pierrox.net/android/applications/lightning_launcher/wiki/doku.php?id=script_dim_bg
]]>

Can somebody doing this script?

Can somebody doing this script?

1) Unlock locked screen

2) go to home screen

(now after unlock i am on last screen).

]]>

Video for the bounce script.

Video for the bounce script.

Not for everyday use, just demonstration

https://plus.google.com/115366157037831519359/posts/4Ktw58WRMji

]]>

Page transition animation: In and out

Page transition animation: In and out

http://www.pierrox.net/android/applications/lightning_launcher/wiki/doku.php?id=script_animation_inandout

]]>