/*

/*

Scripts for horizontal PageScroll with PageIndicator 

and simultaneously vertical “Content”Scroll 

independent from ScreenResolution.

Example for a 4 Page Desktop from Left to Right

Page Home Page Page 

“Pager” is a pined Panel with 3 Shortcuts (do nothing)

Definition should be:

First ShortcutWidth should be 3/4 of PanelWidth 

Second ShortcutWidth should be 1/4 of PanelWidth 

Third ShortcutWidth should be 3/4 of PanelWidth 

See Picture.

If you have e.g. 5 page like the width should 4/5 and 1/5 …

The Shurtcuts could be designed as you like.

Good Solution would be:

First and Third a small colored Line at the Bottom

Second a thicker colored Line at the Bottom

Above the “Pager” the pined Shortcuts “Go to specified Desktop&Postion” are placed.

“Content” is a pined Panel with as many VERTICAL pages as the Desktop. 

Like this:

Page

Home

Page

Page

Thanks to  TrianguloY  

I used a part  of his Script Minimal Page Indicator

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

*/

// Script set on DesktopEvent PositionChange

var cont=LL. getDesktopByName(‘DesktopName’) ;

var width=cont.getWidth(); // DesktopWidth

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;

else {

// pager is the panel with PageIndicator

var p1=cont. getItemByLabel(‘pager’). getContainer() ;

// content is the panel with VerticalContent

var p2=cont. getItemByLabel(‘content’). getContainer() ;

var pages=1;

// Calculation how many pages

if (left<0){

pages=right+1-left;

}

else {

pages=right+1;

// Width of the PagerPanel

var p1w=p1.getWidth();

// Height of the ContentPanel

var p2h=p2.getHeight();

// Multiplier in Pagerpanel a 1/x of the panel

var p1mult=Math.round(p1w/pages);

// New Postion vor PagerPanel

var pos1=(page*-1)*p1mult;

// New Postion vor ContentPanel

var pos2=page*p2h;

 

// set new Positions

p1. setPosition(pos1,0);

p2. setPosition(0, pos2);

// Script set on DesktopEvent SwipeUp

var cont=LL. getDesktopByName(‘DesktopName’) ;

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;

else if (page

pos1=(page+1)*width;

cont. setPosition(pos1,0);

// DesktopPosition will Change > First Script will take action

// Script set on DesktopEvent SwipeDown

 //

var cont=LL. getDesktopByName(‘DesktopName’) ;

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;

else if(page>left) {

pos1=(page-1)*width;

cont. setPosition(pos1,0);

// DesktopPosition will Change > First Script will take action

Template where i used this:

http://werksmannschaft.de/wordpress/a-kind-of-vintage-llx-themetemplate/

or here 🙂

https://play.google.com/store/apps/details?id=de.werksmannschaft.lltemplate.akov

http://werksmannschaft.de/wordpress/scripts-for-horizontal-pagescroll-with-pageindicator-and-simultaneously-vertical-contentscroll/

http://werksmannschaft.de/wordpress/scripts-for-horizontal-pagescroll-with-pageindicator-and-simultaneously-vertical-contentscroll
]]>

Leave a Reply

Your email address will not be published. Required fields are marked *