public class AnimatorWrapper
extends android.animation.Animator
Animator implementation that may be used to wrap an instance of animator in order to
'suppress' some of its features like pausing and resuming for instance.| Modifier and Type | Class and Description |
|---|---|
static interface |
AnimatorWrapper.WrapperFeatures
Defines an annotation for determining set of allowed features for AnimatorWrapper.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
ALL
Flag grouping all wrapper features in one.
|
static int |
CANCEL
Flag for indicating to the animator wrapper that it should support CANCEL feature for
its wrapped animator.
|
static int |
END
Flag for indicating to the animator wrapper that it should support END feature for
its wrapped animator.
|
protected android.animation.Animator |
mAnimator
Wrapped animator instance.
|
static int |
PAUSE
Flag for indicating to the animator wrapper that it should support PAUSE feature for
its wrapped animator.
|
static int |
RESUME
Flag for indicating to the animator wrapper that it should support RESUME feature for
its wrapped animator.
|
static int |
START
Flag for indicating to the animator wrapper that it should support START feature for
its wrapped animator.
|
| Constructor and Description |
|---|
AnimatorWrapper(android.animation.Animator animator)
Creates a new instance of AnimatorWrapper to wrap the given instance of animator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(android.animation.Animator.AnimatorListener listener) |
void |
addPauseListener(android.animation.Animator.AnimatorPauseListener listener)
|
void |
cancel()
|
void |
end()
|
long |
getDuration() |
android.animation.TimeInterpolator |
getInterpolator() |
ArrayList<android.animation.Animator.AnimatorListener> |
getListeners() |
long |
getStartDelay() |
boolean |
hasFeature(int feature)
Checks whether the specified feature has been requested for this wrapper or not.
|
boolean |
isPaused() |
boolean |
isRunning() |
boolean |
isStarted() |
void |
pause()
Ignored if there is no
PAUSE feature requested. |
void |
removeAllListeners() |
void |
removeFeature(int feature)
Removes the specified feature from the registered ones.
|
void |
removeListener(android.animation.Animator.AnimatorListener listener) |
void |
removePauseListener(android.animation.Animator.AnimatorPauseListener listener) |
void |
requestFeature(int feature)
Adds the specified feature to the registered ones.
|
void |
requestFeatures(int features)
Specifies set of features for this wrapper.
|
void |
resume()
|
android.animation.Animator |
setDuration(long duration) |
void |
setInterpolator(android.animation.TimeInterpolator interpolator) |
void |
setStartDelay(long startDelay) |
void |
setTarget(Object target) |
void |
start()
Ignored if there is no
START feature requested. |
public static final int START
start(),
Constant Field Valuespublic static final int PAUSE
RESUME,
pause(),
Constant Field Valuespublic static final int RESUME
Note, that if there is no PAUSE feature requested, this feature flag is ignored.
resume(),
Constant Field Valuespublic static final int END
Note, that if there is no START feature requested, this feature flag is ignored.
end(),
Constant Field Valuespublic static final int CANCEL
Note, that if there is no START feature requested, this feature flag is ignored.
cancel(),
Constant Field Valuespublic static final int ALL
protected final android.animation.Animator mAnimator
public AnimatorWrapper(android.animation.Animator animator)
animator - The animator to be wrapped.public void requestFeatures(int features)
Note, that this will override all current features to the specified ones.
features - The desired features to be set for this wrapper.requestFeature(int),
hasFeature(int),
removeFeature(int)public void requestFeature(int feature)
feature - The desired feature to add.requestFeatures(int),
hasFeature(int),
removeFeature(int)public void removeFeature(int feature)
feature - The desired feature to remove.requestFeature(int),
hasFeature(int)public boolean hasFeature(int feature)
feature - The desired feature to check for.True if the feature has been requested via requestFeature(int) or
specified by default, false otherwise.requestFeature(int)public void addListener(android.animation.Animator.AnimatorListener listener)
addListener in class android.animation.Animatorpublic void removeListener(android.animation.Animator.AnimatorListener listener)
removeListener in class android.animation.Animatorpublic void addPauseListener(android.animation.Animator.AnimatorPauseListener listener)
addPauseListener in class android.animation.AnimatorrequestFeature(int),
removeFeature(int)public void removePauseListener(android.animation.Animator.AnimatorPauseListener listener)
removePauseListener in class android.animation.Animatorpublic ArrayList<android.animation.Animator.AnimatorListener> getListeners()
getListeners in class android.animation.Animatorpublic void removeAllListeners()
removeAllListeners in class android.animation.Animatorpublic void setStartDelay(long startDelay)
setStartDelay in class android.animation.Animatorpublic long getStartDelay()
getStartDelay in class android.animation.Animatorpublic android.animation.Animator setDuration(long duration)
setDuration in class android.animation.Animatorpublic long getDuration()
getDuration in class android.animation.Animatorpublic void setInterpolator(android.animation.TimeInterpolator interpolator)
setInterpolator in class android.animation.Animatorpublic android.animation.TimeInterpolator getInterpolator()
getInterpolator in class android.animation.Animatorpublic void setTarget(Object target)
setTarget in class android.animation.Animatorpublic void start()
START feature requested.start in class android.animation.AnimatorrequestFeature(int),
removeFeature(int)public boolean isStarted()
isStarted in class android.animation.Animatorpublic void pause()
PAUSE feature requested.pause in class android.animation.AnimatorrequestFeature(int),
removeFeature(int)public boolean isPaused()
isPaused in class android.animation.Animatorpublic void resume()
resume in class android.animation.AnimatorrequestFeature(int),
removeFeature(int)public void end()
end in class android.animation.AnimatorrequestFeature(int),
removeFeature(int)public void cancel()
cancel in class android.animation.AnimatorrequestFeature(int),
removeFeature(int)public boolean isRunning()
isRunning in class android.animation.Animator