public class ResizeAnimation
extends android.view.animation.Animation
Modifier and Type | Class and Description |
---|---|
static class |
ResizeAnimation.Axis
Enum the possible transformation's axis.
|
static class |
ResizeAnimation.State
Enum the possible animations' states.
|
Modifier and Type | Field and Description |
---|---|
private boolean |
animating_
Whether the view is being transformed by the animation or not.
|
private ResizeAnimation.Axis |
axis_
Axis along which view resizing occurs.
|
private float |
collapsed_
Resize animation boundary by state.
|
private float |
expanded_ |
private float |
from_
Start / end values of the animation, regardless of the state.
|
private ResizeAnimation.State |
state_
Current state of the animation: either
ResizeAnimation.State.EXPANDED or ResizeAnimation.State.COLLAPSED . |
private float |
to_ |
private android.view.View |
view_
Reference to the view that receives transformations.
|
Constructor and Description |
---|
ResizeAnimation(android.view.View view,
float collapsed,
ResizeAnimation.Axis axis)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyTransformation(float interpolated_time,
android.view.animation.Transformation transformation)
Method called during animation progress.
|
void |
collapse()
Animates to
ResizeAnimation.State.COLLAPSED . |
void |
expand()
Animates to
ResizeAnimation.State.EXPANDED . |
private void |
resize_view(float transform)
Resize the view on the right axis with the given unity transform.
|
void |
set_expanded(int expanded) |
void |
set_state(ResizeAnimation.State state)
Sets
view_ dimensions to the corresponding input state value without animating. |
ResizeAnimation.State |
state() |
boolean |
willChangeBounds()
We need to inform that this animation transform the view boundary.
|
cancel, clone, computeDurationHint, ensureInterpolator, finalize, getBackgroundColor, getDetachWallpaper, getDuration, getFillAfter, getFillBefore, getInterpolator, getRepeatCount, getRepeatMode, getScaleFactor, getStartOffset, getStartTime, getTransformation, getTransformation, getZAdjustment, hasEnded, hasStarted, initialize, isFillEnabled, isInitialized, reset, resolveSize, restrictDuration, scaleCurrentDuration, setAnimationListener, setBackgroundColor, setDetachWallpaper, setDuration, setFillAfter, setFillBefore, setFillEnabled, setInterpolator, setInterpolator, setRepeatCount, setRepeatMode, setStartOffset, setStartTime, setZAdjustment, start, startNow, willChangeTransformationMatrix
private final android.view.View view_
private final ResizeAnimation.Axis axis_
private final float collapsed_
private ResizeAnimation.State state_
ResizeAnimation.State.EXPANDED
or ResizeAnimation.State.COLLAPSED
.private float expanded_
private float from_
private float to_
private boolean animating_
public ResizeAnimation(android.view.View view, float collapsed, @Nullable ResizeAnimation.Axis axis)
view
- The view on which animation occurscollapsed
- The upper limit of the resize animationaxis
- The axis on which animation appliespublic boolean willChangeBounds()
willChangeBounds
in class android.view.animation.Animation
protected void applyTransformation(float interpolated_time, android.view.animation.Transformation transformation)
applyTransformation
in class android.view.animation.Animation
interpolated_time
- The current 0/1 progress valuetransformation
- A Transformation
instanceprivate void resize_view(float transform)
transform
- A value between o and 1 indicating the animation progress.public void expand()
ResizeAnimation.State.EXPANDED
.public void collapse()
ResizeAnimation.State.COLLAPSED
.public ResizeAnimation.State state()
public void set_state(ResizeAnimation.State state)
view_
dimensions to the corresponding input state value without animating.state
- The state on which the animation should be driven.public void set_expanded(int expanded)