本文整理汇总了Java中com.nineoldandroids.animation.AnimatorSet.play方法的典型用法代码示例。如果您正苦于以下问题:Java AnimatorSet.play方法的具体用法?Java AnimatorSet.play怎么用?Java AnimatorSet.play使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nineoldandroids.animation.AnimatorSet
的用法示例。
在下文中一共展示了AnimatorSet.play方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupAnimation
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
public void setupAnimation(@NonNull MenuItem mMenuItem, @NonNull TransitionControllerManager manager,
@IntRange(from = 0) int itemIndex, @IntRange(from = 0) int menuCount) {
if(mDelayed!=null) {
final int size = mDelayed.size();
for (int i = 0; i < size; i++) {
mDelayed.get(i).evaluate(manager.getTarget(), this);
}
}
ObjectAnimator anim = new ObjectAnimator();
anim.setValues(getValuesHolders());
AnimatorSet set = new AnimatorSet();
set.play(anim);
set.setStartDelay((long) (itemIndex * mCascade * SCALE_FACTOR));
set.setDuration((long) (SCALE_FACTOR - itemIndex * mCascade * SCALE_FACTOR));
manager.addAnimatorSetAsTransition(set).setRange(mStart, mEnd);
}
示例2: start
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void start() {
if (canAnimate()) {
clearAnimation();
}
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 1.0f));
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 1.0f));
animatorSet.setInterpolator(new OvershootInterpolator());
animatorSet.setDuration(getDuration());
animatorSet.start();
}
示例3: end
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void end() {
if (canAnimate()) {
clearAnimation();
}
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 0.85f));
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 0.85f));
animatorSet.setInterpolator(new OvershootInterpolator());
animatorSet.setDuration(getDuration());
animatorSet.start();
}
示例4: start
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void start() {
if(canAnimate()){
clearAnimation();
}
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 1.0f));
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 1.0f));
animatorSet.setInterpolator(new OvershootInterpolator());
animatorSet.setDuration(getDuration());
animatorSet.start();
}
示例5: end
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void end() {
if(canAnimate()){
clearAnimation();
}
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleX", 0.85f));
animatorSet.play(ObjectAnimator.ofFloat(this, "scaleY", 0.85f));
animatorSet.setInterpolator(new OvershootInterpolator());
animatorSet.setDuration(getDuration());
animatorSet.start();
}
示例6: startRipple
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void startRipple(final Runnable animationEndRunnable) {
if (eventCancelled) return;
float endRadius = getEndRadius();
cancelAnimations();
rippleAnimator = new AnimatorSet();
rippleAnimator.addListener(new AnimatorListenerAdapter() {
@Override public void onAnimationEnd(Animator animation) {
if (!ripplePersistent) {
setRadius(0);
setRippleAlpha(rippleAlpha);
}
if (animationEndRunnable != null && rippleDelayClick) {
animationEndRunnable.run();
}
childView.setPressed(false);
}
});
ObjectAnimator ripple = ObjectAnimator.ofFloat(this, radiusProperty, radius, endRadius);
ripple.setDuration(rippleDuration);
ripple.setInterpolator(new DecelerateInterpolator());
ObjectAnimator fade = ObjectAnimator.ofInt(this, circleAlphaProperty, rippleAlpha, 0);
fade.setDuration(rippleFadeDuration);
fade.setInterpolator(new AccelerateInterpolator());
fade.setStartDelay(rippleDuration - rippleFadeDuration - FADE_EXTRA_DELAY);
if (ripplePersistent) {
rippleAnimator.play(ripple);
} else if (getRadius() > endRadius) {
fade.setStartDelay(0);
rippleAnimator.play(fade);
} else {
rippleAnimator.playTogether(ripple, fade);
}
rippleAnimator.start();
}
示例7: startRipple
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void startRipple(final Runnable animationEndRunnable) {
if (eventCancelled) return;
float endRadius = getEndRadius();
cancelAnimations();
rippleAnimator = new AnimatorSet();
rippleAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (!ripplePersistent) {
setRadius(0);
setRippleAlpha(rippleAlpha);
}
if (animationEndRunnable != null && rippleDelayClick) {
animationEndRunnable.run();
}
childView.setPressed(false);
}
});
ObjectAnimator ripple = ObjectAnimator.ofFloat(this, radiusProperty, radius, endRadius);
ripple.setDuration(rippleDuration);
ripple.setInterpolator(new DecelerateInterpolator());
ObjectAnimator fade = ObjectAnimator.ofInt(this, circleAlphaProperty, rippleAlpha, 0);
fade.setDuration(rippleFadeDuration);
fade.setInterpolator(new AccelerateInterpolator());
fade.setStartDelay(rippleDuration - rippleFadeDuration - FADE_EXTRA_DELAY);
if (ripplePersistent) {
rippleAnimator.play(ripple);
} else if (getRadius() > endRadius) {
fade.setStartDelay(0);
rippleAnimator.play(fade);
} else {
rippleAnimator.playTogether(ripple, fade);
}
rippleAnimator.start();
}
示例8: setupAnimation
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
@Override
public void setupAnimation(@NonNull TransitionControllerManager manager) {
if (mView == null) {
mView = manager.getTarget();
}
if (mDelayed != null) {
for (int i = 0, size = mDelayed.size(); i < size; i++) {
mDelayed.get(i).evaluate(manager.getTarget(), this);
}
}
for (int i = 0, size = mSetupList.size(); i < size; i++) {
mSetupList.get(i).setupAnimation(manager);
}
if (mCustomTransitionController != null) {
mCustomTransitionController.setTarget(manager.getTarget());
mCustomTransitionController.setRange(mStart, mEnd);
manager.addTransitionController(mCustomTransitionController.clone());
}
ObjectAnimator anim = new ObjectAnimator();
anim.setTarget(mView);
anim.setValues(getValuesHolders());
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.play(anim);
animatorSet.setDuration(SCALE_FACTOR);
manager.addAnimatorSetAsTransition(mView, animatorSet).setRange(mStart, mEnd);
}
示例9: startRipple
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
private void startRipple( final Runnable animationEndRunnable ) {
if( eventCancelled ) {
return;
}
float endRadius = getEndRadius();
cancelAnimations();
rippleAnimator = new AnimatorSet();
rippleAnimator.addListener( new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd( Animator animation ) {
if( !ripplePersistent ) {
setRadius( 0 );
setRippleAlpha( rippleAlpha );
}
if( animationEndRunnable != null && rippleDelayClick ) {
animationEndRunnable.run();
}
childView.setPressed( false );
}
} );
ObjectAnimator ripple = ObjectAnimator.ofFloat( this, radiusProperty, radius, endRadius );
ripple.setDuration( rippleDuration );
ripple.setInterpolator( new DecelerateInterpolator() );
ObjectAnimator fade = ObjectAnimator.ofInt( this, circleAlphaProperty, rippleAlpha, 0 );
fade.setDuration( rippleFadeDuration );
fade.setInterpolator( new AccelerateInterpolator() );
fade.setStartDelay( rippleDuration - rippleFadeDuration - FADE_EXTRA_DELAY );
if( ripplePersistent ) {
rippleAnimator.play( ripple );
} else if( getRadius() > endRadius ) {
fade.setStartDelay( 0 );
rippleAnimator.play( fade );
} else {
rippleAnimator.playTogether( ripple, fade );
}
rippleAnimator.start();
}
示例10: addAnimatorAsTransition
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Adds an Animator as {@link TransitionController}
*
* @param mAnim
* @return
*/
public TransitionController addAnimatorAsTransition(@NonNull Animator mAnim) {
AnimatorSet as = new AnimatorSet();
as.play(mAnim);
return addAnimatorSetAsTransition(null, as);
}
示例11: wrapAnimator
import com.nineoldandroids.animation.AnimatorSet; //导入方法依赖的package包/类
/**
* Wraps an Animator as a DefaultTransitionController
*
* @param anim
* @return
*/
public static DefaultTransitionController wrapAnimator(@NonNull Animator anim) {
AnimatorSet set = new AnimatorSet();
set.play(anim);
return new DefaultTransitionController(set);
}