Title
Posted by: pierrot | on June 27, 2016

Posted in | 8 Comments »
Tags: gerd reuter (werksmannschaft)
« I’m still a scripting novice with LL, so forgive me for the following question which probably has a simple answer. (Previous Post)
(Next Post) Fresh in Mind for Kustom LWP »
< ![CDATA[
gerd reuter Dear developer, currently I make own UI for car android. I saw your wonderful UI on community. How did you handle clicking button can make change screen scroll-able. Would you mind teach me plz?
]]>
< ![CDATA[
Chris LEE you can do it in two ways.
i did it with script, but you can also do it with integrated “go to specified desktop&position” action. second if you do not like to script and when you do not want to share desktop to device with different screenresolution.
]]>
< ![CDATA[
gerd reuter Thanks..would mind provide example of script? (lhg1125@gmail.com)
]]>
< ![CDATA[
Chris LEE sent you a mail chris.
]]>
< ![CDATA[
gerd reuter ah…I did not receive an email from you. Plz check again. Thanks
]]>
< ![CDATA[
Chris LEE
sorry still stuck in drafts
]]>
< ![CDATA[
Chris LEE
script vertical:
// gotoVpage(page)
// scroll to Vertical Page
// parameter is page relative to Homepage
// leave horizontal position at it is.
var gotoPage=LL.getEvent().getData();
var cont=LL. getEvent(). getContainer() ;
// if you want to use explicid desktop: var cont=LL. getCurrentDesktop() ;
var width=cont.getWidth(); // ContainerWidth
var height=cont.getHeight(); // ContainerHeight
var pX=cont. getPositionX(); // Position X Left
var pY=cont. getPositionY(); // Position Y Top
cont.setPosition(pX,gotoPage*height);
script horizontal:
// gotoHpage(page)
// scroll to horizontal Page
// parameter is page relative to Homepage
// leave horizontal position at it is.
var gotoPage=LL.getEvent().getData();
var cont=LL. getEvent(). getContainer() ;
// if you want to use explicid desktop: var cont=LL. getCurrentDesktop() ;
var width=cont.getWidth(); // ContainerWidth
var height=cont.getHeight(); // ContainerHeight
var pX=cont. getPositionX(); // Position X Left
var pY=cont. getPositionY(); // Position Y Top
cont.setPosition(gotoPage*width,pY);
]]>
< ![CDATA[
Chris LEE
use of the Scripts
add item > lightning action
select run a script
select one of the scripts
check Script data
enter position where to go
relative to home
could be also decimal
example:
0 > home
1 > next page after home
0.5 > half of next page after home
-1 > first page before home
script works for container where the item was added. means works also inside panels or folders.
if you add the item inside a panel and want to scroll to a position on desktop you have to change script.
var cont=LL. getEvent(). getContainer() ;
// if you want to use explicid desktop:
var cont=LL. getCurrentDesktop() ;
good luck
]]>