====== Differences ====== This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
script_launch_animation [2015/04/30 17:09] lm13 created |
script_launch_animation [2016/06/28 12:21] (current) f43nd1r |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== About the script ====== | ====== About the script ====== | ||
| * Purpose : These scripts will change the animation when launching shortcuts | * Purpose : These scripts will change the animation when launching shortcuts | ||
| - | * Authors : [[https://plus.google.com/+LukasMorawietz|LM13]] and TrianguloY | + | * Authors : F43nd1r and [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] |
| - | * Current Version : 1.0 | + | * Current Version : 1.1 |
| * Link : | * Link : | ||
| ====== Changelog ====== | ====== Changelog ====== | ||
| * Version 1.0 (30/4/2015): initial release in wiki | * Version 1.0 (30/4/2015): initial release in wiki | ||
| + | * Version 1.1 (30/11/2015: Added no animation option | ||
| ====== How to use the script ==== | ====== How to use the script ==== | ||
| * Set one of these Scripts to the tap action of an item | * Set one of these Scripts to the tap action of an item | ||
| - | to choose between fading and sliding, set "fade" or "slide" in the script run Data | + | to choose between fading, sliding and none, set "fade", "slide" or "none" in the script run Data |
| ====== Issues and hints ====== | ====== Issues and hints ====== | ||
| Line 32: | Line 33: | ||
| var d=LL.getEvent().getData(); | var d=LL.getEvent().getData(); | ||
| + | var choices=["fade","slide","none"]; | ||
| - | if(d!="fade"&&d!="slide")d=Math.random()>0.5?"fade":"slide"; | + | if(choices.indexOf(d)==-1)d=choices[Math.floor(Math.random()*choices.length)]; |
| var animIn; | var animIn; | ||
| Line 42: | Line 44: | ||
| animOut=R.anim.fade_out; | animOut=R.anim.fade_out; | ||
| } | } | ||
| - | if(d=="slide"){ | + | else if(d=="slide"){ |
| animIn=R.anim.slide_in_left; | animIn=R.anim.slide_in_left; | ||
| animOut =R.anim.slide_out_right; | animOut =R.anim.slide_out_right; | ||
| + | } | ||
| + | else if(d=="none"){ | ||
| + | animIn=0; | ||
| + | animOut=0; | ||
| } | } | ||
| LL.getContext().overridePendingTransition(animIn, animOut); </sxh> | LL.getContext().overridePendingTransition(animIn, animOut); </sxh> | ||