Class AnimatedGuiObjectCV<T>
- java.lang.Object
-
- de.thkoeln.cvogt.android.propanim_utilities.AnimatedGuiObjectCV<T>
-
- Type Parameters:
T
- The class of the object to be animated - either Drawable or View
- Direct Known Subclasses:
AnimatedCounterCV
public class AnimatedGuiObjectCV<T> extends java.lang.Object
Adapter class for animating objects of class Drawable or class View by applying the property animation techniques of Android. An object of this adapter class wraps an object that can be displayed and animated on the screen by a ViewGroup object of class AnimationViewCV. The generic type parameter specifies the type of the embedded object which can be either Drawable or View. The methods specified by this adapter class work on the embedded object.
NB: Up to now, the methods and concept have been thoroughly tested for Drawables only, whereas the inclusion of Views is still somewhat experimental. So most probably not everything will work correctly. A major problem yet to solved is that the programmatic placement of the Views interferes with the layout generation by the runtime system.
The usual way to work with an object of this class is:
1.) Create an object by calling one of the static create methods (or by calling directly one of the constructors). This will specify the properties of the embedded Drawable or View object.
2.) Specify and register animators for the object by calling the addXXXAnimator() methods (or alternatively addAnimator() - see (*) below).
3.) (Optionally) combine these animators to an animator set by calling playSequentially() and playTogether().
4.) Add the object to a displayingView of class AnimationViewCV through the displayingView's addAnimatedGuiObject() method.
5.) Display the displayingView on the screen through setContentView().
6.) Start the animation (i.e. all registered animators) by calling startAnimations() on the displayingView.
(*) Animators can be registered by calling either addAnimator() or a method like addLinearPathAnimator(), addBezierAnimator() etc. addAnimator() has a parameter of type Animator through which any animator can be passed (which has to be prefabricated by the calling program code). The other methods produce and register animators of a specific type that can be further specified by the method parameters (e.g. to traverse a linear path with some target point, a specific duration and start delay etc.). Note that the addXXXAnimator() methods register AND return the newly created animators such that the calling code can modify them and specify further details.
Note that the animated object still exists even if the animation has reduced its size to zero of if it has left the display.
To delete it, add a listener to the animator: animator.addListener(new AnimationUtilsCV.EndListener_DeleteIfNotVisible(myGuiObject)). Also note: When an animator has been started (by calling startAnimation on guiObject) and has afterwards finished its execution, it will be automatically removed from the object's animator list and therefore can (and will) not be restarted.A video explanation is given here: Overview, Code, Demo
The code in the companion package de.thkoeln.cvogt.android.propanimutil_demos demonstrates how to use this class.
This work is provided by Prof. Dr. Carsten Vogt, Technische Hochschule Köln, Fakultät für Informations-, Medien- und Elektrotechnik, Germanyunder GPLv3, the GNU General Public License 3, http://www.gnu.org/licenses/gpl-3.0.html.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnimatedGuiObjectCV.ObjectProperties
Class to store and later to restore member values of an object of class AnimatedGuiObjectCV - mainly those values that pertain to the presentation of the object on the display.static interface
AnimatedGuiObjectCV.OnPropertyChangedListener
Interface for classes to react on property changes on an object of class AnimatedGuiObjectCV, e.g. to detect collisions with other objects.
-
Field Summary
Fields Modifier and Type Field Description protected T
guiObject
Drawable or View object to be animatedstatic int
TYPE_DRAWABLE_ANY
Type of the animated object: Any Drawable (for this type of object, currently only the path and rotate animations work)static int
TYPE_DRAWABLE_BITMAP
Type of the animated object: BitmapDrawablestatic int
TYPE_DRAWABLE_BITMAPTEXT
Type of the animated object: BitmapDrawable showing a textstatic int
TYPE_DRAWABLE_CIRCLE
Type of the animated object: ShapeDrawable with an OvalShape that is a circlestatic int
TYPE_DRAWABLE_OVAL
Type of the animated object: ShapeDrawable with an OvalShapestatic int
TYPE_DRAWABLE_PATH
Type of the animated object: ShapeDrawable with a PathShapestatic int
TYPE_DRAWABLE_RECT
Type of the animated object: ShapeDrawable with a RectShapestatic int
TYPE_DRAWABLE_SQUARE
Type of the animated object: ShapeDrawable with a RectShape that is a squarestatic int
TYPE_DRAWABLE_TEXT
Type of the animated object: Text (= object of class DrawableTextCV)static int
TYPE_VIEW
Type of the animated object: View
-
Constructor Summary
Constructors Constructor Description AnimatedGuiObjectCV(int type, android.content.Context context, java.lang.String name, java.lang.String text, int centerX, int centerY, int textHeight)
Constructor for Drawables showing texts.AnimatedGuiObjectCV(int type, android.content.Context context, java.lang.String name, java.lang.String text, int centerX, int centerY, int textHeight, double rotAngle)
Constructor for Drawables showing texts.AnimatedGuiObjectCV(int type, java.lang.String name, int color, int centerX, int centerY, int width)
Constructor for embedded Drawable objects that can be squares or circles.AnimatedGuiObjectCV(int type, java.lang.String name, int color, int centerX, int centerY, int width, double rotAngle)
Constructor for embedded Drawable objects that can be squares or circles.AnimatedGuiObjectCV(int type, java.lang.String name, int color, int centerX, int centerY, int width, int height)
Constructor for embedded Drawable objects that can be rectangles/squares or ovals/circles.AnimatedGuiObjectCV(int type, java.lang.String name, int color, int centerX, int centerY, int width, int height, double rotAngle)
Constructor for embedded Drawable objects that can be rectangles/squares or ovals/circles.
Instead of this constructor, one of the corresponding static create methods can be used.AnimatedGuiObjectCV(android.content.Context context, java.lang.String name, android.graphics.Bitmap bitmap, int centerX, int centerY, int width, int height)
Constructor for embedded Bitmap Drawables.AnimatedGuiObjectCV(android.content.Context context, java.lang.String name, android.graphics.Bitmap bitmap, int centerX, int centerY, int width, int height, double rotAngle)
Constructor for embedded Bitmap Drawables.AnimatedGuiObjectCV(android.graphics.Path path, java.lang.String name, int color, int centerX, int centerY, int width, int height)
Constructor for embedded Drawable objects with a PathShape.AnimatedGuiObjectCV(android.graphics.Path path, java.lang.String name, int color, int centerX, int centerY, int width, int height, double rotAngle)
Constructor for embedded Drawable objects with a PathShape.AnimatedGuiObjectCV(android.view.View view, java.lang.String name, int left, int top)
Constructor for embedded View objects.AnimatedGuiObjectCV(java.lang.String name, android.graphics.drawable.Drawable drawable, int centerX, int centerY)
Constructor for embedded Drawables of any type, especially LayerDrawables (for this type of object, currently only the path and color animations work).AnimatedGuiObjectCV(java.lang.String name, android.graphics.drawable.Drawable drawable, int centerX, int centerY, double rotAngle)
Constructor for embedded Drawables of any type, especially LayerDrawables (for this type of object, currently only the path and rotate animations work).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnimator(android.animation.Animator anim)
Add an animator to drive the animation of the embedded Drawable or View object.android.animation.Animator
addAppearanceAnimator(int delay)
Add an animator to let the object appear on the display after a specified delay.android.animation.Animator
addArcPathAnimator(int centerCircleX, int centerCircleY, double angle, int duration)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().android.animation.Animator
addArcPathAnimator(int centerCircleX, int centerCircleY, double angle, int duration, int startDelay)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().android.animation.Animator
addArcPathAnimator(int centerCircleX, int centerCircleY, double angle, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().android.animation.Animator
addArcPathAnimator(int centerCircleX, int centerCircleY, double angle, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().android.animation.Animator
addArcPathAnimator(int centerCircleX, int centerCircleY, int targetX, int targetY, boolean clockwise, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().android.animation.Animator
addAttractOrRepulseAnimator(int targetX, int targetY, double attractionFactor, int duration)
Add an animator to move the embedded Drawable or View object on a direct line towards some specified target coordinates or away from these coordinates.android.animation.Animator
addAttractOrRepulseAnimator(int targetX, int targetY, double attractionFactor, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object on a direct line towards some specified target coordinates or away from these coordinates.android.animation.Animator
addAttractOrRepulseAnimator(int targetX, int targetY, double attractionFactor, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the embedded Drawable or View object on a direct line towards some specified target coordinates or away from these coordinates.android.animation.Animator
addAttractOrRepulseAnimator(int targetX, int targetY, double attractionFactor, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object on a direct line towards some specified target coordinates or away from these coordinates.android.animation.Animator
addBezierPathAnimator(int controlX, int controlY, int targetX, int targetY, int duration)
Add an animator to move the object along a quadratic Bezier curve.android.animation.Animator
addBezierPathAnimator(int controlX, int controlY, int targetX, int targetY, int duration, int startDelay)
Add an animator to move the object along a quadratic Bezier curve.android.animation.Animator
addBezierPathAnimator(int control1X, int control1Y, int control2X, int control2Y, int targetX, int targetY, int duration)
Add an animator to move the object along a cubic Bezier curve.android.animation.Animator
addBezierPathAnimator(int control1X, int control1Y, int control2X, int control2Y, int targetX, int targetY, int duration, int startDelay)
Add an animator to move the object along a cubic Bezier curve.android.animation.Animator
addBezierPathAnimator(int control1X, int control1Y, int control2X, int control2Y, int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the object along a cubic Bezier curve.android.animation.Animator
addBezierPathAnimator(int control1X, int control1Y, int control2X, int control2Y, int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along a cubic Bezier curve.android.animation.Animator
addBezierPathAnimator(int controlX, int controlY, int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the object along a quadratic Bezier curve.android.animation.Animator
addBezierPathAnimator(int controlX, int controlY, int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along a quadratic Bezier curve.android.animation.Animator
addBlinkAnimator(int durInterval)
Add an animator to let the Drawable object blink.android.animation.Animator
addBlinkAnimator(android.animation.TimeInterpolator timeInterpolator, int durInterval)
Add an animator to let the Drawable object blink.android.animation.Animator
addCirclePathAnimator(int centerCircleX, int centerCircleY, boolean clockwise, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().android.animation.Animator
addCirclePathAnimator(int centerCircleX, int centerCircleY, int duration)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().
Note: The object will start from its initial position and rotate infinitely.android.animation.Animator
addCirclePathAnimator(int centerCircleX, int centerCircleY, int duration, int startDelay)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().
Note: The object will start from its initial position and rotate infinitely.android.animation.Animator
addCirclePathAnimator(int centerCircleX, int centerCircleY, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().
Note: The object will start from its initial position and rotate infinitely.android.animation.Animator
addCirclePathAnimator(int centerCircleX, int centerCircleY, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().android.animation.Animator
addColorAnimator(int targetColor, int duration)
Add an animator to modify the color of the embedded Drawable or View object.android.animation.Animator
addColorAnimator(int targetColor, int duration, int startDelay)
Add an animator to modify the color of the embedded Drawable or View object.android.animation.Animator
addColorBorderAnimator(int targetColor, int duration)
Add an animator to modify the border color of the embedded object of class DrawableTextWithIconCV (has an effect only for objects of this type) The start delay is zero, i.e. the animation starts immediately.android.animation.Animator
addColorBorderAnimator(int targetColor, int duration, int startDelay)
Add an animator to modify the border color of the embedded object of class DrawableTextWithIconCV (has an effect only for objects of this type) The start delay is zero, i.e. the animation starts immediately.void
addDependentGuiObject(DependentGuiObjectCV obj)
Register an object of class DependentGuiObjectCV to be drawn together with this object.android.animation.Animator
addEllipseAnimator(int centerEllipseX, int centerEllipseY, int radius, double comprFactor, double rotAngleEllipse, boolean clockwise, int repeatCount, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an ellipse around a specified center.
The ellipse is implemented by a circle that is compressed vertically by a specified compression factor and then rotated by a specified angle around its center.
The object is assumed to lie initially on this ellipse.android.animation.Animator
addEllipseAnimator(int centerEllipseX, int centerEllipseY, int radius, double comprFactor, double rotAngleEllipse, boolean clockwise, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object infinitely along an ellipse around a specified center.
The ellipse is implemented by a circle that is compressed vertically by a specified compression factor and then rotated by a specified angle around its center.
The object is assumed to lie initially on this ellipse.android.animation.Animator
addFadeInAnimator(int duration)
Add an animator to let the object fade in.android.animation.Animator
addFadeInAnimator(int duration, int startDelay)
Add an animator to let an object fade in.android.animation.Animator
addFadeOutAnimator(int duration)
Add an animator to let the object fade out.android.animation.Animator
addFadeOutAnimator(int duration, int startDelay)
Add an animator to let an object fade out.android.animation.Animator
addInfiniteRotationAnimator(int roundDuration)
Add an animator to rotate the embedded Drawable or View object infinitely (for embedded Drawable objects only effective if of subclass RotatableDrawableCV).android.animation.AnimatorSet
addLinearPathAnimator(int targetX, int targetY, int duration)
Add an animator to move the embedded Drawable or View object in a direct line to some specified target coordinates.android.animation.AnimatorSet
addLinearPathAnimator(int targetX, int targetY, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object in a direct line to some specified target coordinates.android.animation.AnimatorSet
addLinearPathAnimator(int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the embedded Drawable or View object in a direct line to some specified target coordinates.android.animation.AnimatorSet
addLinearPathAnimator(int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object in a direct line to some specified target coordinates.android.animation.Animator
addLinearSegmentsPathAnimator(java.util.ArrayList<android.graphics.Point> path, int duration)
Add an animator to move the embedded Drawable or View object along some path consisting of multiple linear segments.android.animation.Animator
addLinearSegmentsPathAnimator(java.util.ArrayList<android.graphics.Point> path, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object along some path consisting of multiple linear segments.android.animation.Animator
addLinearSegmentsPathAnimator(java.util.ArrayList<android.graphics.Point> path, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the embedded Drawable or View object along some path consisting of multiple linear segments.android.animation.Animator
addLinearSegmentsPathAnimator(java.util.ArrayList<android.graphics.Point> path, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object along some path consisting of multiple linear segments.void
addPropertyChangedListener(AnimatedGuiObjectCV.OnPropertyChangedListener listener)
Register a listener to react upon property changes.android.animation.Animator
addRotationAnimator(float targetAngle, int duration)
Add an animator to modify the rotation angle of the embedded Drawable or View object (for embedded Drawable objects only effective if of subclass RotatableDrawableCV).android.animation.Animator
addRotationAnimator(float targetAngle, int duration, int startDelay)
Add an animator to modify the rotation angle of the embedded Drawable or View object (for embedded Drawable objects only effective if of subclass RotatableDrawableCV).android.animation.Animator
addRotationAnimator(float targetAngle, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to modify the rotation angle of the embedded Drawable or View object (for embedded Drawable objects only effective if of subclass RotatableDrawableCV).android.animation.Animator
addRotationAnimator(float targetAngle, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to modify the rotation angle of the embedded Drawable or View object (for embedded Drawable objects only effective if of subclass RotatableDrawableCV).android.animation.Animator
addShakeAnimator(float targetAngle, int durationShakeRound, int noShakes)
Add an animator to right-left shake the embedded Drawable or View object for a number of times (for embedded Drawable objects only effective if of subclass RotatableDrawableCV).android.animation.AnimatorSet
addSizeAnimator(int targetWidth, int targetHeight, int duration)
Add an animator to modify the size the embedded Drawable or View object.android.animation.AnimatorSet
addSizeAnimator(int targetWidth, int targetHeight, int duration, int startDelay)
Add an animator to modify the size the embedded Drawable or View object.android.animation.AnimatorSet
addSizeAnimator(int targetWidth, int targetHeight, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to modify the size the embedded Drawable or View object.android.animation.AnimatorSet
addSizeAnimator(int targetWidth, int targetHeight, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to modify the size the embedded Drawable or View object.android.animation.Animator
addSizeAnimator(java.util.ArrayList<android.graphics.Point> sizes, int duration)
Add an animator to modify the size of the embedded Drawable or View object.android.animation.Animator
addSizeAnimator(java.util.ArrayList<android.graphics.Point> sizes, int duration, int startDelay)
Add an animator to modify the size of the embedded Drawable or View object.android.animation.Animator
addSizeAnimator(java.util.ArrayList<android.graphics.Point> sizes, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to modify the size of the embedded Drawable or View object.android.animation.Animator
addSizeAnimator(java.util.ArrayList<android.graphics.Point> sizes, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to modify the size of the embedded Drawable or View object.android.animation.Animator
addSpiralPathInwardAnimator(int centerSpiralX, int centerSpiralY, int numberRotations, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an archimedian spiral, starting from the current position of the object inwards towards the center of the spiral.android.animation.Animator
addSpiralPathOutwardAnimator(double numberRotations, int targetDistance, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an archimedian spiral, starting from the current center of the object and moving outwards.android.animation.Animator
addStrokewidthBorderAnimator(int targetStrokewidth, int duration)
Add an animator to modify the border stroke width of the embedded object of class DrawableTextWithIconCV (has an effect only for objects of this type) The start delay is zero, i.e. the animation starts immediately.android.animation.Animator
addStrokewidthBorderAnimator(int targetStrokewidth, int duration, int startDelay)
Add an animator to modify the border stroke width of the embedded object of class DrawableTextWithIconCV (has an effect only for objects of this type) The start delay is zero, i.e. the animation starts immediately.int
addToZindex(int valueToAdd)
Modify the z index attributeandroid.animation.Animator
addZAnimator(int zValue1, int zValue2, int durPhase1, int durPhase2, int startDelay)
Add an animator to modify the z value of an object in two phases.android.animation.AnimatorSet
addZoomAnimator(double zoomFactor, int duration)
Add an animator to zoom the object.android.animation.AnimatorSet
addZoomAnimator(double zoomFactor, int duration, int startDelay)
Add an animator to zoom the object.android.animation.AnimatorSet
addZoomAnimator(double zoomFactor, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to zoom the object.android.animation.AnimatorSet
addZoomAnimator(double zoomFactor, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to zoom the object.void
clearAnimatorList()
Removes all registered animators.boolean
contains(int x, int y)
Check if a given point is within the enclosing rectangle of the Drawable or View objectboolean
contains(android.graphics.Point point)
Check if a given point is within the enclosing rectangle of the Drawable or View objectstatic AnimatedGuiObjectCV
createBitmapText(android.content.Context context, java.lang.String name, java.lang.String text, int centerX, int centerY, int textHeight)
Static method to create an AnimatedGuiObjectCV with a Bitmap showing a text.static AnimatedGuiObjectCV
createCircle(java.lang.String name, int color, int centerX, int centerY, int diameter)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is an circle.static AnimatedGuiObjectCV
createFromBitmap(android.content.Context context, java.lang.String name, android.graphics.Bitmap bitmap, int centerX, int centerY, int width, int height)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is a BitmapDrawable.static AnimatedGuiObjectCV
createFromDrawable(java.lang.String name, android.graphics.drawable.Drawable drawable, int centerX, int centerY)
Static method to create an AnimatedGuiObjectCV with an embedded Drawable, especially a LayerDrawable.static AnimatedGuiObjectCV
createFromPath(android.graphics.Path path, java.lang.String name, int color, int centerX, int centerY, int width, int height)
Static method to create an AnimatedGuiObjectCV with a PathShape.static AnimatedGuiObjectCV
createFromView(android.view.View view, java.lang.String name, int left, int top)
Static method to create an AnimatedGuiObjectCV whose embedded object is a View.static AnimatedGuiObjectCV
createOval(java.lang.String name, int color, int centerX, int centerY, int width, int height)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is an oval.static AnimatedGuiObjectCV
createRect(java.lang.String name, int color, int centerX, int centerY, int width, int height)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is a rectangle.static AnimatedGuiObjectCV
createSquare(java.lang.String name, int color, int centerX, int centerY, int width)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is an square.static AnimatedGuiObjectCV
createStar(java.lang.String name, int noOfPoints, int centerX, int centerY, int outerRadius, int innerRadius, int color)
Method to create a star-shaped object, i.e. an object of class AnimatedGuiObjectCV of type TYPE_DRAWABLE_PATH.static AnimatedGuiObjectCV
createStar(java.lang.String name, int noOfPoints, int centerX, int centerY, int outerRadius, int innerRadius, int color, double rotAngle)
Method to create a star-shaped object, i.e. an object of class AnimatedGuiObjectCV of type TYPE_DRAWABLE_PATH.static AnimatedGuiObjectCV
createText(java.lang.String name, java.lang.String text, int centerX, int centerY, int textHeight)
Static method to create an AnimatedGuiObjectCV with a text.void
delete()
Method to delete the object.void
draw(android.graphics.Canvas canvas)
Draw the guiObject and all its dependent objects of class DependentGuiObjectCV on a canvas.void
draw(android.graphics.Canvas canvas, boolean drawGuiObject, boolean drawDependentObjects)
Draw the guiObject and/or all its dependent objects of class DependentGuiObjectCV on a canvas.void
drawDependentsInBackground(android.graphics.Canvas canvas)
Draw all objects of class DependentGuiObjectCV that depend on this AnimatedGuiObjectCV object and shall appear in the background.java.util.ArrayList<android.animation.Animator>
getAnimators()
Returns the animators currently registered with the object, i.e. a copy of the ArrayList containing the references to the animators.android.graphics.Rect
getArea()
Get the enclosing rectangle of the embedded Drawable or View object (in case of a rotated object, the rectangle for the object without rotation is returned)int
getBottomBound()
Get the bottom bound = the Y coordinate of the bottom left and right corner of the embedded Drawable or View object, i.e. of its enclosing rectangle.android.graphics.Point
getCenter()
Get the center of the embedded Drawable or View objectint
getCenterX()
Get the X coordinate of the center of the embedded Drawable or View objectint
getCenterY()
Get the Y coordinate of the center of the embedded Drawable or View objectint
getColor()
Get the color of the embedded Drawable or View objectandroid.graphics.Point[]
getCorners()
Get the four corners of the embedded Drawable or View object (i.e. of its enclosing rectangle).java.lang.Object
getData()
Get the data stored with the object.java.util.ArrayList<DependentGuiObjectCV>
getDependentGuiObjects()
Get all registered dependent objects of class DependentGuiObjectCV.AnimationViewCV
getDisplayingView()
Get the view displaying the object.T
getGuiObject()
Get the embedded Drawable or View objectint
getHeight()
Get the height of the embedded Drawable or View object, i.e. of its enclosing rectangle.int
getLeftBound()
Get the left bound = the X coordinate of the top and bottom left corner of the embedded Drawable or View object, i.e. of its enclosing rectangle.int
getMaxX()
For an unrotated object, the method returns the same value as getRightBound().int
getMaxY()
For an unrotated object, the method returns the same value as getBottomBound().int
getMinX()
For an unrotated object, the method returns the same value as getLeftBound().int
getMinY()
For an unrotated object, the method returns the same value as getTopBound().java.lang.String
getName()
Get the name of the objectAnimatedGuiObjectCV.ObjectProperties
getProperties()
Method to get the properties of the object as defined by class ObjectProperties.int
getRightBound()
Get the right bound = the X coordinate of the bottom right corner of the embedded Drawable or View object, i.e. of its enclosing rectangle.float
getRotationAngle()
Get the rotation angle of the embedded Drawable or View object (if a Drawable object is not rotatable, i.e. not of class RotatableDrawableCV, the return value will be 0)int
getTopBound()
Get the top bound = the Y coordinate of the top left and right corner of the embedded Drawable or View object, i.e. of its enclosing rectangle.int
getTransparency()
Get the transparency value of the embedded Drawable or View objectint
getType()
Get the type of the embedded objectboolean
getVisible()
Gets the visibilityint
getWidth()
Get the width of the embedded Drawable or View object, i.e. of its enclosing rectangle.int
getZindex()
Get the current value of the z index attributejava.lang.Boolean
isVisible()
Checks if the object is currently visibleboolean
liesInArea(int left, int top, int right, int bottom)
Checks if the object lies (partly or completely) within a given rectangle.boolean
liesOnTop()
Check if the object lies on top of all objects that are currently displayed at its position.void
move(int dirX, int dirY)
Move the object by a vector (i.e. for a specific distance into a specific direction)boolean
overlapsWith(AnimatedGuiObjectCV obj)
Check if another object overlaps with this object.android.animation.AnimatorSet
playSequentially(android.animation.Animator... anims)
Add a set of animators that shall be played one after the other.android.animation.AnimatorSet
playTogether(android.animation.Animator... anims)
Add a set of animators that shall be played simultaneously.void
removeAllDependentGuiObjects()
Deregister all objects of class DependentGuiObjectCV.void
removeAllPropertyChangedListeners()
Deregister all listeners to react upon property changes.void
removeAnimator(android.animation.Animator animator)
Removes an animator from the animator list of the animated object.void
removeDependentGuiObject(DependentGuiObjectCV obj)
Deregister an object of class DependentGuiObjectCV.void
removePropertyChangedListener(AnimatedGuiObjectCV.OnPropertyChangedListener listener)
Deregister a listener to react upon property changes.void
setCenter(int centerX, int centerY)
Set the center of the embedded Drawable or View objectvoid
setCenter(android.graphics.Point center)
Set the center of the embedded Drawable or View objectvoid
setCenterX(int centerX)
Set the X coordinate of the center of the embedded Drawable or View objectvoid
setCenterY(int centerY)
Set the Y coordinate of the center of the embedded Drawable or View objectvoid
setColor(int color)
Set the color of the embedded Drawable or View object (for Drawable objects only effective if is of type ShapeDrawable, DrawableTextCV, or DrawableTextWithIconCV)void
setColorBorder(int color)
Set the border color of the embedded DrawabletextWithIconCV object (only effective for objects of this type)void
setData(java.lang.Object data)
Set the data stored with the objectvoid
setDisplayingView(AnimationViewCV displayingView)
Set the displayingView that shall display the object.protected void
setGuiObject(T guiObject)
Set the embedded Drawable or View object.void
setHeight(int height)
Set the height of the embedded Drawable or View object, i.e. the height of the enclosing rectangle.void
setLeftBound(int left)
Set the left bound of the embedded Drawable or View object = the X coordinate of the top left corner of its enclosing rectangle.void
setLeftTop(int left, int top)
Set the left and the top bound of the embedded Drawable or View object = set the coordinates of the top left corner of its enclosing rectangle.void
setLeftTop(android.graphics.Point leftTop)
Set the left and the top bound of the embedded Drawable or View object = the coordinates of the top left corner of its enclosing rectangle.void
setName(java.lang.String name)
Set the name of the objectvoid
setProperties(AnimatedGuiObjectCV.ObjectProperties values)
Method to assign values to members of the object.void
setPropertiesAnimated(AnimatedGuiObjectCV.ObjectProperties values, int duration, int startDelay)
Method to assign values to members of the object.void
setRotationAngle(float rotationAngle)
Set the rotation angle of the embedded Drawable or View object (for an embedded Drawable object only effective if it is of class RotatableDrawableCV, i.e. has been generated by the corresponding constructor that specifies an initial rotation angle)void
setSize(int width, int height)
Set the size of the embedded Drawable or View object, i.e. the width and height of the enclosing rectangle.void
setStrokewidthBorder(int strokewidthBorder)
Set the border stroke width of the embedded DrawabletextWithIconCV object (only effective for objects of this type)void
setTopBound(int top)
Set the top bound of the embedded Drawable or View object = the Y coordinate of the top left corner of its enclosing rectangle.void
setTransparency(int transparency)
Set the transparency of the embedded Drawable or View object (for a Drawable object only effective if is of type ShapeDrawable ot DrawableTextWithIconCV).void
setVisible(java.lang.Boolean visible)
Sets the visibilityvoid
setWidth(int width)
Set the width of the embedded Drawable or View object, i.e. the width of the enclosing rectangle.void
setZindex(int zindex)
Set the z indexvoid
startAnimation()
Start all registered animators simultaneously and immediately.
-
-
-
Field Detail
-
TYPE_VIEW
public static final int TYPE_VIEW
Type of the animated object: View- See Also:
- Constant Field Values
-
TYPE_DRAWABLE_RECT
public static final int TYPE_DRAWABLE_RECT
Type of the animated object: ShapeDrawable with a RectShape- See Also:
- Constant Field Values
-
TYPE_DRAWABLE_SQUARE
public static final int TYPE_DRAWABLE_SQUARE
Type of the animated object: ShapeDrawable with a RectShape that is a square- See Also:
- Constant Field Values
-
TYPE_DRAWABLE_OVAL
public static final int TYPE_DRAWABLE_OVAL
Type of the animated object: ShapeDrawable with an OvalShape- See Also:
- Constant Field Values
-
TYPE_DRAWABLE_CIRCLE
public static final int TYPE_DRAWABLE_CIRCLE
Type of the animated object: ShapeDrawable with an OvalShape that is a circle- See Also:
- Constant Field Values
-
TYPE_DRAWABLE_TEXT
public static final int TYPE_DRAWABLE_TEXT
Type of the animated object: Text (= object of class DrawableTextCV)- See Also:
- Constant Field Values
-
TYPE_DRAWABLE_PATH
public static final int TYPE_DRAWABLE_PATH
Type of the animated object: ShapeDrawable with a PathShape- See Also:
- Constant Field Values
-
TYPE_DRAWABLE_BITMAP
public static final int TYPE_DRAWABLE_BITMAP
Type of the animated object: BitmapDrawable- See Also:
- Constant Field Values
-
TYPE_DRAWABLE_BITMAPTEXT
public static final int TYPE_DRAWABLE_BITMAPTEXT
Type of the animated object: BitmapDrawable showing a text- See Also:
- Constant Field Values
-
TYPE_DRAWABLE_ANY
public static final int TYPE_DRAWABLE_ANY
Type of the animated object: Any Drawable (for this type of object, currently only the path and rotate animations work)- See Also:
- Constant Field Values
-
guiObject
protected T guiObject
Drawable or View object to be animated
-
-
Constructor Detail
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(android.view.View view, java.lang.String name, int left, int top)
Constructor for embedded View objects. Instead of this constructor, the corresponding static method createFromView can be used.- Parameters:
view
- View object to be embeddedname
- Name of the View objectleft
- X coordinate of the left top cornertop
- Y coordinate of the left top corner- See Also:
createFromView(View, String, int, int)
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(int type, java.lang.String name, int color, int centerX, int centerY, int width, int height)
Constructor for embedded Drawable objects that can be rectangles/squares or ovals/circles. NB: Objects generated by this constructor cannnot be rotated. Rotatable objects are generated by the corresponding constructor with 'rotAngle' as last parameter. Instead of this constructor, one of the corresponding static create methods can be used.- Parameters:
type
- Type of the Drawable object (see constants TYPE_DRAWABLE_OVAL, ...).
For TYPE_DRAWABLE_SQUARE and TYPE_DRAWABLE_CIRCLE, the 'height' parameter is ignored, i.e. it is assumed that 'height' == 'width'.
In case of undefined values or for TYPE_DRAWABLE_BITMAP, a rectangle will be generated (for TYPE_DRAWABLE_BITMAP, use the constructor with a Bitmap parameter):name
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable object- See Also:
AnimatedGuiObjectCV(int, String, int, int, int, int, int, double)
,createRect(String, int, int, int, int, int)
,createOval(String, int, int, int, int, int)
,createSquare(String, int, int, int, int)
,createCircle(String, int, int, int, int)
,TYPE_DRAWABLE_RECT
,TYPE_DRAWABLE_SQUARE
,TYPE_DRAWABLE_OVAL
,TYPE_DRAWABLE_CIRCLE
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(int type, java.lang.String name, int color, int centerX, int centerY, int width, int height, double rotAngle)
Constructor for embedded Drawable objects that can be rectangles/squares or ovals/circles.
Instead of this constructor, one of the corresponding static create methods can be used.- Parameters:
type
- Type of the Drawable object (see constants TYPE_DRAWABLE_OVAL, ...).
For TYPE_DRAWABLE_SQUARE and TYPE_DRAWABLE_CIRCLE, the 'height' parameter is ignored, i.e. it is assumed that 'height' == 'width'.
In case of undefined values or for TYPE_DRAWABLE_BITMAP, a rectangle will be generated (for TYPE_DRAWABLE_BITMAP, use the constructor with a Bitmap parameter):name
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable objectrotAngle
- Rotation angle (in radians)- See Also:
createRect(String, int, int, int, int, int)
,createOval(String, int, int, int, int, int)
,createSquare(String, int, int, int, int)
,createCircle(String, int, int, int, int)
,TYPE_DRAWABLE_RECT
,TYPE_DRAWABLE_SQUARE
,TYPE_DRAWABLE_OVAL
,TYPE_DRAWABLE_CIRCLE
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(int type, java.lang.String name, int color, int centerX, int centerY, int width)
Constructor for embedded Drawable objects that can be squares or circles. NB: Objects generated by this constructor cannnot be rotated. Rotatable objects are generated by the corresponding constructor with 'rotAngle' as last parameter. Instead of this constructor, one of the corresponding static create methods can be used.- Parameters:
type
- Type of the Drawable object (see constants TYPE_DRAWABLE_OVAL, ...).
For TYPE_DRAWABLE_SQUARE and TYPE_DRAWABLE_RECT, a square with upper left corner (left,top) and side length 'width' will be generated.
For TYPE_DRAWABLE_CIRCLE and TYPE_DRAWABLE_OVAL, a circle with upper left corner (left,top) and diameter 'width' will be generated.
In case of undefined values or for TYPE_DRAWABLE_BITMAP, a rectangle will be generated (for TYPE_DRAWABLE_BITMAP, use the constructor with a Bitmap parameter):name
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Side length (for TYPE_DRAWABLE_SQUARE) or diameter (for TYPE_DRAWABLE_CIRCLE) of the Drawable object- See Also:
AnimatedGuiObjectCV(int, String, int, int, int, int, double)
,createSquare(String, int, int, int, int)
,createCircle(String, int, int, int, int)
,TYPE_DRAWABLE_RECT
,TYPE_DRAWABLE_SQUARE
,TYPE_DRAWABLE_OVAL
,TYPE_DRAWABLE_CIRCLE
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(int type, java.lang.String name, int color, int centerX, int centerY, int width, double rotAngle)
Constructor for embedded Drawable objects that can be squares or circles. Instead of this constructor, one of the corresponding static create methods can be used.- Parameters:
type
- Type of the Drawable object (see constants TYPE_DRAWABLE_OVAL, ...).
For TYPE_DRAWABLE_SQUARE and TYPE_DRAWABLE_RECT, a square with upper left corner (left,top) and side length 'width' will be generated.
For TYPE_DRAWABLE_CIRCLE and TYPE_DRAWABLE_OVAL, a circle with upper left corner (left,top) and diameter 'width' will be generated.
In case of undefined values or for TYPE_DRAWABLE_BITMAP, a rectangle will be generated (for TYPE_DRAWABLE_BITMAP, use the constructor with a Bitmap parameter):name
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Side length (for TYPE_DRAWABLE_SQUARE) or diameter (for TYPE_DRAWABLE_CIRCLE) of the Drawable object- See Also:
createSquare(String, int, int, int, int)
,createCircle(String, int, int, int, int)
,TYPE_DRAWABLE_RECT
,TYPE_DRAWABLE_SQUARE
,TYPE_DRAWABLE_OVAL
,TYPE_DRAWABLE_CIRCLE
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(android.graphics.Path path, java.lang.String name, int color, int centerX, int centerY, int width, int height)
Constructor for embedded Drawable objects with a PathShape. NB: Objects generated by this constructor cannnot be rotated. Rotatable objects are generated by the corresponding constructor with 'rotAngle' as last parameter. Instead of this constructor, the static method createFromPath can be used.- Parameters:
path
- Path defining the PathShapename
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable object- See Also:
AnimatedGuiObjectCV(Path, String, int, int, int, int, int, double)
,createFromPath(Path, String, int, int, int, int, int)
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(android.graphics.Path path, java.lang.String name, int color, int centerX, int centerY, int width, int height, double rotAngle)
Constructor for embedded Drawable objects with a PathShape.- Parameters:
path
- Path defining the PathShapename
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable objectrotAngle
- Rotation angle (in radians)
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(android.content.Context context, java.lang.String name, android.graphics.Bitmap bitmap, int centerX, int centerY, int width, int height)
Constructor for embedded Bitmap Drawables. NB: Objects generated by this constructor cannnot be rotated. Rotatable objects are generated by the corresponding constructor with 'rotAngle' as last parameter. Instead of this constructor, the corresponding static method createFromBitmap can be used.- Parameters:
context
- Contextname
- Name of the objectbitmap
- Bitmap to be displayedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable object- See Also:
AnimatedGuiObjectCV(Context, String, Bitmap, int, int, int, int, double)
,createFromBitmap(Context, String, Bitmap, int, int, int, int)
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(android.content.Context context, java.lang.String name, android.graphics.Bitmap bitmap, int centerX, int centerY, int width, int height, double rotAngle)
Constructor for embedded Bitmap Drawables.- Parameters:
context
- Contextname
- Name of the objectbitmap
- Bitmap to be displayedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable objectrotAngle
- Rotation angle (in radians)
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(int type, android.content.Context context, java.lang.String name, java.lang.String text, int centerX, int centerY, int textHeight)
Constructor for Drawables showing texts. NB: The objects generated cannot be rotated. For rotable objects, use the constructor with a 'rotAngle' parameter. Instead of this constructor, one of the corresponding static create methods can be used.- Parameters:
type
- type of the embedded object (either TYPE_DRAWABLE_TEXT = object shall be of class DrawableTextCV or TYPE_DRAWABLE_BITMAPTEXT = object shall be a BitmapDrawable showing the text). TYPE_DRAWABLE_TEXT: Constructor is very fast, but size animations can be jerky. TYPE_DRAWABLE_BITMAPTEXT: Constructor is somewhat slow, but animations (especially of size) are smooth.context
- Contextname
- Name of the objecttext
- Text to be displayedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objecttextHeight
- Height of the text (in pixels)- See Also:
AnimatedGuiObjectCV(int, Context, String, String, int, int, int, double)
,createText(String, String, int, int, int)
,createBitmapText(Context, String, String, int, int, int)
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(int type, android.content.Context context, java.lang.String name, java.lang.String text, int centerX, int centerY, int textHeight, double rotAngle)
Constructor for Drawables showing texts. Instead of this constructor, one of the corresponding static create methods can be used.- Parameters:
type
- type of the embedded object (either TYPE_DRAWABLE_TEXT = object shall be of class DrawableTextCV or TYPE_DRAWABLE_BITMAPTEXT = object shall be a BitmapDrawable showing the text) TYPE_DRAWABLE_TEXT: Constructor is very fast, but size animations can be jerky. TYPE_DRAWABLE_BITMAPTEXT: Constructor is somewhat slow, but animations (especially of size) are smooth.context
- Contextname
- Name of the objecttext
- Text to be displayedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objecttextHeight
- Height of the text (in pixels)rotAngle
- Rotation angle (in radians)- See Also:
createText(String, String, int, int, int)
,createBitmapText(Context, String, String, int, int, int)
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(java.lang.String name, android.graphics.drawable.Drawable drawable, int centerX, int centerY)
Constructor for embedded Drawables of any type, especially LayerDrawables (for this type of object, currently only the path and color animations work). NB: The objects generated cannot be rotated. For rotable objects, use the constructor with a 'rotAngle' parameter. Instead of this constructor, the static method createFromDrawable() can be used.- Parameters:
name
- Name of the objectdrawable
- The Drawable object to embedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable object- See Also:
AnimatedGuiObjectCV(String, Drawable, int, int, double)
,createFromDrawable(String, Drawable, int, int)
-
AnimatedGuiObjectCV
public AnimatedGuiObjectCV(java.lang.String name, android.graphics.drawable.Drawable drawable, int centerX, int centerY, double rotAngle)
Constructor for embedded Drawables of any type, especially LayerDrawables (for this type of object, currently only the path and rotate animations work).- Parameters:
name
- Name of the objectdrawable
- The Drawable object to embedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectrotAngle
- Rotation angle (in radians)
-
-
Method Detail
-
createFromView
public static AnimatedGuiObjectCV createFromView(android.view.View view, java.lang.String name, int left, int top)
Static method to create an AnimatedGuiObjectCV whose embedded object is a View.- Parameters:
view
- View object to be embeddedname
- Name of the View objectleft
- X coordinate of the left top cornertop
- Y coordinate of the left top corner- Returns:
- The created object.
-
createRect
public static AnimatedGuiObjectCV createRect(java.lang.String name, int color, int centerX, int centerY, int width, int height)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is a rectangle.- Parameters:
name
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable object- Returns:
- The created object.
-
createOval
public static AnimatedGuiObjectCV createOval(java.lang.String name, int color, int centerX, int centerY, int width, int height)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is an oval.- Parameters:
name
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable object- Returns:
- The created object.
-
createSquare
public static AnimatedGuiObjectCV createSquare(java.lang.String name, int color, int centerX, int centerY, int width)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is an square.- Parameters:
name
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable object- Returns:
- The created object.
-
createCircle
public static AnimatedGuiObjectCV createCircle(java.lang.String name, int color, int centerX, int centerY, int diameter)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is an circle.- Parameters:
name
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectdiameter
- Diameter of the Drawable object- Returns:
- The created object.
-
createFromPath
public static AnimatedGuiObjectCV createFromPath(android.graphics.Path path, java.lang.String name, int color, int centerX, int centerY, int width, int height)
Static method to create an AnimatedGuiObjectCV with a PathShape.- Parameters:
path
- Path defining the PathShapename
- Name of the objectcolor
- Color of the Drawable objectcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable object- Returns:
- The created object
-
createStar
public static AnimatedGuiObjectCV createStar(java.lang.String name, int noOfPoints, int centerX, int centerY, int outerRadius, int innerRadius, int color)
Method to create a star-shaped object, i.e. an object of class AnimatedGuiObjectCV of type TYPE_DRAWABLE_PATH.- Parameters:
name
- Name of the objectnoOfPoints
- Number of points of the starcenterX
- center of the star - X coordinatecenterY
- center of the star - Y coordinateouterRadius
- Radius of the circle that goes through the points of the starinnerRadius
- Radius of the circle that goes through the indentations of the starcolor
- Color of the star
-
createStar
public static AnimatedGuiObjectCV createStar(java.lang.String name, int noOfPoints, int centerX, int centerY, int outerRadius, int innerRadius, int color, double rotAngle)
Method to create a star-shaped object, i.e. an object of class AnimatedGuiObjectCV of type TYPE_DRAWABLE_PATH.- Parameters:
name
- Name of the objectnoOfPoints
- Number of points of the starcenterX
- center of the star - X coordinatecenterY
- center of the star - Y coordinateouterRadius
- Radius of the circle that goes through the points of the starinnerRadius
- Radius of the circle that goes through the indentations of the starcolor
- Color of the starrotAngle
- Rotation angle of the star (in radians). 0 = One point of the star points straightly upwards
-
createFromBitmap
public static AnimatedGuiObjectCV createFromBitmap(android.content.Context context, java.lang.String name, android.graphics.Bitmap bitmap, int centerX, int centerY, int width, int height)
Static method to create an AnimatedGuiObjectCV whose embedded Drawable object is a BitmapDrawable.- Parameters:
context
- Contextname
- Name of the objectbitmap
- Bitmap to be displayedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objectwidth
- Width of the Drawable objectheight
- Height of the Drawable object- Returns:
- The created object
-
createText
public static AnimatedGuiObjectCV createText(java.lang.String name, java.lang.String text, int centerX, int centerY, int textHeight)
Static method to create an AnimatedGuiObjectCV with a text. The constructor called by this method is faster than that called by createBitmapText, but size animations can be jerky.- Parameters:
name
- Name of the objecttext
- Text to be displayedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objecttextHeight
- Height of the text (in pixels)- Returns:
- The created object
- See Also:
createBitmapText(Context, String, String, int, int, int)
-
createBitmapText
public static AnimatedGuiObjectCV createBitmapText(android.content.Context context, java.lang.String name, java.lang.String text, int centerX, int centerY, int textHeight)
Static method to create an AnimatedGuiObjectCV with a Bitmap showing a text. The constructor called by this method is slower than that called by createBitmapText, but animations will be smoother.- Parameters:
context
- Contextname
- Name of the objecttext
- Text to be displayedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable objecttextHeight
- Height of the text (in pixels)- Returns:
- The created object
- See Also:
createText(String, String, int, int, int)
-
createFromDrawable
public static AnimatedGuiObjectCV createFromDrawable(java.lang.String name, android.graphics.drawable.Drawable drawable, int centerX, int centerY)
Static method to create an AnimatedGuiObjectCV with an embedded Drawable, especially a LayerDrawable. (for this type of object, currently only the path, rotate, and color animations work)- Parameters:
name
- Name of the objectdrawable
- The Drawable object to embedcenterX
- X coordinate of the center of the Drawable objectcenterY
- Y coordinate of the center of the Drawable object- Returns:
- The created object
-
delete
public void delete()
Method to delete the object. It will deregister the object from its view, remove all dependent gui objects and all property change listeners and clear the animator list.
-
setLeftBound
public void setLeftBound(int left)
Set the left bound of the embedded Drawable or View object = the X coordinate of the top left corner of its enclosing rectangle. NB: For a rotated object, this refers to the unrotated enclosing rectangle.- Parameters:
left
- Left bound = X coordinate of the top left corner
-
setTopBound
public void setTopBound(int top)
Set the top bound of the embedded Drawable or View object = the Y coordinate of the top left corner of its enclosing rectangle. NB: For a rotated object, this refers to the unrotated enclosing rectangle.- Parameters:
top
- Top bound = Y coordinate of the top left corner
-
setLeftTop
public void setLeftTop(int left, int top)
Set the left and the top bound of the embedded Drawable or View object = set the coordinates of the top left corner of its enclosing rectangle. NB: For a rotated object, this refers to the unrotated enclosing rectangle.- Parameters:
left
- Left bound = X coordinate of the top left cornertop
- Top bound = Y coordinate of the top left corner
-
setLeftTop
public void setLeftTop(android.graphics.Point leftTop)
Set the left and the top bound of the embedded Drawable or View object = the coordinates of the top left corner of its enclosing rectangle. NB: For a rotated object, this refers to the unrotated enclosing rectangle.- Parameters:
leftTop
- coordinates of the top left corner
-
setCenterX
public void setCenterX(int centerX)
Set the X coordinate of the center of the embedded Drawable or View object- Parameters:
centerX
- X coordinate of the center
-
setCenterY
public void setCenterY(int centerY)
Set the Y coordinate of the center of the embedded Drawable or View object- Parameters:
centerY
- Y coordinate of the center
-
setCenter
public void setCenter(int centerX, int centerY)
Set the center of the embedded Drawable or View object- Parameters:
centerX
- X coordinate of the center of the objectcenterY
- Y coordinate of the center of the object
-
setCenter
public void setCenter(android.graphics.Point center)
Set the center of the embedded Drawable or View object- Parameters:
center
- center of the object
-
setWidth
public void setWidth(int width)
Set the width of the embedded Drawable or View object, i.e. the width of the enclosing rectangle. NB: For rotated objects, this refers to the width of the unrotated enclosing rectangle.- Parameters:
width
- Width
-
setHeight
public void setHeight(int height)
Set the height of the embedded Drawable or View object, i.e. the height of the enclosing rectangle. NB: For rotated objects, this refers to the height of the unrotated enclosing rectangle.- Parameters:
height
- Height
-
setSize
public void setSize(int width, int height)
Set the size of the embedded Drawable or View object, i.e. the width and height of the enclosing rectangle. NB: For rotated objects, this refers to the width and height of the unrotated enclosing rectangle.- Parameters:
width
- Widthheight
- Height
-
setRotationAngle
public void setRotationAngle(float rotationAngle)
Set the rotation angle of the embedded Drawable or View object (for an embedded Drawable object only effective if it is of class RotatableDrawableCV, i.e. has been generated by the corresponding constructor that specifies an initial rotation angle)- Parameters:
rotationAngle
- Rotation angle
-
setGuiObject
protected void setGuiObject(T guiObject)
Set the embedded Drawable or View object. Only accessible from the same package.
-
getGuiObject
public T getGuiObject()
Get the embedded Drawable or View object- Returns:
- The Drawable or View object
-
getLeftBound
public int getLeftBound()
Get the left bound = the X coordinate of the top and bottom left corner of the embedded Drawable or View object, i.e. of its enclosing rectangle. NB: For rotated objects, this refers to the unrotated rectangle. If you want to have the the value for the rotated rectangle, use getMinX() instead!- Returns:
- X coordinate of the top and bottom left corner
-
getMinX
public int getMinX()
For an unrotated object, the method returns the same value as getLeftBound(). For a rotated object, it returns the X coordinate of the leftmost corner of the enclosing rotated rectangle (whereas getLeftBound() does not take the rotation into account). NB: Does not yet work correctly for rotated embedded View objects.- Returns:
- The minimum X coordinate
-
getRightBound
public int getRightBound()
Get the right bound = the X coordinate of the bottom right corner of the embedded Drawable or View object, i.e. of its enclosing rectangle. NB: For rotated objects, this refers to the unrotated rectangle. If you want to have the value for the rotated rectangle, use getMaxX() instead!- Returns:
- X coordinate of the top and bottom right corner
-
getMaxX
public int getMaxX()
For an unrotated object, the method returns the same value as getRightBound(). For a rotated object, it returns the X coordinate of the rightmost corner of the enclosing rotated rectangle (whereas getRightBound() does not take the rotation into account).- Returns:
- The maximum X coordinate
-
getTopBound
public int getTopBound()
Get the top bound = the Y coordinate of the top left and right corner of the embedded Drawable or View object, i.e. of its enclosing rectangle. NB: For rotated objects, this refers to the unrotated rectangle. If you want to have the value for the rotated rectangle, use getMinY() instead!- Returns:
- Y coordinate of the top left and right corner
-
getMinY
public int getMinY()
For an unrotated object, the method returns the same value as getTopBound(). For a rotated object, it returns the Y coordinate of the topmost corner of the enclosing rotated rectangle (whereas getTopBound() does not take the rotation into account). NB: Does not yet work correctly for rotated embedded View objects.- Returns:
- The minimum Y coordinate
-
getBottomBound
public int getBottomBound()
Get the bottom bound = the Y coordinate of the bottom left and right corner of the embedded Drawable or View object, i.e. of its enclosing rectangle. NB: For rotated objects, this refers to the unrotated rectangle. If you want to have the value for the rotated rectangle, use getMaxY() instead!- Returns:
- Y coordinate of the bottom left and right corner
-
getMaxY
public int getMaxY()
For an unrotated object, the method returns the same value as getBottomBound(). For a rotated object, it returns the Y coordinate of the lowermost corner of the enclosing rotated rectangle (whereas getBottomBound() does not take the rotation into account). NB: Does not yet work correctly for rotated embedded View objects.- Returns:
- The maximum Y coordinate
-
getCenterX
public int getCenterX()
Get the X coordinate of the center of the embedded Drawable or View object- Returns:
- X coordinate of the center
-
getCenterY
public int getCenterY()
Get the Y coordinate of the center of the embedded Drawable or View object- Returns:
- Y coordinate of the center
-
getCenter
public android.graphics.Point getCenter()
Get the center of the embedded Drawable or View object- Returns:
- center of the object
-
getWidth
public int getWidth()
Get the width of the embedded Drawable or View object, i.e. of its enclosing rectangle. NB: For rotated objects, this refers to the unrotated rectangle. If you want to have a value based for the rotated object, use getCorners() instead!- Returns:
- width
-
getHeight
public int getHeight()
Get the height of the embedded Drawable or View object, i.e. of its enclosing rectangle. NB: For rotated objects, this refers to the unrotated rectangle. If you want to have a value based for the rotated object, use getCorners() instead!- Returns:
- height
-
setColor
public void setColor(int color)
Set the color of the embedded Drawable or View object (for Drawable objects only effective if is of type ShapeDrawable, DrawableTextCV, or DrawableTextWithIconCV)
-
setColorBorder
public void setColorBorder(int color)
Set the border color of the embedded DrawabletextWithIconCV object (only effective for objects of this type)
-
setStrokewidthBorder
public void setStrokewidthBorder(int strokewidthBorder)
Set the border stroke width of the embedded DrawabletextWithIconCV object (only effective for objects of this type)
-
getColor
public int getColor()
Get the color of the embedded Drawable or View object- Returns:
- color (if type ShapeDrawable or DrawableTextWithIconCV or View), 0 (otherwise)
-
setTransparency
public void setTransparency(int transparency)
Set the transparency of the embedded Drawable or View object (for a Drawable object only effective if is of type ShapeDrawable ot DrawableTextWithIconCV).- Parameters:
transparency
- The new transparency of the object (= transparency byte of the color attribute). If transparency<0 the transparency byte will be set to 0x==. If transparency>255 the transparency byte will be set to 0xFF.
-
getTransparency
public int getTransparency()
Get the transparency value of the embedded Drawable or View object- Returns:
- transparency (if type ShapeDrawable or DrawableTextWithIconCV or View), 0 (otherwise)
-
getType
public int getType()
Get the type of the embedded object- Returns:
- type The type of the object (TYPE_VIEW, TYPE_DRAWABLE_RECT, ...)
-
getRotationAngle
public float getRotationAngle()
Get the rotation angle of the embedded Drawable or View object (if a Drawable object is not rotatable, i.e. not of class RotatableDrawableCV, the return value will be 0)- Returns:
- Current rotation angle
-
getName
public java.lang.String getName()
Get the name of the object- Returns:
- The name of the object
-
setName
public void setName(java.lang.String name)
Set the name of the object- Parameters:
name
-
-
getData
public java.lang.Object getData()
Get the data stored with the object.- Returns:
- The data stored with the object.
-
setData
public void setData(java.lang.Object data)
Set the data stored with the object- Parameters:
data
-
-
getDisplayingView
public AnimationViewCV getDisplayingView()
Get the view displaying the object.- Returns:
- The AnimationViewCV object displaying this GUI object.
-
setDisplayingView
public void setDisplayingView(AnimationViewCV displayingView)
Set the displayingView that shall display the object. Will be called in the addAnimatedGuiObject() method of a displayingView of class AnimatedViewCV.- Parameters:
displayingView
-
-
getVisible
public boolean getVisible()
Gets the visibility- Returns:
- The current value of the visible attribute (the return type being 'Boolean' instead of 'boolean' because this method is called by the evaluator of an animator)
-
setVisible
public void setVisible(java.lang.Boolean visible)
Sets the visibility- Parameters:
visible
- The new value for the visible attribute (the parameter type being 'Boolean' instead of 'boolean' because this method is called by the evaluator of an animator)
-
isVisible
public java.lang.Boolean isVisible()
Checks if the object is currently visible- Returns:
- Current value of the visible attribute
-
setZindex
public void setZindex(int zindex)
Set the z index- Parameters:
zindex
- The new value for the zindex attribute
-
getZindex
public int getZindex()
Get the current value of the z index attribute- Returns:
- The z index value
-
addToZindex
public int addToZindex(int valueToAdd)
Modify the z index attribute- Parameters:
valueToAdd
- The value that shall be added to the z index (can be negative)- Returns:
- The new z index value
-
liesOnTop
public boolean liesOnTop()
Check if the object lies on top of all objects that are currently displayed at its position.- Returns:
- true if it lies on top, false otherwise
-
getCorners
public android.graphics.Point[] getCorners()
Get the four corners of the embedded Drawable or View object (i.e. of its enclosing rectangle). If the object is rotated the corners of the rotated enclosing rectangle are returned (in contrast to getTopBound() etc.). NB: Does not yet work correctly for rotated embedded View objects.- Returns:
- Array with exactly four elements of class Point, specifying the four corners (in clockwise order, starting with the left top corner - for rotated objects, the notion "left top" etc. refers to the position of the corner of the unrotated enclosing rectangle)
-
getArea
public android.graphics.Rect getArea()
Get the enclosing rectangle of the embedded Drawable or View object (in case of a rotated object, the rectangle for the object without rotation is returned)- Returns:
- The enclosing rectangle
-
draw
public void draw(android.graphics.Canvas canvas)
Draw the guiObject and all its dependent objects of class DependentGuiObjectCV on a canvas.- Parameters:
canvas
- Canvas to draw on
-
draw
public void draw(android.graphics.Canvas canvas, boolean drawGuiObject, boolean drawDependentObjects)
Draw the guiObject and/or all its dependent objects of class DependentGuiObjectCV on a canvas. If all dependent objects shall appear in the background (e.g. lines connecting GUI objects), call draw() first with drawDependentObjects==true and then again with drawGuiObject==true. This it done so by the draw() method of AnimationViewCV.- Parameters:
canvas
- Canvas to draw ondrawGuiObject
- Draw the guiObject itselfdrawDependentObjects
- Draw the dependent objects
-
drawDependentsInBackground
public void drawDependentsInBackground(android.graphics.Canvas canvas)
Draw all objects of class DependentGuiObjectCV that depend on this AnimatedGuiObjectCV object and shall appear in the background.- Parameters:
canvas
- Canvas to draw on
-
contains
public boolean contains(int x, int y)
Check if a given point is within the enclosing rectangle of the Drawable or View object- Parameters:
x
- X coordinate of the pointy
- Y coordinate of the point- Returns:
- The test result
-
contains
public boolean contains(android.graphics.Point point)
Check if a given point is within the enclosing rectangle of the Drawable or View object- Parameters:
point
- The point- Returns:
- The test result
-
overlapsWith
public boolean overlapsWith(AnimatedGuiObjectCV obj)
Check if another object overlaps with this object.- Parameters:
obj
- The object for which overlapping shall be checked- Returns:
- true if obj overlaps with this object, false otherwise
-
liesInArea
public boolean liesInArea(int left, int top, int right, int bottom)
Checks if the object lies (partly or completely) within a given rectangle.- Parameters:
left
- left bound of the rectangletop
- upper bound of the rectangleright
- right bound of the rectanglebottom
- bottom bound of the rectangle- Returns:
- true if the object overlaps with the rectangle, false otherwise
-
move
public void move(int dirX, int dirY)
Move the object by a vector (i.e. for a specific distance into a specific direction)- Parameters:
dirX
- X coordinate of the vectordirY
- Y coordinate of the vector
-
addDependentGuiObject
public void addDependentGuiObject(DependentGuiObjectCV obj)
Register an object of class DependentGuiObjectCV to be drawn together with this object.- Parameters:
obj
- The object to be registered
-
getDependentGuiObjects
public java.util.ArrayList<DependentGuiObjectCV> getDependentGuiObjects()
Get all registered dependent objects of class DependentGuiObjectCV.- Returns:
- ArrayList that contains all registered objects of class DependentGuiObjectCV
-
removeDependentGuiObject
public void removeDependentGuiObject(DependentGuiObjectCV obj)
Deregister an object of class DependentGuiObjectCV.- Parameters:
obj
- The object to be deregistered
-
removeAllDependentGuiObjects
public void removeAllDependentGuiObjects()
Deregister all objects of class DependentGuiObjectCV.
-
startAnimation
public void startAnimation()
Start all registered animators simultaneously and immediately. Once an animator has finished its execution, it will be automatically removed from the object's animator list and therefore can (and will) not be restarted.
-
playSequentially
public android.animation.AnimatorSet playSequentially(android.animation.Animator... anims)
Add a set of animators that shall be played one after the other. The method generates a corresponding AnimatorSet object and adds it to the object's 'animators' attribute. The individual animators are removed from the 'animators' attribute (if present there). The usual way to specify a combination of animators is first to generate the individual animators and then to combine them by calling playSequentially() and playTogether(). The animators can be generated either by using the addXXXAnimator() methods or by "stand-alone methods" like ObjectAnimator.ofFloat(). They can be registered with the object (as the addXXXAnimator() methods do) but such an advance registration is not mandatory. It is possible to nest these playXXX() calls, e.g. myObject.playSequentially(myObject.playTogether(anim1,anim2),myObject.playTogether(anim3,anim3)).- Parameters:
anims
- Animators to be played- Returns:
- Animator set containing the animators
-
playTogether
public android.animation.AnimatorSet playTogether(android.animation.Animator... anims)
Add a set of animators that shall be played simultaneously. The method generates a corresponding AnimatorSet object and adds it to the object's 'animators' attribute. The individual animators are removed from the 'animators' attribute (if present there). The usual way to specify a combination of animators is first to generate the individual animators and then to combine them by calling playSequentially() and playTogether(). The animators can be generated either by using the addXXXAnimator() methods or by "stand-alone methods" like ObjectAnimator.ofFloat(). They can be registered with the object (as the addXXXAnimator() methods do) but such an advance registration is not mandatory. It is possible to nest these playXXX() calls, e.g. myObject.playSequentially(myObject.playTogether(anim1,anim2),myObject.playTogether(anim3,anim3)).- Parameters:
anims
- Animators to be played- Returns:
- Animator set containing the animators
-
addAnimator
public void addAnimator(android.animation.Animator anim)
Add an animator to drive the animation of the embedded Drawable or View object. The animator will be played simultaneously to the other animators registered by this method. To specify temporal relationships, use the methods playTogether() and playSequentially().- Parameters:
anim
- Animator to be added
-
getAnimators
public java.util.ArrayList<android.animation.Animator> getAnimators()
Returns the animators currently registered with the object, i.e. a copy of the ArrayList containing the references to the animators.- Returns:
- ArrayList with the animators
-
removeAnimator
public void removeAnimator(android.animation.Animator animator)
Removes an animator from the animator list of the animated object.- Parameters:
animator
- The animator to be removed
-
clearAnimatorList
public void clearAnimatorList()
Removes all registered animators.
-
addLinearPathAnimator
public android.animation.AnimatorSet addLinearPathAnimator(int targetX, int targetY, int duration)
Add an animator to move the embedded Drawable or View object in a direct line to some specified target coordinates. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. The start delay is zero, i.e. the animation starts immediately.- Parameters:
targetX
- X coordinate of the target = horizontal center of the object at its final positiontargetY
- Y coordinate of the target = vertical center of the object at its final positionduration
- Duration of the animation (in ms)- Returns:
- The new animator (= set with two animators for the X and the Y property, respectively)
-
addLinearPathAnimator
public android.animation.AnimatorSet addLinearPathAnimator(int targetX, int targetY, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object in a direct line to some specified target coordinates. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed.- Parameters:
targetX
- X coordinate of the target = horizontal center of the object at its final positiontargetY
- Y coordinate of the target = vertical center of the object at its final positionduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator (= set with two animators for the X and the Y property, respectively)
-
addLinearPathAnimator
public android.animation.AnimatorSet addLinearPathAnimator(int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the embedded Drawable or View object in a direct line to some specified target coordinates. The start delay is zero, i.e. the animation starts immediately.- Parameters:
targetX
- X coordinate of the target = horizontal center of the object at its final positiontargetY
- Y coordinate of the target = vertical center of the object at its final positiontimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator (= set with two animators for the X and the Y property, respectively)
-
addLinearPathAnimator
public android.animation.AnimatorSet addLinearPathAnimator(int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object in a direct line to some specified target coordinates.- Parameters:
targetX
- X coordinate of the target = horizontal center of the object at its final positiontargetY
- Y coordinate of the target = vertical center of the object at its final positiontimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator (= set with two animators for the X and the Y property, respectively)
-
addAttractOrRepulseAnimator
public android.animation.Animator addAttractOrRepulseAnimator(int targetX, int targetY, double attractionFactor, int duration)
Add an animator to move the embedded Drawable or View object on a direct line towards some specified target coordinates or away from these coordinates. The distance of the object at its final position from these coordinates is the original distance multiplied by an attraction factor. If this factor is small than 1, the object will move closer to the target (i.e. will be attracted by the target). If this factor is larger than 1, the object will move farther away from the target (i.e. will be repulsed from the target). If this factor equals 0, the object will be moved onto the target coordinates. If this factor is smaller than 0, the object will be moved beyond the target coordinates.- Parameters:
targetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointattractionFactor
- Factor as explained aboveduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addAttractOrRepulseAnimator
public android.animation.Animator addAttractOrRepulseAnimator(int targetX, int targetY, double attractionFactor, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object on a direct line towards some specified target coordinates or away from these coordinates. The distance of the object at its final position from these coordinates is the original distance multiplied by an attraction factor. If this factor is small than 1, the object will move closer to the target (i.e. will be attracted by the target). If this factor is larger than 1, the object will move farther away from the target (i.e. will be repulsed from the target). If this factor equals 0, the object will be moved onto the target coordinates. If this factor is smaller than 0, the object will be moved beyond the target coordinates.- Parameters:
targetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointattractionFactor
- Factor as explained aboveduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addAttractOrRepulseAnimator
public android.animation.Animator addAttractOrRepulseAnimator(int targetX, int targetY, double attractionFactor, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the embedded Drawable or View object on a direct line towards some specified target coordinates or away from these coordinates. The distance of the object at its final position from these coordinates is the original distance multiplied by an attraction factor. If this factor is small than 1, the object will move closer to the target (i.e. will be attracted by the target). If this factor is larger than 1, the object will move farther away from the target (i.e. will be repulsed from the target). If this factor equals 0, the object will be moved onto the target coordinates. If this factor is smaller than 0, the object will be moved beyond the target coordinates.- Parameters:
targetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointattractionFactor
- Factor as explained abovetimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addAttractOrRepulseAnimator
public android.animation.Animator addAttractOrRepulseAnimator(int targetX, int targetY, double attractionFactor, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object on a direct line towards some specified target coordinates or away from these coordinates. The distance of the object at its final position from these coordinates is the original distance multiplied by an attraction factor. If this factor is small than 1, the object will move closer to the target (i.e. will be attracted by the target). If this factor is larger than 1, the object will move farther away from the target (i.e. will be repulsed from the target). If this factor equals 0, the object will be moved onto the target coordinates. If this factor is smaller than 0, the object will be moved beyond the target coordinates.- Parameters:
targetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointattractionFactor
- Factor as explained abovetimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addLinearSegmentsPathAnimator
public android.animation.Animator addLinearSegmentsPathAnimator(java.util.ArrayList<android.graphics.Point> path, int duration)
Add an animator to move the embedded Drawable or View object along some path consisting of multiple linear segments. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. The start delay is zero, i.e. the animation starts immediately.- Parameters:
path
- Path of the animation = vertical / horizontal centers of the object along its wayduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addLinearSegmentsPathAnimator
public android.animation.Animator addLinearSegmentsPathAnimator(java.util.ArrayList<android.graphics.Point> path, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the embedded Drawable or View object along some path consisting of multiple linear segments. The start delay is zero, i.e. the animation starts immediately.- Parameters:
path
- Path of the animation = vertical / horizontal centers of the object along its waytimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addLinearSegmentsPathAnimator
public android.animation.Animator addLinearSegmentsPathAnimator(java.util.ArrayList<android.graphics.Point> path, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object along some path consisting of multiple linear segments. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed.- Parameters:
path
- Path of the animation = vertical / horizontal centers of the object along its wayduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addLinearSegmentsPathAnimator
public android.animation.Animator addLinearSegmentsPathAnimator(java.util.ArrayList<android.graphics.Point> path, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the embedded Drawable or View object along some path consisting of multiple linear segments.- Parameters:
path
- Path of the animation = vertical / horizontal centers of the object along its waytimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addBezierPathAnimator
public android.animation.Animator addBezierPathAnimator(int controlX, int controlY, int targetX, int targetY, int duration)
Add an animator to move the object along a quadratic Bezier curve. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. The start delay is zero, i.e. the animation starts immediately.- Parameters:
controlX
- X coordinate of the control pointcontrolY
- Y coordinate of the control pointtargetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addBezierPathAnimator
public android.animation.Animator addBezierPathAnimator(int controlX, int controlY, int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the object along a quadratic Bezier curve. The start delay is zero, i.e. the animation starts immediately.- Parameters:
controlX
- X coordinate of the control pointcontrolY
- Y coordinate of the control pointtargetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointtimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addBezierPathAnimator
public android.animation.Animator addBezierPathAnimator(int controlX, int controlY, int targetX, int targetY, int duration, int startDelay)
Add an animator to move the object along a quadratic Bezier curve. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed.- Parameters:
controlX
- X coordinate of the control pointcontrolY
- Y coordinate of the control pointtargetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addBezierPathAnimator
public android.animation.Animator addBezierPathAnimator(int controlX, int controlY, int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along a quadratic Bezier curve.- Parameters:
controlX
- X coordinate of the control pointcontrolY
- Y coordinate of the control pointtargetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointtimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addBezierPathAnimator
public android.animation.Animator addBezierPathAnimator(int control1X, int control1Y, int control2X, int control2Y, int targetX, int targetY, int duration)
Add an animator to move the object along a cubic Bezier curve. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. The start delay is zero, i.e. the animation starts immediately.- Parameters:
control1X
- X coordinate of the first control pointcontrol1Y
- Y coordinate of the first control pointcontrol2X
- X coordinate of the second control pointcontrol2Y
- Y coordinate of the second control pointtargetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addBezierPathAnimator
public android.animation.Animator addBezierPathAnimator(int control1X, int control1Y, int control2X, int control2Y, int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the object along a cubic Bezier curve. The start delay is zero, i.e. the animation starts immediately.- Parameters:
control1X
- X coordinate of the first control pointcontrol1Y
- Y coordinate of the first control pointcontrol2X
- X coordinate of the second control pointcontrol2Y
- Y coordinate of the second control pointtargetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointtimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addBezierPathAnimator
public android.animation.Animator addBezierPathAnimator(int control1X, int control1Y, int control2X, int control2Y, int targetX, int targetY, int duration, int startDelay)
Add an animator to move the object along a cubic Bezier curve. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed.- Parameters:
control1X
- X coordinate of the first control pointcontrol1Y
- Y coordinate of the first control pointcontrol2X
- X coordinate of the second control pointcontrol2Y
- Y coordinate of the second control pointtargetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addBezierPathAnimator
public android.animation.Animator addBezierPathAnimator(int control1X, int control1Y, int control2X, int control2Y, int targetX, int targetY, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along a cubic Bezier curve.- Parameters:
control1X
- X coordinate of the first control pointcontrol1Y
- Y coordinate of the first control pointcontrol2X
- X coordinate of the second control pointcontrol2Y
- Y coordinate of the second control pointtargetX
- X coordinate of the target pointtargetY
- Y coordinate of the target pointtimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addArcPathAnimator
public android.animation.Animator addArcPathAnimator(int centerCircleX, int centerCircleY, double angle, int duration)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY(). The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. The start delay is zero, i.e. the animation starts immediately.- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centerangle
- Angle of the arc in radians (positive = clockwise movement, negative = counterclockwise movement)duration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addArcPathAnimator
public android.animation.Animator addArcPathAnimator(int centerCircleX, int centerCircleY, double angle, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY(). The start delay is zero, i.e. the animation starts immediately.- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centerangle
- Angle of the arc in radians (positive = clockwise movement, negative = counterclockwise movement)timeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addArcPathAnimator
public android.animation.Animator addArcPathAnimator(int centerCircleX, int centerCircleY, double angle, int duration, int startDelay)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY(). The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed.- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centerangle
- Angle of the arc in radians (positive = clockwise movement, negative = counterclockwise movement)duration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addArcPathAnimator
public android.animation.Animator addArcPathAnimator(int centerCircleX, int centerCircleY, double angle, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centerangle
- Angle of the arc in radians (positive = clockwise movement, negative = counterclockwise movement)timeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addArcPathAnimator
public android.animation.Animator addArcPathAnimator(int centerCircleX, int centerCircleY, int targetX, int targetY, boolean clockwise, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an arc of a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY(). (Use this method if you want to specify the arc by the target point on the circle (and not by the angle).- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centertargetX
- X coordinate of the target point on the circle (note: the target point must lie on the circle)targetY
- Y coordinate of the target point on the circle (note: the target point must lie on the circle)clockwise
- Movement clockwise or anticlockwisetimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addCirclePathAnimator
public android.animation.Animator addCirclePathAnimator(int centerCircleX, int centerCircleY, int duration)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().
Note: The object will start from its initial position and rotate infinitely. Therefore, this animation cannot be combined with other animations that modify the location of the object. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. The start delay is zero, i.e. the animation starts immediately.- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centerduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addCirclePathAnimator
public android.animation.Animator addCirclePathAnimator(int centerCircleX, int centerCircleY, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().
Note: The object will start from its initial position and rotate infinitely. Therefore, this animation cannot be combined with other animations that modify the location of the object. The start delay is zero, i.e. the animation starts immediately.- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centertimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addCirclePathAnimator
public android.animation.Animator addCirclePathAnimator(int centerCircleX, int centerCircleY, int duration, int startDelay)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY().
Note: The object will start from its initial position and rotate infinitely. Therefore, this animation cannot be combined with other animations that modify the location of the object. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed.- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centerduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addCirclePathAnimator
public android.animation.Animator addCirclePathAnimator(int centerCircleX, int centerCircleY, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY(). Note: The object will start from its initial position and rotate clockwise infinitely. Therefore, this animation cannot be combined with other animations that modify the location of the object.- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centertimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addCirclePathAnimator
public android.animation.Animator addCirclePathAnimator(int centerCircleX, int centerCircleY, boolean clockwise, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along a circle around a specified center.
The circle is assumed to go through the current center of the embedded object, as returned by getCenterX() and getCenterY(). Note: The object will start from its initial position and rotate infinitely. Therefore, this animation cannot be combined with other animations that modify the location of the object.- Parameters:
centerCircleX
- X coordinate of the circle centercenterCircleY
- Y coordinate of the circle centerclockwise
- Movement clockwise or anticlockwise?timeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addEllipseAnimator
public android.animation.Animator addEllipseAnimator(int centerEllipseX, int centerEllipseY, int radius, double comprFactor, double rotAngleEllipse, boolean clockwise, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object infinitely along an ellipse around a specified center.
The ellipse is implemented by a circle that is compressed vertically by a specified compression factor and then rotated by a specified angle around its center.
The object is assumed to lie initially on this ellipse. Use the method GraphicsUtils.pointsOnEllipse() to calculate such points.- Parameters:
centerEllipseX
- X coordinate of the center of the ellipsecenterEllipseY
- Y coordinate of the center of the ellipseradius
- ; // Radius of the circlecomprFactor
- ; // Vertical compression of the circle (0<=comprFactor<=1), yielding the ellipserotAngleEllipse
- ; // Rotation angle of the resulting ellipse (in radians)clockwise
- Movement clockwise or anticlockwise?timeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of one round of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addEllipseAnimator
public android.animation.Animator addEllipseAnimator(int centerEllipseX, int centerEllipseY, int radius, double comprFactor, double rotAngleEllipse, boolean clockwise, int repeatCount, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an ellipse around a specified center.
The ellipse is implemented by a circle that is compressed vertically by a specified compression factor and then rotated by a specified angle around its center.
The object is assumed to lie initially on this ellipse. Use the method GraphicsUtils.pointsOnEllipse() to calculate such points.- Parameters:
centerEllipseX
- X coordinate of the center of the ellipsecenterEllipseY
- Y coordinate of the center of the ellipseradius
- ; Radius of the circlecomprFactor
- ; Vertical compression of the circle (0<=comprFactor<=1), yielding the ellipserotAngleEllipse
- ; Rotation angle of the resulting ellipse (in radians)clockwise
- Movement clockwise or anticlockwise?repeatCount
- Number of rotationstimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of one round of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addSpiralPathOutwardAnimator
public android.animation.Animator addSpiralPathOutwardAnimator(double numberRotations, int targetDistance, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an archimedian spiral, starting from the current center of the object and moving outwards.- Parameters:
numberRotations
- The number of rotations around the center to be performed (fractions are allowed)targetDistance
- The target distance of the object to the centertimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addSpiralPathInwardAnimator
public android.animation.Animator addSpiralPathInwardAnimator(int centerSpiralX, int centerSpiralY, int numberRotations, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to move the object along an archimedian spiral, starting from the current position of the object inwards towards the center of the spiral.- Parameters:
centerSpiralX
- X coordinate of the spiral centercenterSpiralY
- Y coordinate of the spiral centernumberRotations
- The number of rotations around the center to be performedtimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addSizeAnimator
public android.animation.AnimatorSet addSizeAnimator(int targetWidth, int targetHeight, int duration)
Add an animator to modify the size the embedded Drawable or View object. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. The start delay is zero, i.e. the animation starts immediately. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
targetWidth
- Target widthtargetHeight
- Target heightduration
- Duration of the animation (in ms)- Returns:
- The new animator (= set with two animators for the width and the height, respectively)
-
addSizeAnimator
public android.animation.AnimatorSet addSizeAnimator(int targetWidth, int targetHeight, int duration, int startDelay)
Add an animator to modify the size the embedded Drawable or View object. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
targetWidth
- Target widthtargetHeight
- Target heightduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator (= set with two animators for the width and the height, respectively)
-
addSizeAnimator
public android.animation.AnimatorSet addSizeAnimator(int targetWidth, int targetHeight, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to modify the size the embedded Drawable or View object. The start delay is zero, i.e. the animation starts immediately. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
targetWidth
- Target widthtargetHeight
- Target heighttimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator (= set with two animators for the width and the height, respectively)
-
addSizeAnimator
public android.animation.AnimatorSet addSizeAnimator(int targetWidth, int targetHeight, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to modify the size the embedded Drawable or View object. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
targetWidth
- Target widthtargetHeight
- Target heighttimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator (= set with two animators for the width and the height, respectively)
-
addSizeAnimator
public android.animation.Animator addSizeAnimator(java.util.ArrayList<android.graphics.Point> sizes, int duration)
Add an animator to modify the size of the embedded Drawable or View object. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. The start delay is zero, i.e. the animation starts immediately. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
sizes
- Sequence of the sizes (as pairs of width and height)duration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addSizeAnimator
public android.animation.Animator addSizeAnimator(java.util.ArrayList<android.graphics.Point> sizes, int duration, int startDelay)
Add an animator to modify the size of the embedded Drawable or View object. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
sizes
- Sequence of the sizes (as pairs of width and height)duration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addSizeAnimator
public android.animation.Animator addSizeAnimator(java.util.ArrayList<android.graphics.Point> sizes, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to modify the size of the embedded Drawable or View object. The start delay is zero, i.e. the animation starts immediately. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
sizes
- Sequence of the sizes (as pairs of width and height)timeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addSizeAnimator
public android.animation.Animator addSizeAnimator(java.util.ArrayList<android.graphics.Point> sizes, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to modify the size of the embedded Drawable or View object. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
sizes
- Sequence of the sizes (as pairs of width and height)timeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addZoomAnimator
public android.animation.AnimatorSet addZoomAnimator(double zoomFactor, int duration)
Add an animator to zoom the object. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
zoomFactor
- Factor by which the size of the object shall be modifiedduration
- Duration of the animation (in ms)- Returns:
- The new animator (= set with two animators for the width and the height, respectively)
-
addZoomAnimator
public android.animation.AnimatorSet addZoomAnimator(double zoomFactor, int duration, int startDelay)
Add an animator to zoom the object. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
zoomFactor
- Factor by which the size of the object shall be modifiedduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator (= set with two animators for the width and the height, respectively)
-
addZoomAnimator
public android.animation.AnimatorSet addZoomAnimator(double zoomFactor, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to zoom the object. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
zoomFactor
- Factor by which the size of the object shall be modifiedtimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)- Returns:
- The new animator (= set with two animators for the width and the height, respectively)
-
addZoomAnimator
public android.animation.AnimatorSet addZoomAnimator(double zoomFactor, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to zoom the object. N.B.: For View objects, the size animator might not work properly due to interference with the embedding RelativeLayout- Parameters:
zoomFactor
- Factor by which the size of the object shall be modifiedtimeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator (= set with two animators for the width and the height, respectively)
-
addRotationAnimator
public android.animation.Animator addRotationAnimator(float targetAngle, int duration)
Add an animator to modify the rotation angle of the embedded Drawable or View object (for embedded Drawable objects only effective if of subclass RotatableDrawableCV). The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed. The start delay is zero, i.e. the animation starts immediately.- Parameters:
targetAngle
- Target angle of the object in radians (= the absolute angle reached in the end, i.e. not the rotation angle)duration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addRotationAnimator
public android.animation.Animator addRotationAnimator(float targetAngle, int duration, int startDelay)
Add an animator to modify the rotation angle of the embedded Drawable or View object (for embedded Drawable objects only effective if of subclass RotatableDrawableCV). The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed.- Parameters:
targetAngle
- Target angle of the object in radians (= the absolute angle reached in the end, i.e. not the rotation angle)duration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addRotationAnimator
public android.animation.Animator addRotationAnimator(float targetAngle, android.animation.TimeInterpolator timeInterpolator, int duration)
Add an animator to modify the rotation angle of the embedded Drawable or View object (for embedded Drawable objects only effective if of subclass RotatableDrawableCV). The start delay is zero, i.e. the animation starts immediately.- Parameters:
targetAngle
- Target angle of the object in radians (= the absolute angle reached in the end, i.e. not the rotation angle)duration
- Duration of the animation (in ms)timeInterpolator
- TimeInterpolator to control the timing of the animation- Returns:
- The new animator
-
addRotationAnimator
public android.animation.Animator addRotationAnimator(float targetAngle, android.animation.TimeInterpolator timeInterpolator, int duration, int startDelay)
Add an animator to modify the rotation angle of the embedded Drawable or View object (for embedded Drawable objects only effective if of subclass RotatableDrawableCV).- Parameters:
targetAngle
- Target angle of the object in radians (= the absolute angle reached in the end, i.e. not the rotation angle)timeInterpolator
- TimeInterpolator to control the timing of the animationduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addInfiniteRotationAnimator
public android.animation.Animator addInfiniteRotationAnimator(int roundDuration)
Add an animator to rotate the embedded Drawable or View object infinitely (for embedded Drawable objects only effective if of subclass RotatableDrawableCV).- Parameters:
roundDuration
- Duration of the one rotation (in ms)- Returns:
- The new animator
-
addShakeAnimator
public android.animation.Animator addShakeAnimator(float targetAngle, int durationShakeRound, int noShakes)
Add an animator to right-left shake the embedded Drawable or View object for a number of times (for embedded Drawable objects only effective if of subclass RotatableDrawableCV).- Parameters:
targetAngle
- Shaking angledurationShakeRound
- Duration of one complete right-left shake (in ms)noShakes
- Number of shakes to be performed- Returns:
- The new animator
-
addColorAnimator
public android.animation.Animator addColorAnimator(int targetColor, int duration)
Add an animator to modify the color of the embedded Drawable or View object. The start delay is zero, i.e. the animation starts immediately. For a Drawable object, the color can be animated only if it is of type ShapeDrawable, DrawableTextCV, or DrawableTextWithIconCV.- Parameters:
targetColor
- Target colorduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addColorAnimator
public android.animation.Animator addColorAnimator(int targetColor, int duration, int startDelay)
Add an animator to modify the color of the embedded Drawable or View object. For a Drawable object, the color can be animated only if it is of type ShapeDrawable, DrawableTextCV, or DrawableTextWithIconCV.- Parameters:
targetColor
- Target colorduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addColorBorderAnimator
public android.animation.Animator addColorBorderAnimator(int targetColor, int duration)
Add an animator to modify the border color of the embedded object of class DrawableTextWithIconCV (has an effect only for objects of this type) The start delay is zero, i.e. the animation starts immediately.- Parameters:
targetColor
- Target colorduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addColorBorderAnimator
public android.animation.Animator addColorBorderAnimator(int targetColor, int duration, int startDelay)
Add an animator to modify the border color of the embedded object of class DrawableTextWithIconCV (has an effect only for objects of this type) The start delay is zero, i.e. the animation starts immediately.- Parameters:
targetColor
- Target colorduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addStrokewidthBorderAnimator
public android.animation.Animator addStrokewidthBorderAnimator(int targetStrokewidth, int duration)
Add an animator to modify the border stroke width of the embedded object of class DrawableTextWithIconCV (has an effect only for objects of this type) The start delay is zero, i.e. the animation starts immediately.- Parameters:
targetStrokewidth
- Target stroke widthduration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addStrokewidthBorderAnimator
public android.animation.Animator addStrokewidthBorderAnimator(int targetStrokewidth, int duration, int startDelay)
Add an animator to modify the border stroke width of the embedded object of class DrawableTextWithIconCV (has an effect only for objects of this type) The start delay is zero, i.e. the animation starts immediately.- Parameters:
targetStrokewidth
- Target border stroke widthduration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addBlinkAnimator
public android.animation.Animator addBlinkAnimator(int durInterval)
Add an animator to let the Drawable object blink. The LinearInterpolator() is used to control the timing of the animation, i.e. the animation runs at constant speed.- Parameters:
durInterval
- Duration of a blink interval (in ms)- Returns:
- The new animator
-
addBlinkAnimator
public android.animation.Animator addBlinkAnimator(android.animation.TimeInterpolator timeInterpolator, int durInterval)
Add an animator to let the Drawable object blink.- Parameters:
timeInterpolator
- TimeInterpolator to control the timing of the animationdurInterval
- Duration of a blink interval (in ms)- Returns:
- The new animator
-
addAppearanceAnimator
public android.animation.Animator addAppearanceAnimator(int delay)
Add an animator to let the object appear on the display after a specified delay.- Parameters:
delay
- Duration of time after which the object will appear (in ms)- Returns:
- The new animator
-
addFadeInAnimator
public android.animation.Animator addFadeInAnimator(int duration)
Add an animator to let the object fade in. The start delay is zero, i.e. the animation starts immediately.- Parameters:
duration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addFadeInAnimator
public android.animation.Animator addFadeInAnimator(int duration, int startDelay)
Add an animator to let an object fade in.- Parameters:
duration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addFadeOutAnimator
public android.animation.Animator addFadeOutAnimator(int duration)
Add an animator to let the object fade out. The start delay is zero, i.e. the animation starts immediately.- Parameters:
duration
- Duration of the animation (in ms)- Returns:
- The new animator
-
addFadeOutAnimator
public android.animation.Animator addFadeOutAnimator(int duration, int startDelay)
Add an animator to let an object fade out.- Parameters:
duration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)- Returns:
- The new animator
-
addZAnimator
public android.animation.Animator addZAnimator(int zValue1, int zValue2, int durPhase1, int durPhase2, int startDelay)
Add an animator to modify the z value of an object in two phases.- Parameters:
zValue1
- The z value the object shall have in the first phasezValue2
- The z value the object shall have in the second phasedurPhase1
- The duration of the first phase (in ms)durPhase2
- The duration of the second phase (in ms)startDelay
- Initial delay before the animation starts (in ms)- Returns:
- The new animator
-
addPropertyChangedListener
public void addPropertyChangedListener(AnimatedGuiObjectCV.OnPropertyChangedListener listener)
Register a listener to react upon property changes.- Parameters:
listener
- The listener to be registered
-
removePropertyChangedListener
public void removePropertyChangedListener(AnimatedGuiObjectCV.OnPropertyChangedListener listener)
Deregister a listener to react upon property changes.- Parameters:
listener
- The listener to be deregistered
-
removeAllPropertyChangedListeners
public void removeAllPropertyChangedListeners()
Deregister all listeners to react upon property changes.
-
getProperties
public AnimatedGuiObjectCV.ObjectProperties getProperties()
Method to get the properties of the object as defined by class ObjectProperties.
-
setProperties
public void setProperties(AnimatedGuiObjectCV.ObjectProperties values)
Method to assign values to members of the object. To make the changes visible on the display, call the invalidate() method of the displaying view.- Parameters:
values
- Object of class ObjectProperties that stores the values to be assigned. The name and the type of the object will remain unchanged.
-
setPropertiesAnimated
public void setPropertiesAnimated(AnimatedGuiObjectCV.ObjectProperties values, int duration, int startDelay)
Method to assign values to members of the object. The changes will be animated immediately on the display.- Parameters:
values
- Object of class ObjectProperties that stores the values to be assigned. The name and the type of the object will remain unchanged.duration
- Duration of the animation (in ms)startDelay
- Start delay of the animation (in ms)
-
-