Adjacent Files

Project Info

. > app > src > main > java > james > alarmio > utils > anim > AnimatedValue.java

[AnimatedValue](https://github.com/fennifith/Alarmio/blob/master/app/src/main/java/james/alarmio/utils/anim/AnimatedValue.java#L6)

Type: public abstract class

AnimatedValue is a class which stores a value to be animated over a given duration of time. It provides methods to set a target value, default value, and current value.

As this method is meant to be used alongside a view’s Canvas, the animation should not occur in “steps”, but rather as a function of System.currentTimeMillis.

Parameter Name Description
The type of value to be animated.

set

Type: public void

Set the current value to be drawn.

Parameter Name Description
value The current value.

setDefault

Type: public void

Set the default value to return to.

Parameter Name Description
defaultValue The default value.

setCurrent

Type: public void

Set the current (and target) value.

Parameter Name Description
value The current value.

val

Type: public T

Get the current value to be drawn.

Returned Value: The current value.

nextVal

Type: public T

Get the next value about to be drawn, without setting the current value to it.

Returned Value: The next value.

nextVal

Type: public T

Get the next value about to be drawn, without setting the current value to it.

Parameter Name Description
duration The duration, in milliseconds, that the animation should take.

Returned Value: The next value.

nextVal

Type: abstract T

Get the next value about to be drawn, without setting the current value to it.

Parameter Name Description
start The time at which the animation started, in milliseconds.
duration The duration, in milliseconds, that the animation should take.

Returned Value: The next value.

getTarget

Type: public T

Get the target value that is currently being animated to.

Returned Value: The target value.

getDefault

Type: public T

Get the default value that the animation should return to.

Returned Value: The default value.

isTarget

Type: public boolean

Determine if the target value has been drawn (implying that the animation is complete).

Returned Value: True if the target value has supposedly been drawn.

isDefault

Type: public boolean

Determine if the default value has been drawn.

Returned Value: True if the default value has supposedly been drawn.

isTargetDefault

Type: public boolean

Determine if the default value has been set AND is the current target.

Returned Value: True if the default value is the current target.

toDefault

Type: public void

Animate to the default value.

to

Type: public void

Set the value to be animated towards.

Parameter Name Description
value The target value.

next

Type: public void

Update the current value.

Parameter Name Description
animate Whether to animate the change.

next

Type: public void

Update the current value.

Parameter Name Description
animate Whether to animate the change.
duration The duration, in milliseconds, to animate across.
This site may do shady things with cookies and stuff because it's evil. Please don't read my privacy policy. close