本文整理汇总了Java中com.nineoldandroids.animation.AnimatorListenerAdapter类的典型用法代码示例。如果您正苦于以下问题:Java AnimatorListenerAdapter类的具体用法?Java AnimatorListenerAdapter怎么用?Java AnimatorListenerAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnimatorListenerAdapter类属于com.nineoldandroids.animation包,在下文中一共展示了AnimatorListenerAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acceptConfirmationIn
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void acceptConfirmationIn( View v ) {
if( !this.opem ) return;
this.callback( this.confirmationInCallback );
YoYo.with( Techniques.ZoomOut )
.duration( 400 )
.playOn( this.ivExamConfirmationInReject );
YoYo.with( Techniques.ZoomIn )
.duration( 400 )
.withListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
ivExamConfirmationInAccept.setImageResource( R.drawable.ic_sentiment_satisfied_green_500_18dp );
}
})
.playOn( this.ivExamConfirmationInAccept )
;
//Remover o evento
this.ivExamConfirmationInReject.setOnClickListener( null );
this.ivExamConfirmationInAccept.setOnClickListener( null );
}
示例2: acceptConfirmationOut
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void acceptConfirmationOut( View v ) {
if( !this.opem ) return;
this.callback( this.confirmationOutCallback );
YoYo.with( Techniques.ZoomOut )
.duration( 400 )
.playOn( this.ivExamConfirmationOutReject );
YoYo.with( Techniques.ZoomIn )
.duration( 400 )
.withListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
ivExamConfirmationOutAccept.setImageResource( R.drawable.ic_sentiment_very_dissatisfied_red_500_18dp );
}
})
.playOn( this.ivExamConfirmationOutAccept )
;
//Remover o evento
this.ivExamConfirmationOutReject.setOnClickListener( null );
this.ivExamConfirmationOutAccept.setOnClickListener( null );
}
示例3: hideBubble
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void hideBubble() {
if (mBubbleAnimator == null) {
mBubbleAnimator = ValueAnimator.ofFloat(1.0F, 0.0F);
mBubbleAnimator.addUpdateListener(mBubbleAnimatorListener);
mBubbleAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mBubbleVisible = false;
invalidate();
}
});
} else {
mBubbleAnimator.cancel();
}
mBubbleAnimator.start();
}
示例4: hideScroller
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void hideScroller() {
if (mScrollerAnimator == null) {
mScrollerAnimator = ValueAnimator.ofFloat(1.0F, 0.0F);
mScrollerAnimator.addUpdateListener(mHandleAnimatorListener);
mScrollerAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mScrollerVisible = false;
invalidate();
}
});
} else {
mScrollerAnimator.cancel();
}
mScrollerAnimator.start();
}
示例5: onFingerUp
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
void onFingerUp() {
if (mCurrentAnimator != null) {
mCurrentAnimator.end();
mCurrentAnimator = null;
createTouchRipple(END_RIPPLE_TOUCH_RADIUS);
}
mCurrentAnimator = ObjectAnimator.ofFloat(this, DESTROY_TOUCH_RIPPLE, 0f, 1f);
mCurrentAnimator.setDuration(DEFAULT_ANIM_DURATION);
mCurrentAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mCurrentAnimator = null;
}
});
mCurrentAnimator.start();
}
示例6: performDismiss
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
protected void performDismiss(final PendingDismissData data) {
// Animate the dismissed list item to zero-height and fire the
// dismiss callback when all dismissed list item animations have
// completed.
final ViewGroup.LayoutParams lp = data.view.getLayoutParams();
final int originalHeight = data.view.getHeight();
ValueAnimator animator = ValueAnimator.ofInt(originalHeight, 1).setDuration(mAnimationTime);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(final ValueAnimator valueAnimator) {
lp.height = (Integer) valueAnimator.getAnimatedValue();
data.view.setLayoutParams(lp);
}
});
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(final Animator animation) {
finalizeDismiss();
}
});
animator.start();
}
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:27,代码来源:SwipeDismissListViewTouchListener.java
示例7: hideUndoBar
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
public void hideUndoBar(boolean immediate) {
// mHideHandler.removeCallbacks(mHideRunnable);
if (immediate) {
mBarView.setVisibility(View.GONE);
AlphaManager.setAlpha(mBarView, 0);
mUndoMessage = null;
mUndoToken = null;
} else {
mBarAnimator.cancel();
mBarAnimator
.alpha(0)
.setDuration(mBarView.getResources()
.getInteger(android.R.integer.config_shortAnimTime))
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
mBarView.setVisibility(View.GONE);
mUndoMessage = null;
mUndoToken = null;
}
});
}
isVisible = false;
}
示例8: animateFlip
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
private void animateFlip(final View aboveView, final View behindView){
aboveView.setVisibility(View.VISIBLE);
behindView.setVisibility(View.GONE);
ObjectAnimator flipAboveAnimator = ObjectAnimator.ofFloat(aboveView,"rotationY",0f,90f);
final ObjectAnimator flipBehindAnimator = ObjectAnimator.ofFloat(behindView,"rotationY",-90f,0f);
flipBehindAnimator.setInterpolator(new DecelerateInterpolator());
flipBehindAnimator.setDuration(500);
flipAboveAnimator.setInterpolator(new AccelerateInterpolator());
flipAboveAnimator.setDuration(500);
flipAboveAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
aboveView.setVisibility(View.GONE);
behindView.setVisibility(View.VISIBLE);
flipBehindAnimator.start();
isOpened = !isOpened;
}
});
flipAboveAnimator.start();
}
示例9: show
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
public void show( int x, int y, int duration ) {
if( x < 0 || x > getWidth() || y < 0 || y > getHeight() ) {
throw new RuntimeException( "Center point out of range or call method when View is not initialed yet." );
}
mClipCenterX = x;
mClipCenterY = y;
float maxRadius = getMaxRadius( x, y );
if( mAnimator != null && mAnimator.isRunning() ) {
mAnimator.cancel();
}
mAnimator = ObjectAnimator.ofFloat( this, "clipRadius", 0f, maxRadius );
mAnimator.setInterpolator( new BakedBezierInterpolator() );
mAnimator.setDuration( duration );
mAnimator.addListener( new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd( Animator animation ) {
super.onAnimationEnd( animation );
mIsContentShown = true;
}
} );
mAnimator.start();
}
示例10: dragCard
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
/**
* @param direction 方向
*/
public void dragCard(int direction) {
if (mIndex > baseGragAdapter.getCount()) {
return;
}
if (!animt_finish)
return;
animt_finish = false;
AnimatorSet animatorSet = baseLayoutManager.animForward(direction, mScale, card_margin, mAlpha, getTopView(), viewCollection);
animatorSet.start();
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
animt_finish = true;
mIndex++;
moveToBack();
}
});
if (cardListener != null)
cardListener.startSwip(mIndex);
}
示例11: onFingerUp
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
void onFingerUp(){
if(mCurrentAnimator != null) {
mCurrentAnimator.end();
mCurrentAnimator = null;
createTouchRipple(END_RIPPLE_TOUCH_RADIUS);
}
mCurrentAnimator = ObjectAnimator.ofFloat(this, DESTROY_TOUCH_RIPPLE, 0f, 1f);
mCurrentAnimator.setDuration(DEFAULT_ANIM_DURATION);
mCurrentAnimator.addListener(new AnimatorListenerAdapter(){
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mCurrentAnimator = null;
}
});
mCurrentAnimator.start();
}
示例12: slideOut
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
/**
* Slide the overlay down off the screen and destroy it.
*/
private void slideOut() {
if (isAnimating) {
return;
}
isAnimating = true;
ObjectAnimator animator = ObjectAnimator.ofFloat(containerView, "translationY", containerView.getHeight());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
finish();
}
});
animator.start();
}
示例13: show
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
public void show(int x, int y, int duration) {
if (x < 0 || x > getWidth() || y < 0 || y > getHeight()) {
throw new RuntimeException("Center point out of range or call method when View is not initialed yet.");
}
mClipCenterX = x;
mClipCenterY = y;
float maxRadius = getMaxRadius(x, y);
if (mAnimator != null && mAnimator.isRunning()) {
mAnimator.cancel();
}
mAnimator = ObjectAnimator.ofFloat(this, "clipRadius", 0f, maxRadius);
mAnimator.setInterpolator(new BakedBezierInterpolator());
mAnimator.setDuration(duration);
mAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
mIsContentShown = true;
}
});
mAnimator.start();
}
示例14: animateEnabled
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
public void animateEnabled(boolean enabled) {
if(animator != null) {
animator.cancel();
animator = null;
}
if (enabled) {
animator = ObjectAnimator.ofFloat(view, "alpha", 1f);
} else
animator = ObjectAnimator.ofFloat(view, "alpha", 0.5f);
animator.setDuration(300);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
animator = null;
}
});
animator.start();
}
示例15: pressView
import com.nineoldandroids.animation.AnimatorListenerAdapter; //导入依赖的package包/类
/**
* 落地挤压
*/
public void pressView() {
ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(this, "scaleY", 1f, 0.7f);
ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(this, "scaleX", 0.7f, 1f);
scaleYAnimator.setDuration(ANIMATION_DURATION / 2);
scaleXAnimator.setDuration(ANIMATION_DURATION / 2);
scaleXAnimator.setInterpolator(new DecelerateInterpolator(mFactor));
scaleYAnimator.setInterpolator(new DecelerateInterpolator(mFactor));
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.setDuration(ANIMATION_DURATION / 2);
animatorSet.playTogether(scaleXAnimator, scaleYAnimator);
animatorSet.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
springView();
}
});
animatorSet.start();
}