当前位置: 首页>>代码示例>>Java>>正文


Java AnimatorCompatHelper类代码示例

本文整理汇总了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);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:22,代码来源:ItemTouchHelper.java

示例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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:19,代码来源:ItemTouchHelper.java

示例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();
}
 
开发者ID:gotokatsuya,项目名称:FlickableView,代码行数:31,代码来源:ImageViewTouchBase.java

示例4: resetAnimation

import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
private void resetAnimation(RecyclerView.ViewHolder holder) {
    AnimatorCompatHelper.clearInterpolator(holder.itemView);
    endAnimation(holder);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:BaseItemAnimator.java

示例5: resetAnimation

import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
private void resetAnimation(ViewHolder holder) {
	AnimatorCompatHelper.clearInterpolator(holder.itemView);
	endAnimation(holder);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:FlexibleItemAnimator.java

示例6: resetAnimation

import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
private void resetAnimation(ViewHolder holder) {
    AnimatorCompatHelper.clearInterpolator(holder.itemView);
    endAnimation(holder);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:5,代码来源:DefaultItemAnimator.java

示例7: resetAnimation

import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
@SuppressLint("RestrictedApi")
private void resetAnimation(RecyclerView.ViewHolder holder) {
    AnimatorCompatHelper.clearInterpolator(holder.itemView);
    endAnimation(holder);
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:6,代码来源:BaseItemAnimator.java

示例8: resetAnimation

import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
protected void resetAnimation(ViewHolder holder) {
    AnimatorCompatHelper.clearInterpolator(holder.itemView);
    endAnimation(holder);
}
 
开发者ID:anotherMe17,项目名称:CommonAdapterSample,代码行数:5,代码来源:BaseItemAnimator.java

示例9: resetAnimation

import android.support.v4.animation.AnimatorCompatHelper; //导入依赖的package包/类
private void resetAnimation(RecyclerView.ViewHolder paramViewHolder)
{
  AnimatorCompatHelper.clearInterpolator(paramViewHolder.itemView);
  endAnimation(paramViewHolder);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:6,代码来源:DefaultItemAnimator.java


注:本文中的android.support.v4.animation.AnimatorCompatHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。