TrianguloY

now browsing by tag

 
 

I’m not sure if this wasn’t reported before, correct me if I’m wrong.

I’m not sure if this wasn’t reported before, correct me if I’m wrong.

Anyway, why the setRotation and getRotation methods of items use int? Why not float? You can set floats with the geometry editor, and they get saved so I guess internally they are floats.

So, why from script they are cutted into ints?

]]>

Even though I’m still busy, this is only something I made weeks ago, but I managed to rec a video and I couldn’t…

Even though I’m still busy, this is only something I made weeks ago, but I managed to rec a video and I couldn’t resist to share it.

Quick preview: this will be a script that will let you save any configuration of the items in free mode in any item (tag) or even in the container. Then just execute the script in the item and all will move/resize/rescale/rotate. It still have some minor things to fix, but I think it works fine.

I hope screen-makers will find it useful, or even normal users.

I expect to be able to publish it in ~15 days, but I can’t promise anything.

]]>

When an app is updated and its icon change, it is automatically updated in the app drawer and where placed it (or at…

When an app is updated and its icon change, it is automatically updated in the app drawer and where placed it (or at least when you refresh)

But, when the name change it is not. Not automatically and not with a refresh. You need to change it manually.

Edit: in the LL app drawer it is updated. I guess this is due to the fact that LLX let you change the label. But it also let you change the icon, is it possible to leave custom label but modify default one?

]]>

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);

}

]]>

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()]));

}

]]>

I thought this was reported before, but it still exist so I need to report it.

I thought this was reported before, but it still exist so I need to report it.

When using setCell(,,,) in a folder, when you close and re open it the items stay in the previous position. The setCell command seems to not save the items.

Only in folders, it works fine in desktops (I didn’t try in panels)

]]>

I think this was suggested before, but maybe in the alpha so I want to ask again.

I think this was suggested before, but maybe in the alpha so I want to ask again.

How difficult will be to add a LL.getEvent().getName() that will just return a string with the name of the event where it was launched?

“Tap” “Long-press” “Swipe left” …

And also maybe “Lightning menu” “Item menu” and “Custom menu” too

]]>

I tested this strange behavior only in my tablet, but I guess it happens in others too.

I tested this strange behavior only in my tablet, but I guess it happens in others too.

if(LL.isLocked())LL.unlock();

Just run this small piece of code in the screen on event.

It will says ‘the device is not unlocked’ even thought isLocked() return true.

Also, Pierre Hébert I want to know the exact (if possible) order of these events, and when the isLocked and isPaused change:

ScreenOn

ScreenOff

Resume of the lock screen

]]>

Not sure if bug, unexpected behavior, or time for a suggestion.

Not sure if bug, unexpected behavior, or time for a suggestion.

The container returned by LL.getEvent().getContainer() run from a script launched in the resume event is the one that ‘opened’ the one that have the script.

In the test I made, in a desktop, when you go to the desktop from a shortcut inside a different desktop, the container is that one.

When you use the two fingers swipe, or just open a different app and go back the container is the -1 one.

How this should work? Return the opened container? Leave it as now? A different getContainer function?

]]>

Finally the resumed event was added, so here is my lock screen.

Finally the resumed event was added, so here is my lock screen. Maybe you don’t believe, but I have this lock screen (two scripts) since the alpha! I even posted the scripts once (now they are improved) And that’s why I can publish it now, I just managed to have some free time to record the video.

Story: I read once that pattern/pin/password as lock screen are not really secure in the fact that the fingerprint tells you the path/numbers/letters.

It was said on a research, but unfortunately I couldn’t find it (if someone know, write here the link)

In the research, the conclusion was that the ‘best’ lock screen (in the fingerprint part) will be one with a color password, colors placed randomly on the screen so you just need to click the color password in order. Since the position of the colors is random, even if you know where exactly the user clicked, you can’t know which colors did they click.

The only thing I saw was the app ORBIE

This lock screen is made of two scripts: one that unlocks the screen if you click the items in order (configurable, uses the id of the items) and the other just place the items in random cells (configurable too).

Since the items can be whatever you want, you can make the lock screen with apps, pictures, colors, shapes…

Of course you can use them separately, perhaps you just want the lock sequence

Instructions:

– Place some items in cell mode.

[If you want to move them randomly]

– Set the resumed event to run the ‘randomize’ script. If you want some items to not move, place them in free mode

– IMPORTANT: configure the script with the available cells where you want to place the items.

[The lock part]

– Set the click event of the items (all that will be part of the ‘pattern’ ) to run the ‘locksequence’ script.

– Click one item to set your first password

– To change it just perform the sequence while unlocked and follow the instructions. (The time to wait is configurable)

—————————————

Locksequence script

—————–

var interval = 2000; /* time in milliseconds to wait until new lock set*/

var tag = LL.getScriptTag();

/* in case they don’t exist*/

if( tag != undefined ){

var data = JSON.parse( tag );

}else{

var data = new Object();

}

if(! (“a” in data)){

data.a=0;

}

if(! (“secuence” in data)){

data.secuence = [];

data.secuence[0]=0;

}

var item = LL.getEvent().getItem();

/* to notify the click*/

item.setVisibility(false);

setTimeout(function(){ item.setVisibility(true) ;},50);

if(data.a<0){

/* The set procces: negative numbers*/

data.secuence[ -data.a -1]=item.getId();

–data.a;

data.timeout = setTimeout( function(){isDone(data.a);},interval);

}else{

/* The unlock procces: positive and zero numbers*/

if(item.getId()!=data.secuence[data.a]){

/* wrong*/

data.a=0;

}else{

++data.a;

if(data.a==data.secuence.length){

/* good*/

data.a=0;

/* unlock or set new one*/

if(LL.isLocked()){

LL.unlock();

}else{

reset();

}

}

}

}

/* if no data found*/

if( data.secuence[0]==0 ) reset();

save(data);

function save(tosave){

LL.setScriptTag( JSON.stringify(tosave) );

}

function reset(){

if(!confirm(“Set a new lock?”))return;

data.secuence = [];

data.a= -1;

Android.makeNewToast(“Click the items in order\nWait “+ interval/1000 + ” second after the last click to apply” , false ).show() ;

}

function isDone(old){

var now = JSON.parse( LL.getScriptTag() );

if(old!=now.a)return;

now.a=0;

Android.makeNewToast(“Lock set with “+ data.secuence.length + ” steps”, false ).show();

save(now);

}

—————————————

Randomize script

————–

//Cell: [first position , size ]

var h = [1,3];

var v = [1,3];

var all = LL.getEvent().getContainer().getItems(); //Or use the container you want

var items = [];

var len = 0;

for(var i=all.getLength()-1;i>=0;–i){

var p = all.getAt(i);

if(p.getProperties().getBoolean(“i.onGrid”) ) items[len++]=p;

}

var free = new Array();

if(len > h[1]* v[1] ){

alert(“WARNING: a lot of items, or a small layout”);

return;

}

for(var i=0; i

var sh = 0;

var sv = 0;

do{

sh=Math.floor(Math.random()* h[1] );

sv=Math.floor(Math.random()* v[1] );

}

while(free[sv* h[1]+sh]!=undefined)

free[sv* h[1]+sh]=0;

sh+=h[0];

sv+=v[0];

items[i].setCell(sh,sv,sh+1,sv+1);

}

]]>