类android.view.animation.AccelerateDecelerateInterpolator源码实例Demo

下面列出了怎么用android.view.animation.AccelerateDecelerateInterpolator的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: KUAS-AP-Material   文件: SilentActivity.java
public void setDisplayHomeAsUp(boolean value) {
	if (value == isDisplayHomeAsUp) {
		return;
	} else {
		isDisplayHomeAsUp = value;
	}

	ValueAnimator anim;
	if (value) {
		anim = ValueAnimator.ofFloat(0f, 1f);
	} else {
		anim = ValueAnimator.ofFloat(1f, 0f);
	}
	anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

		@Override
		public void onAnimationUpdate(ValueAnimator valueAnimator) {
			float slideOffset = (float) valueAnimator.getAnimatedValue();
			setDrawerIconState(slideOffset);
		}
	});
	anim.setInterpolator(new AccelerateDecelerateInterpolator());
	anim.setDuration(300);
	anim.start();
}
 
源代码2 项目: Mobike   文件: FlowerAnimation.java
public void a()
{
  if ((this.b != null) && (this.b.isRunning()))
    this.b.cancel();
  this.b = ObjectAnimator.ofFloat(this, "phase1", new float[] { 0.0F, 1.0F });
  this.b.setDuration(3 * this.k / 2);
  this.b.addUpdateListener(this);
  this.b.setInterpolator(new AccelerateInterpolator());
  this.b.start();
  if ((this.c != null) && (this.c.isRunning()))
    this.c.cancel();
  this.c = ObjectAnimator.ofFloat(this, "phase2", new float[] { 0.0F, 1.0F });
  this.c.setDuration(2 * (this.k / 3));
  this.c.addUpdateListener(this);
  this.c.setStartDelay(2 * this.l);
  this.c.start();
  this.c.setInterpolator(new AccelerateDecelerateInterpolator());
  if ((this.d != null) && (this.d.isRunning()))
    this.d.cancel();
  this.d = ObjectAnimator.ofFloat(this, "phase3", new float[] { 0.0F, 1.0F });
  this.d.setDuration(this.k / 3);
  this.d.addUpdateListener(this);
  this.d.setInterpolator(new AccelerateInterpolator(2.0F));
  this.d.setStartDelay(4 * this.l);
  this.d.start();
}
 
源代码3 项目: AppPlus   文件: AppFileListFragment.java
private void setupRecyclerView(View rootView) {
    mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
    mRecyclerView.setLayoutManager(mLayoutManager);
    mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));

    //every item's height is fix so use this method
    //RecyclerView can perform several optimizations
    mRecyclerView.setHasFixedSize(true);
    mAdapter = new AppFileListAdapter(getActivity());
    mAdapter.setClickPopupMenuItem(this);
    mAdapter.setClickListItem(this);

    SlideInBottomAnimationAdapter slideInLeftAdapter = new SlideInBottomAnimationAdapter(mAdapter);
    slideInLeftAdapter.setDuration(300);
    slideInLeftAdapter.setInterpolator(new AccelerateDecelerateInterpolator());

    mRecyclerView.setAdapter(slideInLeftAdapter);
}
 
源代码4 项目: BackgroundView   文件: BackgroundView.java
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
    super.onSizeChanged(w, h, oldw, oldh);

    initBézierCurve(w);

    /**
     *可根据不同需求设置不同差值器,产生不同的叶子飘动效果
     */
    mAnimators.add(startLeafAnimation(mLeaf1, w, 200, 5000, 0, new AccelerateInterpolator()));
    mAnimators.add(startLeafAnimation(mLeaf2, w, 200, 5000, 3000, new AccelerateDecelerateInterpolator()));
    mAnimators.add(startLeafAnimation(mLeaf3, w, 200, 5000, 2000, new OvershootInterpolator()));
    mAnimators.add(startLeafAnimation(mLeaf4, w, 200, 5000, 4000, new DecelerateInterpolator()));

    mAnimators.add(startCloudAnimation(mCloud1, w, 30000, 0));
    mAnimators.add(startCloudAnimation(mCloud2, w, 30000, 4000));
    mAnimators.add(startCloudAnimation(mCloud3, w, 30000, 8000));
}
 
