April, 2014

now browsing by month

 

Hi folks.

Hi folks. I have seen many super screens here, you guys are awesome! But i dont see much lockscreens made with LLX. Any idea to make a winphone 8 like lockscreen?

]]>

DeepWater

DeepWater

]]>

Boing and Save and restore position

Boing and Save and restore position

These are two different scripts, but if you want to use the first you will probably use the second.

Boing

This is a script that will move the item from where this script was launched bouncing around the screen.

You need to run it from an action involving an item. I recommend the swipe of the item (in any direction. The starting direction is totally random)

Save and restore position

This is a script that will save only the position x/y of all the items in a container.

It is saved in the container tag, avoid modify it (the script don’t check if the saved tag is the good one)

Just run it from an item in the container, or from the container itself.

Remember that you need to save the position every time a new item is added to the container. Otherwise that item won’t be restored.

I made the script easy to modify to save different data in case you want to edit it yourself.

—————————— Boing

var bounciness = 0.95;//Reduction every tick, between 0 (only one tick) and 1 (always bouncing) [Recommended 0.95]

var frecuency = 60;//ticks per second [Recommended 60]

var event = LL.getEvent();

var cont = event.getContainer();

var item = event.getItem();

if(item==null){alert(“No item attached to this event”); return;}

var vel = [ (Math.random() – 0.5) * cont.getWidth() , (Math.random() – 0.5) * cont.getHeight() ];

var size = [ item.getWidth() * item.getScaleX() , item.getHeight() * item.getScaleY() ]

tick();

function tick(){

//exit statement

if((Math.abs(vel[0])<1 && Math.abs(vel[1])<1)||LL.isPaused()) return;

//Reduction

vel=[ vel[0] * bounciness , vel[1] * bounciness ];

var newpos = [ item.getPositionX()+vel[0] , item.getPositionY()+vel[1] ];

var t;

//right

t=(newpos[0]+size[0]) – ( cont.getPositionX()+cont.getWidth()/cont.getPositionScale() ) ;

if(t>0){newpos[0]-=2 * t;vel[0]= -vel[0];}

//bottom

t=(newpos[1]+size[1]) – ( cont.getPositionY()+cont.getHeight()/cont.getPositionScale() ) ;

if(t>0){newpos[1]-=2 * t;vel[1]=-vel[1];}

//left

t= newpos[0]- cont.getPositionX();

if(t<0){newpos[0]-=2 * t;vel[0]= -vel[0];}

//top

t= newpos[1] – cont.getPositionY();

if(t<0){newpos[1]-= 2*t;vel[1]= - vel[1];}

//set and repeat

item.setPosition(newpos[0] , newpos[1] );

setTimeout(tick,1000/frecuency);

}

————————-Save and restore position

var velocity = 0.2;//The bigger, the faster (between (0,1] )

var frecuency = 60;//ticks per second [Recommended 60]

var cont = LL.getEvent().getContainer(); //The container

var tag = cont.getTag();

if(tag!=undefined){

//With data, hope it is from this script

var data=JSON.parse(tag);

if(confirm(“Restore?”)){

for(var i=data.ids.length – 1;i>=0; –i){

var item= LL.getItemById(data.ids[i]);

//move the item to their position

if(item!=null) move( item , data.posX[i] , data.posY[i] );

}

cont.setPosition(0,0,1,true);//can be omitted

return;

}

}

if(!confirm(“Save?”))return;

//save process

var data=new Object();

data.ids=[];

data.posX=[];

data.posY=[];

var items = cont.getItems();

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

//save the data of each item

var t = items.getAt(i);

data.posX[i]=t.getPositionX();

data.posY[i]=t.getPositionY();

data.ids[i]=t.getId();

};

//final save

cont.setTag(JSON.stringify(data));

Android.makeNewToast(“Saved “+data.ids.length+” item’s position”,true).show();

//custom lerp. It moves the item a bit and repeat

