DotsFragment.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:Material-Motion 作者:
private void addScaleAnimation(int startDelay, int duration, AnimatorSet set){
    final int start=!isFolded?1:0;
    final int end =~start & 0x1;
    AnimatorSet buttonSet=new AnimatorSet();
    for(int index=0;index<dots.size();index++){
        FloatingActionButton tempDot=dots.get(index);
        if(tempDot.getId()!=lastDot.getId()){
            ObjectAnimator scaleX=ObjectAnimator.ofFloat(tempDot,View.SCALE_X,start,end);
            ObjectAnimator scaleY=ObjectAnimator.ofFloat(tempDot,View.SCALE_Y,start,end);
            ObjectAnimator fade=ObjectAnimator.ofFloat(tempDot,View.ALPHA,start,end);
            scaleX.setStartDelay(startDelay);
            scaleY.setStartDelay(startDelay);
            scaleX.setInterpolator(new OvershootInterpolator(2));
            scaleY.setInterpolator(new OvershootInterpolator(2));
            fade.setStartDelay(startDelay);
            buttonSet.playTogether(scaleX,scaleY,fade);
        }
    }
    buttonSet.setDuration(duration);
    set.playTogether(buttonSet);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号