/**
 * Creates and returns a layout listener, which allows to start a peek animation to add a tab,
 * once its view has been inflated.
 *
 * @param item
 *         The item, which corresponds to the tab, which should be added, as an instance of the
 *         class {@link AbstractItem}. The item may not be null
 * @param peekAnimation
 *         The peek animation, which should be started, as an instance of the class {@link
 *         PeekAnimation}. The peek animation may not be null
 * @return The listener, which has been created, as an instance of the type {@link
 * OnGlobalLayoutListener}. The listener may not be null
 */
private OnGlobalLayoutListener createPeekLayoutListener(@NonNull final AbstractItem item,
                                                        @NonNull final PeekAnimation peekAnimation) {
    return new OnGlobalLayoutListener() {

        @Override
        public void onGlobalLayout() {
            long totalDuration =
                    peekAnimation.getDuration() != -1 ? peekAnimation.getDuration() :
                            peekAnimationDuration;
            long duration = totalDuration / 3;
            Interpolator interpolator =
                    peekAnimation.getInterpolator() != null ? peekAnimation.getInterpolator() :
                            new AccelerateDecelerateInterpolator();
            float peekPosition =
                    getArithmetics().getTabContainerSize(Axis.DRAGGING_AXIS, false) * 0.66f;
            animatePeek(item, duration, interpolator, peekPosition, peekAnimation);
        }

    };
}
 
源代码6 项目: Pas   文件: FragmentMusicView.java
@Override
public void initWeidget() {
    ButterKnife.bind(this, getRootView());

    //ivicon旋转
    animator = ObjectAnimator.ofFloat(ivIcon, "rotation", 0, 360);
    animator.setDuration(15000);
    animator.setInterpolator(new LinearInterpolator());
    animator.setRepeatCount(ValueAnimator.INFINITE);

    //透明度动画
    animator1 = ObjectAnimator.ofFloat(rlBg, "alpha", 0.2f, 1.0f);
    animator1.setDuration(2000);
    animator1.setInterpolator(new AccelerateDecelerateInterpolator());


}
 
源代码7 项目: HTextView   文件: PixelateText.java
@Override public void animateText(CharSequence text) {
    mOldText = mText;
    mText = text;
    calc();

    int n = mText.length();
    n = n <= 0 ? 1 : n;

    long duration = (long) (charTime + charTime / mostCount * (n - 1));

    ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, duration).setDuration(duration);
    valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override public void onAnimationUpdate(ValueAnimator animation) {
            progress = (float) animation.getAnimatedValue();
            mHTextView.invalidate();
        }
    });
    valueAnimator.start();
}
 
源代码8 项目: ProgressView   文件: HorizontalProgressView.java
/**
 * @param startProgress 起始进度
 * @param progress 进度值
 * @param duration 动画播放时间
 */
public void setProgressInTime(int startProgress, final int progress, final long duration) {
  ValueAnimator valueAnimator = ValueAnimator.ofInt(startProgress, progress);
  valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

    @Override
    public void onAnimationUpdate(ValueAnimator animator) {
      //获得当前动画的进度值,整型,1-100之间
      int currentValue = (Integer) animator.getAnimatedValue();
      setProgress(currentValue);
    }
  });
  AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
  valueAnimator.setInterpolator(interpolator);
  valueAnimator.setDuration(duration);
  valueAnimator.start();
}
 
源代码9 项目: BezierView   文件: BezierMoveView.java
@Override
public void onClick(View v) {
    ValueAnimator valueAnimator = ValueAnimator.ofObject(new CirclePointEvaluator(), new Point(mStartXPoint, mStartYPoint),
            new Point(mEndXPoint, mEndYPoint));
    valueAnimator.setDuration(600);
    valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            Point point = (Point) animation.getAnimatedValue();
            mMoveXPoint = point.x;
            mMoveYPoint = point.y;
            invalidate();
        }
    });
    valueAnimator.start();

}
 
