tabs.Animate() example

20 views
Skip to first unread message

DogPlanner GSS

unread,
Aug 17, 2026, 3:08:17 AM (2 days ago) Aug 17
to DroidScript
Good morning for everyone, 😊 

We found in the DroidScript documentation tabs.Animate() method for work with tables. But we try to write different parameters in the method brackets and nothing works -> error appears.

Could you pls send some example of using this method?

Thank you very much in advance! Have a nice day.

Dmitry

Alan Hendry

unread,
Aug 17, 2026, 5:25:14 AM (2 days ago) Aug 17
to DroidScript
HI,
Not sure if you mean native or hybrid
The first parametet should be the type ("bounce" etc)
native requires a function for callback (or null)
the duration is milliseconds (1000 is one second).
Regards, ah

Native
var list = ""
+"BounceLeft,BounceRight,BounceTop,BounceRight,"
+"FadeIn,FadeOut,"
+"FlipFromLeft,FlipFromRight,FlipFromTop,FlipFromBottom,"
//+"FlipToLeft,FlipToRight,FlipToTop,FlipToBottom,"
+"ScaleFromLeft,ScaleFromRight,ScaleFromTop,ScaleFromBottom,"
+"ScaleToLeft,ScaleToRight,ScaleToTop,ScaleToBottom,"
+"ShakeHorizontal,ShakeVertical,"
+"SlideFromLeft,SlideFromRight,SlideFromTop,SlideFromBottom,"
+"SlideToLeft,SlideToRight,SlideToTop,SlideToBottom,"
+"ZoomInEnter,ZoomOutExit,"
+"ZoomInLeft,ZoomInRight,ZoomInTop,ZoomInBottom,"
+"ZoomOutLeft,ZoomOutRight,ZoomOutTop,ZoomOutBottom,"
+"NewsPaper,Jelly,Flash,RubberBand,Swing,TaDa,Fall,FallRotate"

function OnStart() {
lay = app.CreateLayout( "Linear", "Top,FillXY" )
ddn = app.AddSpinner( lay ,list)
ddn.SetOnChange( function(item,index) {txt.Animate(item,null,1000)} )
ddn.SetPadding(0,0,0,0)
// ddn.SetTextSize( 14 )
txt = app.AddText( lay,"Hello" )
txt.SetTextSize( 32 )
app.AddLayout( lay )
}

Hybrid
export class Main extends App {
        onStart() {
            this.main = ui.addLayout( "main", "Linear", "vcenter", 1, 1 )

var list = ["Choose an animation","bounce","flash","pulse","rubberBand","shakeX","shakeY","headShake","swing","tada","wobble","jello","heartBeat",
"backInDown","backInLeft","backInRight","backInUp",
"backOutDown","backOutLeft","backOutRight","backOutUp",
"bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp",
"bounceOut","bounceOutDown","bounceOutLeft","bounceOutRight","bounceOutUp",
"fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","fadeInTopLeft","fadeInTopRight","fadeInBottomLeft","fadeInBottomRight",
"fadeOut","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutRightBig","fadeOutUp","fadeOutUpBig","fadeOutTopLeft","fadeOutTopRight","fadeOutBottomRight","fadeOutBottomLeft",
"flip","flipInX","flipInY","flipOutX","flipOutY",
"lightSpeedInRight","lightSpeedInLeft","lightSpeedOutRight","lightSpeedOutLeft",
"rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpLeft","rotateInUpRight",
"rotateOut","rotateOutDownLeft","rotateOutDownRight","rotateOutUpLeft","rotateOutUpRight",
"hinge","jackInTheBox","rollIn","rollOut",
"zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp",
"zoomOut","zoomOutDown","zoomOutLeft","zoomOutRight","zoomOutUp",
"slideInDown","slideInLeft","slideInRight","slideInUp",
"slideOutDown","slideOutLeft","slideOutRight","slideOutUp"]
            this.lst = ui.addSelect( this.main, list, "", 0.8 )
            this.lst.value = 0
            this.lst.setOnTouch(function (a,b) {
                    if (b !=0)
                        img.animate( a,2000 )
            }) // ontouch
         
         var img = ui.addImage(this.main,"ds:/Sys/Img/Hello.png","",0.25)
   //          var img = ui.addButton(this.main,"Hello")

        } // onstart
 } // class


DogPlanner GSS

unread,
Aug 17, 2026, 10:01:36 AM (2 days ago) Aug 17
to DroidScript
Hello Alan,

Thank you very much for detailed answer!
It is very useful info and it will be needed for different visual components.

Have a nice day. We hope the weather is good where you are :))

Dmitry

понедельник, 17 августа 2026 г. в 12:25:14 UTC+3, hendr...@gmail.com:
Reply all
Reply to author
Forward
0 new messages