本文整理汇总了Java中android.support.v4.animation.AnimatorCompatHelper类的典型用法代码示例。如果您正苦于以下问题:Java AnimatorCompatHelper类的具体用法?Java AnimatorCompatHelper怎么用?Java AnimatorCompatHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnimatorCompatHelper类属于android.support.v4.animation包,在下文中一共展示了AnimatorCompatHelper类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RecoverAnimation
import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
public RecoverAnimation(ViewHolder viewHolder, int animationType,
int actionState, float startDx, float startDy, float targetX, float targetY) {
mActionState = actionState;
mAnimationType = animationType;
mViewHolder = viewHolder;
mStartDx = startDx;
mStartDy = startDy;
mTargetX = targetX;
mTargetY = targetY;
mValueAnimator = AnimatorCompatHelper.emptyValueAnimator();
mValueAnimator.addUpdateListener(
new AnimatorUpdateListenerCompat() {
@Override
public void onAnimationUpdate(ValueAnimatorCompat animation) {
setFraction(animation.getAnimatedFraction());
}
});
mValueAnimator.setTarget(viewHolder.itemView);
mValueAnimator.addListener(this);
setFraction(0f);
}
示例2: RecoverAnimation
import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
public RecoverAnimation(ViewHolder viewHolder, int animationType, int actionState, float startDx, float startDy, float targetX, float targetY) {
this.mActionState = actionState;
this.mAnimationType = animationType;
this.mViewHolder = viewHolder;
this.mStartDx = startDx;
this.mStartDy = startDy;
this.mTargetX = targetX;
this.mTargetY = targetY;
this.mValueAnimator = AnimatorCompatHelper.emptyValueAnimator();
this.mValueAnimator.addUpdateListener(new AnimatorUpdateListenerCompat(ItemTouchHelper.this) {
public void onAnimationUpdate(ValueAnimatorCompat animation) {
RecoverAnimation.this.setFraction(animation.getAnimatedFraction());
}
});
this.mValueAnimator.setTarget(viewHolder.itemView);
this.mValueAnimator.addListener(this);
setFraction(0.0f);
}
示例3: zoomTo
import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
protected void zoomTo(float scale, float centerX, float centerY, final long durationMs) {
if (scale > getMaxScale()) {
scale = getMaxScale();
}
final float oldScale = getScale();
Matrix m = new Matrix(mSuppMatrix);
m.postScale(scale, scale, centerX, centerY);
RectF rect = getCenter(m, true, true);
final float finalScale = scale;
final float destX = centerX + rect.left * scale;
final float destY = centerY + rect.top * scale;
stopAllAnimations();
ValueAnimatorCompat animatorCompat = AnimatorCompatHelper.emptyValueAnimator();
animatorCompat.setDuration(durationMs);
final Interpolator interpolator = new DecelerateInterpolator(1.0f);
animatorCompat.addUpdateListener(new AnimatorUpdateListenerCompat() {
@Override
public void onAnimationUpdate(ValueAnimatorCompat animation) {
float fraction = interpolator.getInterpolation(animation.getAnimatedFraction());
float value = oldScale + (fraction * (finalScale - oldScale));
zoomTo(value, destX, destY);
}
});
animatorCompat.start();
}
示例4: resetAnimation
import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
private void resetAnimation(RecyclerView.ViewHolder holder) {
AnimatorCompatHelper.clearInterpolator(holder.itemView);
endAnimation(holder);
}
示例5: resetAnimation
import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
private void resetAnimation(ViewHolder holder) {
AnimatorCompatHelper.clearInterpolator(holder.itemView);
endAnimation(holder);
}
示例6: resetAnimation
import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
private void resetAnimation(ViewHolder holder) {
AnimatorCompatHelper.clearInterpolator(holder.itemView);
endAnimation(holder);
}
示例7: resetAnimation
import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
@SuppressLint("RestrictedApi")
private void resetAnimation(RecyclerView.ViewHolder holder) {
AnimatorCompatHelper.clearInterpolator(holder.itemView);
endAnimation(holder);
}
示例8: resetAnimation
import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
protected void resetAnimation(ViewHolder holder) {
AnimatorCompatHelper.clearInterpolator(holder.itemView);
endAnimation(holder);
}
示例9: resetAnimation
import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
private void resetAnimation(RecyclerView.ViewHolder paramViewHolder)
{
AnimatorCompatHelper.clearInterpolator(paramViewHolder.itemView);
endAnimation(paramViewHolder);
}