源代码10 项目: MaterialWpp   文件: DetailActivity.java
private void hideOrShowToolbar() {
    appBarLayout.animate()
            .translationY(ishide ? 0 : -appBarLayout.getHeight())
            .setInterpolator(new DecelerateInterpolator())
            .start();
    floatingActionButton.animate()
            .scaleX(ishide?1.0F:0.0F)
            .scaleY(ishide?1.0F:0.0F)
            .alpha(ishide?0.8F:0.0F)
            .setInterpolator(new AccelerateDecelerateInterpolator())
            .setDuration(500)
            .start();
    linearLayout.animate()
            .translationY(ishide?0:-(appBarLayout.getHeight()+linearLayout.getHeight()))
            .setInterpolator(new DecelerateInterpolator())
            .setDuration(1000)
            .start();
    ishide = !ishide;

}
 
源代码11 项目: science-journal   文件: RecordingThrobberView.java
public void startAnimation() {
  for (int i = 0; i < NUMBER_BARS; i++) {
    final int index = i;
    ValueAnimator animator = ValueAnimator.ofFloat(0, 100);
    animator.setDuration(MS_PER_CYCLE);
    animator.setRepeatMode(ValueAnimator.REVERSE);
    animator.setRepeatCount(ValueAnimator.INFINITE);
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    // Get sorta random starts using some prime numbers and modulo math
    animator.setCurrentPlayTime(
        (long) (MS_PER_CYCLE * (i * 3 + 7 * 1.0 % NUMBER_BARS) / NUMBER_BARS));
    animator.addUpdateListener(
        valueAnimator -> {
          animatedFraction[index] = valueAnimator.getAnimatedFraction();
          // Coordinate the invalidates for performance.
          postInvalidateOnAnimation();
        });
    animator.start();
    stopped.happensNext().subscribe(() -> animator.end());
  }
}
 
源代码12 项目: Twire   文件: AnimationService.java
public static void setActivityToolbarCircularRevealAnimation(final Toolbar aDecorativeToolbar) {
    aDecorativeToolbar.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
        @Override
        public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
            v.removeOnLayoutChangeListener(this);

            int CIRCULAR_REVEAL_DURATION = 700;
            int cx = (aDecorativeToolbar.getLeft() + aDecorativeToolbar.getRight()) / 2;
            int cy = 0;

            // get the final radius for the clipping circle
            int finalRadius = Math.max(aDecorativeToolbar.getWidth(), aDecorativeToolbar.getHeight());

            SupportAnimator animator = ViewAnimationUtils.createCircularReveal(aDecorativeToolbar, cx, cy, 0, finalRadius);

            animator.setInterpolator(new AccelerateDecelerateInterpolator());
            animator.setDuration(CIRCULAR_REVEAL_DURATION);
            animator.start();
        }
    });
}
 
源代码13 项目: Twire   文件: AnimationService.java
public static void setActivityToolbarReset(Toolbar aMainToolbar, Toolbar aDecorativeToolbar, Activity aActivity, float fromToolbarPosition, float fromMainToolbarPosition) {
    final int TOOLBAR_TRANSLATION_DURATION = 700;
    float DECORATIVE_TOOLBAR_HEIGHT = -1 * aActivity.getResources().getDimension(R.dimen.additional_toolbar_height);
    if (fromMainToolbarPosition == 0) {
        DECORATIVE_TOOLBAR_HEIGHT += aActivity.getResources().getDimension(R.dimen.main_toolbar_height);
    } else {
        Animation moveMainToolbarAnimation = new TranslateAnimation(0, 0, fromMainToolbarPosition, 0);
        moveMainToolbarAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
        moveMainToolbarAnimation.setDuration(TOOLBAR_TRANSLATION_DURATION);

        aMainToolbar.startAnimation(moveMainToolbarAnimation);
    }
    float fromTranslationY = Math.max(fromToolbarPosition, DECORATIVE_TOOLBAR_HEIGHT);

    Animation moveToolbarAnimation = new TranslateAnimation(0, 0, fromTranslationY, 0);
    moveToolbarAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    moveToolbarAnimation.setDuration(TOOLBAR_TRANSLATION_DURATION);

    aDecorativeToolbar.startAnimation(moveToolbarAnimation);
}
 
源代码14 项目: Twire   文件: AnimationService.java
public static void setAdapterInsertAnimation(final View aCard, int row, int height) {
    final int ANIMATION_DURATION = 650;
    final int BASE_DELAY = 50;

    TranslateAnimation translationAnimation = new TranslateAnimation(0, 0, height, 0);

    AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);

    final AnimationSet animationSet = new AnimationSet(true);
    animationSet.addAnimation(translationAnimation);
    animationSet.addAnimation(alphaAnimation);
    animationSet.setInterpolator(new AccelerateDecelerateInterpolator());
    animationSet.setFillAfter(true);
    animationSet.setFillBefore(true);
    animationSet.setDuration(ANIMATION_DURATION + row * BASE_DELAY);

    aCard.setAnimation(animationSet);
}
 
