本文整理匯總了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);
}