use of com.nineoldandroids.animation.Animator in project MultiPhotoPicker by wangeason.
the class ImagePagerFragment method runExitAnimation.
/**
* The exit animation is basically a reverse of the enter animation, except that if
* the orientation has changed we simply scale the picture back into the center of
* the screen.
*
* @param endAction This action gets run after the animation completes (this is
* when we actually switch activities)
*/
public void runExitAnimation(final Runnable endAction) {
if (!getArguments().getBoolean(ARG_HAS_ANIM, false) || !hasAnim) {
endAction.run();
return;
}
final long duration = ANIM_DURATION;
// Animate image back to thumbnail size/location
ViewPropertyAnimator.animate(mViewPager).setDuration(duration).setInterpolator(new AccelerateInterpolator()).scaleX((float) thumbnailWidth / mViewPager.getWidth()).scaleY((float) thumbnailHeight / mViewPager.getHeight()).translationX(thumbnailLeft).translationY(thumbnailTop).setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
endAction.run();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
// Fade out background
ObjectAnimator bgAnim = ObjectAnimator.ofInt(mViewPager.getBackground(), "alpha", 0);
bgAnim.setDuration(duration);
bgAnim.start();
// Animate a color filter to take the image back to grayscale,
// in parallel with the image scaling and moving into place.
ObjectAnimator colorizer = ObjectAnimator.ofFloat(ImagePagerFragment.this, "saturation", 1, 0);
colorizer.setDuration(duration);
colorizer.start();
}
use of com.nineoldandroids.animation.Animator in project AisenWeiBo by wangdan.
the class SupportAnimatorPreL method addListener.
@Override
public void addListener(final AnimatorListener listener) {
Animator a = mAnimator.get();
if (a == null) {
return;
}
if (listener == null) {
a.addListener(null);
return;
}
a.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
listener.onAnimationStart();
}
@Override
public void onAnimationEnd(Animator animation) {
listener.onAnimationEnd();
}
@Override
public void onAnimationCancel(Animator animation) {
listener.onAnimationCancel();
}
@Override
public void onAnimationRepeat(Animator animation) {
listener.onAnimationRepeat();
}
});
}
use of com.nineoldandroids.animation.Animator in project AisenWeiBo by wangdan.
the class ArcAnimator method setupStartValues.
@Override
public void setupStartValues() {
super.setupStartValues();
Animator a = mAnimator.get();
if (a != null)
a.setupStartValues();
}
use of com.nineoldandroids.animation.Animator in project AisenWeiBo by wangdan.
the class ArcAnimator method start.
@Override
public void start() {
super.start();
Animator a = mAnimator.get();
if (a != null)
a.start();
}
use of com.nineoldandroids.animation.Animator in project AisenWeiBo by wangdan.
the class ArcAnimator method end.
@Override
public void end() {
super.end();
Animator a = mAnimator.get();
if (a != null)
a.end();
}
Aggregations