源代码15 项目: TwinklingRefreshLayout   文件: RoundProgressView.java
private void init() {
    mPath = new Paint();
    mPantR = new Paint();
    mPantR.setColor(Color.WHITE);
    mPantR.setAntiAlias(true);
    mPath.setAntiAlias(true);
    mPath.setColor(Color.rgb(114, 114, 114));

    va = ValueAnimator.ofInt(0, 360);
    va.setDuration(720);
    va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            endAngle = (int) animation.getAnimatedValue();
            postInvalidate();
        }
    });
    va.setRepeatCount(ValueAnimator.INFINITE);
    va.setInterpolator(new AccelerateDecelerateInterpolator());
}
 
public ExpandableTextView(final Context context, @Nullable final AttributeSet attrs, final int defStyle)
{
    super(context, attrs, defStyle);

    // read attributes
    final TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.ExpandableTextView, defStyle, 0);
    this.animationDuration = attributes.getInt(R.styleable.ExpandableTextView_animation_duration, BuildConfig.DEFAULT_ANIMATION_DURATION);
    attributes.recycle();

    // keep the original value of maxLines
    this.maxLines = this.getMaxLines();

    // create bucket of OnExpandListener instances
    this.onExpandListeners = new ArrayList<>();

    // create default interpolators
    this.expandInterpolator = new AccelerateDecelerateInterpolator();
    this.collapseInterpolator = new AccelerateDecelerateInterpolator();
}
 
private void setUpdateBottomAndTopAnimator(int fromY, int toY, long duration, final SlideOffsetAnimatorlistener listener) {
        ValueAnimator animator = new ValueAnimator();
        animator.setInterpolator(new AccelerateDecelerateInterpolator());
//        animator.setEvaluator(new TypeEvaluator<Integer>() {
//            @Override
//            public Integer evaluate(float fraction, Integer start, Integer end) {
//                return (int) (start + (end - start) * fraction);
//            }
//        });
        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                if (listener != null) {
                    listener.onAnimationUpdate(valueAnimator);
                }
            }
        });
        animator.setIntValues(fromY, toY);
        animator.setDuration(duration);
        animator.start();
    }
 
private void simulateErrorProgress(final CircularProgressButton button) {
    ValueAnimator widthAnimation = ValueAnimator.ofInt(1, 99);
    widthAnimation.setDuration(1500);
    widthAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    widthAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            Integer value = (Integer) animation.getAnimatedValue();
            button.setProgress(value);
            if (value == 99) {
                button.setProgress(-1);
            }
        }
    });
    widthAnimation.start();
}
 
源代码19 项目: kAndroid   文件: BezierPraiseAnimator.java
/**
 * 获取到点赞小图标动画
 *
 * @param target
 * @return
 */
private Animator getPraiseAnimator(View target) {
    // 获取贝塞尔曲线动画
    ValueAnimator bezierPraiseAnimator = getBezierPraiseAnimator(target);
    // 组合动画(旋转动画+贝塞尔曲线动画)旋转角度(200~720)
    int rotationAngle = mRandom.nextInt(520) + 200;
    ObjectAnimator rotationAnimator = ObjectAnimator.ofFloat(target, "rotation", 0,
            rotationAngle % 2 == 0 ? rotationAngle : -rotationAngle);
    rotationAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    rotationAnimator.setTarget(target);

    // 组合动画
    AnimatorSet composeAnimator = new AnimatorSet();
    composeAnimator.play(bezierPraiseAnimator).with(rotationAnimator);
    composeAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    composeAnimator.setDuration(mAnimatorDuration);
    composeAnimator.setTarget(target);
    return composeAnimator;

}
 
源代码20 项目: VirtualLocation   文件: PreciseLocationActivity.java
/**
 * 使组件变回原有形状
 * @param view
 */
