Android Programming Press on the image to return to the main documentation page.

Animation

List of types:

Animation

Animation

The Animation object allows you to animate views.
There are several types of animations. The Initialize methods determine the animation type.
See this tutorial for a program demonstrating the animations.
This is an 'Activity Object', it cannot be declared under Sub Process_Globals.

Events:

AnimationEnd

Members:


  Duration As Long

  InitializeAlpha (EventName As String, FromAlpha As Float, ToAlpha As Float)

  InitializeRotate (EventName As String, FromDegrees As Float, ToDegrees As Float)

  InitializeRotateCenter (EventName As String, FromDegrees As Float, ToDegrees As Float, View As android.view.View)

  InitializeScale (EventName As String, FromX As Float, FromY As Float, ToX As Float, ToY As Float)

  InitializeScaleCenter (EventName As String, FromX As Float, FromY As Float, ToX As Float, ToY As Float, View As android.view.View)

  InitializeTranslate (EventName As String, FromDX As Float, FromDY As Float, ToDX As Float, ToDY As Float)

  IsInitialized As Boolean

  REPEAT_RESTART As Int

  REPEAT_REVERSE As Int

  RepeatCount As Int

  RepeatMode As Int

  Start (View As android.view.View)

  Stop (View As android.view.View)

Members description:

Duration As Long
Gets or sets the animation duration. Value is measured in milliseconds.
Example: Animation1.Duration = 1000
InitializeAlpha (EventName As String, FromAlpha As Float, ToAlpha As Float)
Initializes an alpha animation. This animation affects the view's transparency (fading effect).
The alpha values are between 0 to 1 where 0 is fully transparent and 1 is fully opaque.
FromAlpha - The first frame value.
ToAlpha - The last frame value.
InitializeRotate (EventName As String, FromDegrees As Float, ToDegrees As Float)
Initializes a rotation animation. The view will rotate between the given values.
Rotation pivot is set to the top left corner.
FromDegrees - The first frame rotation value.
ToDegrees - The last frame rotation value.
InitializeRotateCenter (EventName As String, FromDegrees As Float, ToDegrees As Float, View As android.view.View)
Similar to InitializeRotate, with the pivot set to the given view's center.
InitializeScale (EventName As String, FromX As Float, FromY As Float, ToX As Float, ToY As Float)
Initializes a scale animation. The view will be scaled during the animation.
The scaling pivot will be set to the top left corners.
FromX - The first frame horizontal scale.
FromY - The first frame vertical scale.
ToX - The last frame horizontal scale.
ToY - The last frame vertical scale.
InitializeScaleCenter (EventName As String, FromX As Float, FromY As Float, ToX As Float, ToY As Float, View As android.view.View)
Similar to InitializeScale with a pivot set to the given view's center.
InitializeTranslate (EventName As String, FromDX As Float, FromDY As Float, ToDX As Float, ToDY As Float)
Initializes a translation animation. The view will move according to the given values.
FromDX - First frame horizontal position relative to the original position.
FromDY - First frame vertical position relative to the original position.
ToDX - Last frame horizontal position relative to the original position.
ToDY - Last frame vertical position relative to the original position.
IsInitialized As Boolean
REPEAT_RESTART As Int
REPEAT_REVERSE As Int
RepeatCount As Int
Gets or sets the number of times the animation will repeat. A value of 0 means that it will play once.
Set to -1 for a non stopping animation.
Example: Animation1.RepeatCount = 1
RepeatMode As Int
Gets or sets the repeat mode. Relevant when RepeatCount is larger than 0 (or -1).
The default is REPEAT_RESTART which means that the animation will restart each time.
REPEAT_REVERSE causes the animation to repeat in reverse each time.
For example if the animation moves the view to the right 100 pixels, in the next repeat it will return to the left.
Example: Animation1.RepeatMode = Animation1.REPEAT_REVERSE
Start (View As android.view.View)
Starts the animating the given view.
Note that a single animation should not be applied to more than one view at a time.
Example: Animation1.Start(Button1)
Stop (View As android.view.View)
Stops animating the given view.
Top