public class SlideAnimation
extends android.view.animation.Animation
Modifier and Type | Class and Description |
---|---|
static class |
SlideAnimation.Side
Enum the four possible sides of transformation.
|
static class |
SlideAnimation.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 float |
from_
Start / end values of the animation, regardless of the state.
|
private float |
hidden_
Resize animation boundary by state.
|
private SlideAnimation.Side |
side_
Side along which the sliding occurs.
|
private SlideAnimation.State |
state_
Current state of the animation: either
SlideAnimation.State.VISIBLE or SlideAnimation.State.HIDDEN . |
private float |
to_ |
private android.view.View |
view_
Reference to the view that receives transformations.
|
private float |
visible_ |
Constructor and Description |
---|
SlideAnimation(android.view.View view,
float inset,
SlideAnimation.Side side)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyTransformation(float interpolated_time,
android.view.animation.Transformation transformation)
Method called during animation progress.
|
float |
hidden() |
boolean |
hide()
Animates the view to
SlideAnimation.State.HIDDEN . |
boolean |
show()
Animates the view to
SlideAnimation.State.VISIBLE . |
SlideAnimation.State |
state() |
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, willChangeBounds, willChangeTransformationMatrix
private final android.view.View view_
private final SlideAnimation.Side side_
private final float hidden_
private final float visible_
private SlideAnimation.State state_
SlideAnimation.State.VISIBLE
or SlideAnimation.State.HIDDEN
.private float from_
private float to_
private boolean animating_
public SlideAnimation(android.view.View view, float inset, @Nullable SlideAnimation.Side side)
SlideAnimation.Side
.view
- The view on which animation occursinset
- The amount of pixels slide in.side
- The side from which the view_
comes inprotected 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
instancepublic boolean show()
SlideAnimation.State.VISIBLE
.public boolean hide()
SlideAnimation.State.HIDDEN
.public SlideAnimation.State state()
public float hidden()