private void repaintView(final View view){
    AnimatorSet set = new AnimatorSet();

    ValueAnimator animator = ValueAnimator.ofFloat(width, 0);
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            float value = (Float) animation.getAnimatedValue();
            ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) mBeginLocation
                    .getLayoutParams();
            params.leftMargin = (int) value;
            params.rightMargin = (int) value;
            view.setLayoutParams(params);
        }
    });

    ObjectAnimator animator2 = ObjectAnimator.ofFloat(view,
            "scaleX", 0.5f, 1f);
    set.setDuration(1000);
    set.setInterpolator(new AccelerateDecelerateInterpolator());
    set.playTogether(animator, animator2);
    set.start();
}
 
源代码21 项目: FileManager   文件: AnimationUtil.java
/**
 * @param view           展开动画的view
 * @param centerX        从具体某个点的X坐标开始扩散
 * @param centerY        从具体某个点的Y坐标开始扩散
 * @param MultipleRadius 半径倍数
 * @param Duration       动画时间
 * @return
 */
public static Animator getCircularReveal(View view, int centerX, int centerY, int MultipleRadius, int Duration) {

    int cx = (view.getLeft() + view.getRight()) / 2;
    int cy = (view.getTop() + view.getBottom()) / 2;

    int dx = Math.max(cx, view.getWidth() - cx);
    int dy = Math.max(cy, view.getHeight() - cy);
    float finalRadius = (float) Math.hypot(dx, dy);

    // Android native animator
    Animator animator =
            ViewAnimationUtils.createCircularReveal(view, centerX, centerY, 0, finalRadius * MultipleRadius);
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    animator.setDuration(Duration);
    return animator;
}
 
源代码22 项目: TwistyTimer   文件: TimerFragmentMain.java
private void updateHistorySwitchItem() {
    if (history) {
        navButtonHistory.setImageResource(R.drawable.ic_history_on);
        navButtonHistory.animate()
                .rotation(-135)
                .setInterpolator(new AccelerateDecelerateInterpolator())
                .setDuration(300)
                .start();
    } else {
        navButtonHistory.setImageResource(R.drawable.ic_history_off);
        navButtonHistory.animate()
                .rotation(0)
                .setInterpolator(new AccelerateDecelerateInterpolator())
                .setDuration(300)
                .start();
    }
}
 
源代码23 项目: WanAndroid   文件: MainActivity.java
/**
 * 隐藏floatingButton
 */
@SuppressLint("RestrictedApi")
private void hideFloatingButton(){
    if(fbtnUp.getVisibility() == View.VISIBLE){
        mHideFbtnAnimator = fbtnUp.animate().setDuration(300).setInterpolator(new AccelerateDecelerateInterpolator()).translationY(
                TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, 400, getResources().getDisplayMetrics())
        );
        mHideFbtnAnimator.setListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                fbtnUp.setVisibility(View.INVISIBLE);
            }
        });
        mHideFbtnAnimator.start();
    }
}
 
源代码24 项目: NumberAnimTextView   文件: NumberAnimTextView.java
private void start() {
    if (!mIsEnableAnim) {
        // 禁止动画
        setText(mPrefixString + format(new BigDecimal(mNumEnd)) + mPostfixString);
        return;
    }
    animator = ValueAnimator.ofObject(new BigDecimalEvaluator(), new BigDecimal(mNumStart), new BigDecimal(mNumEnd));
    animator.setDuration(mDuration);
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            BigDecimal value = (BigDecimal) valueAnimator.getAnimatedValue();
            setText(mPrefixString + format(value) + mPostfixString);
        }
    });
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            setText(mPrefixString + mNumEnd + mPostfixString);
        }
    });
    animator.start();
}
 
private void animateToolbarClose(int openPercentHeight, int duration) {
    ValueAnimator animator = ValueAnimator.ofInt(percentHeightToPx(openPercentHeight), 0).setDuration(duration);


    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            Integer value = (Integer) animation.getAnimatedValue();
            frameLayout.getLayoutParams().height = value;
            frameLayout.requestLayout();
        }
    });

    AnimatorSet set = new AnimatorSet();
    set.play(animator);
    set.setInterpolator(new AccelerateDecelerateInterpolator());
    set.start();
}
 