function move(item,posx,posy){

var xx=posx-item.getPositionX();

var yy=posy-item.getPositionY();

if( (Math.abs(xx)<1 && Math.abs(yy)<1) || LL.isPaused() ){

item.setPosition(posx,posy);

return;

}

xx *= velocity;

yy *= velocity;

item.setPosition( item.getPositionX()+xx , item.getPositionY()+yy );

setTimeout(function(){move(item,posx,posy);},1000/frecuency);

}

]]>

Pinning grid attached works differently via scripting vs other methods (the menu’s ‘pin’ option, and the ‘customize…

Pinning grid attached works differently via scripting vs other methods (the menu’s ‘pin’ option, and the ‘customize item’ ‘pin mode’ radio select). Via non-script methods, items are pinned to their current position in the view (vertically at least). This is as expected. Via scripts, items appear to be pinned at their position relative to the home screen / page. If they’re not on the home screen / page, this effectively causes them to vanish forever (or until unpinned via scripting, as there seems to be no other way to reach them…).

I tested using this simple, ‘item menu’ attached, script:

LL.getEvent().getItem().getProperties().edit().setString(“i.pinMode”, “XY”).commit();

]]>

Bug, or something like that: a panel filled with some widgets laggs upon rotate.

Bug, or something like that: a panel filled with some widgets laggs upon rotate.

]]>

Do folders have no OnOpen and OnClose event?

Do folders have no OnOpen and OnClose event? Are there other ways to react to? OnOpen can possibly be caught from OnTap of opener, but closing with Back-key not.

]]>

#dock

Originally shared by Chris Chastain

#dock

+Danbar Danbar, if you put your dock items inside a panel that does not rotate, with the dock line at top, and enable rotation for items within panel, it might work for you. Pin the panel, and enable scrolling for panel, if needed. Here’s a quick example:

]]>

Minimalistic page indicator

Minimalistic page indicator

Talking about indicators, I couldn’t stop thinking how to make a script. There is already one in the wiki, but I wanted one a bit more ‘stock’.

I started thinking complex ways of doing it, but then I realize that simplicity is the best in this case.

So I made one in 34 lines of code, easy to understand (this is an objective adjective, I know) and easy to set up.

Important: due to the custom characters I use, the maximum number of pages is 10. However you can change the character as you wish.

Instructions:

– Copy/paste this script as a new one

– Set it to run in the ‘position change’ event of the desktop

– place an item (recommend: shortcut to ‘do nothing’ and pinned) and label it ‘indicator’.

– [Recommended] Check the snap to pages and uncheck ‘fit desktop to items’ in scrolling options.

It automatically adapts to the desktop, for this reason the home page may not be the number 1.

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

//The special characters

var fill = “➊❷❸❹❺❻❼❽❾❿”;

var empty = “①②③④⑤⑥⑦⑧⑨⑩”;

//Vars

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

var width=cont.getWidth();

var left = Math.round(cont.getBoundingBox().getLeft()/width);

var right = Math.round(cont.getBoundingBox().getRight()/width)-1;

var page = Math.round(cont.getPositionX()/width);

//With zoom –> no page selected

if(cont.getPositionScale()!=1) page=NaN;

var ind = “”;

var flag=false;

//if more pages, just show “…”

if(right-left+1>empty.length){

right=left+empty.length-1;

flag=true;

}

//indicator

for(var i=0;i<=right-left;++i)ind+=(left+i==page?fill[i]:empty[i]);

if(flag)ind+=”…”;

//apply

try{ item=cont.getItemByLabel(“indicator”).setLabel(ind);

}catch(e){

alert(“Item not found. You need to label an item ‘indicator'”);

}

]]>

Hello everybody this is my last screen with lightning launcher, zooper, minimalistic text.

Hello everybody this is my last screen with lightning launcher, zooper, minimalistic text.

]]>

My app drawer keeps crashing every time I try to customize any individual app (such as changing the icon or the…

My app drawer keeps crashing every time I try to customize any individual app (such as changing the icon or the label). Any thoughts?

]]>