源代码26 项目: AndroidProject   文件: LoginActivity.java
@Override
public void onSoftKeyboardClosed() {
    // 执行位移动画
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBodyLayout, "translationY", mBodyLayout.getTranslationY(), 0);
    objectAnimator.setDuration(mAnimTime);
    objectAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    objectAnimator.start();

    if (mLogoView.getTranslationY() == 0){
        return;
    }
    // 执行放大动画
    mLogoView.setPivotX(mLogoView.getWidth() / 2f);
    mLogoView.setPivotY(mLogoView.getHeight());
    AnimatorSet animatorSet = new AnimatorSet();
    ObjectAnimator scaleX = ObjectAnimator.ofFloat(mLogoView, "scaleX", mLogoScale, 1.0f);
    ObjectAnimator scaleY = ObjectAnimator.ofFloat(mLogoView, "scaleY", mLogoScale, 1.0f);
    ObjectAnimator translationY = ObjectAnimator.ofFloat(mLogoView, "translationY", mLogoView.getTranslationY(), 0);
    animatorSet.play(translationY).with(scaleX).with(scaleY);
    animatorSet.setDuration(mAnimTime);
    animatorSet.start();
}
 
源代码27 项目: AgentWebX5   文件: RoundProgressView.java
private void init() {
    mPath = new Paint();
    mPantR = new Paint();
    mPantR.setColor(Color.WHITE);
    mPantR.setAntiAlias(true);
    mPath.setAntiAlias(true);
    mPath.setColor(Color.rgb(114, 114, 114));

    va = ValueAnimator.ofInt(0, 360);
    va.setDuration(720);
    va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            endAngle = (int) animation.getAnimatedValue();
            postInvalidate();
        }
    });
    va.setRepeatCount(ValueAnimator.INFINITE);
    va.setInterpolator(new AccelerateDecelerateInterpolator());
}
 
private void initializeAnimators(float startRadius, float endRadius, int duration) {
    mAnimatorSet = new AnimatorSet();
    ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(mRippleView, "radius", startRadius, endRadius);
    scaleXAnimator.setRepeatCount(ValueAnimator.INFINITE);

    ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(mRippleView, "alpha", 1f, 0f);
    alphaAnimator.setRepeatCount(ValueAnimator.INFINITE);

    mAnimatorSet.setDuration(duration);
    mAnimatorSet.setInterpolator(new AccelerateDecelerateInterpolator());
    mAnimatorSet.playTogether(scaleXAnimator, alphaAnimator);
}
 
源代码29 项目: MousePaint   文件: AnimatorUtils.java
public static Animator moveScrollViewToX(View view, int toX, int time, int delayTime, boolean isStart) {
    ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "scrollX", new int[]{toX});
    objectAnimator.setDuration(time);
    objectAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    objectAnimator.setStartDelay(delayTime);
    if (isStart)
        objectAnimator.start();
    return objectAnimator;
}
 
源代码30 项目: MiBandDecompiled   文件: StatisticFragment.java
private Animator b(StatisticChartView statisticchartview, StatisticChartView statisticchartview1, int i1, int j1, int k1, int l1, int i2)
{
    float f1 = (float)i1 / (float)j1;
    Animator animator = AnimUtil.animFade(statisticchartview, 0.0F, 1.0F);
    Animator animator1 = AnimUtil.animScaleX(statisticchartview, f1, 1.0F);
    Animator animator2 = AnimUtil.animScaleX(statisticchartview1, 1.0F, (float)j1 / (float)i1);
    cn.com.smartdevices.bracelet.chart.util.AnimUtil.AnimSetBuilder.setFirstAnim(animator1, i2);
    cn.com.smartdevices.bracelet.chart.util.AnimUtil.AnimSetBuilder.addAnim(animator, i2);
    cn.com.smartdevices.bracelet.chart.util.AnimUtil.AnimSetBuilder.addAnim(animator2, i2);
    cn.com.smartdevices.bracelet.chart.util.AnimUtil.AnimSetBuilder.addAnim(statisticchartview1.animRefreshTo(i2, k1, l1));
    android.animation.AnimatorSet animatorset = cn.com.smartdevices.bracelet.chart.util.AnimUtil.AnimSetBuilder.build();
    animatorset.setInterpolator(new AccelerateDecelerateInterpolator());
    animatorset.addListener(new ce(this, statisticchartview, statisticchartview1));
    return animatorset;
}