ProfileAnimatedMenu.java 文件源码

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

项目:ModesoActionOverlay-Android 作者:
void animateMenuItemOpen(View view,long delay){
    ObjectAnimator animScaleX = ObjectAnimator.ofFloat(view,"scaleX",0.0f,1.0f);
    ObjectAnimator animScaleY = ObjectAnimator.ofFloat(view,"scaleY",0.0f,1.0f);
    ObjectAnimator animAlpha = ObjectAnimator.ofFloat(view,"alpha",0,ITEM_FINAL_ALPHA);
    ObjectAnimator animRotation = ObjectAnimator.ofFloat(view,"rotation",0,360.0f);

    final int X_SCALE_ANIMATION_DURATION = 300;
    final int Y_SCALE_ANIMATION_DURATION = 300;

    animScaleX.setDuration(X_SCALE_ANIMATION_DURATION);
    animScaleY.setDuration(Y_SCALE_ANIMATION_DURATION);

    animRotation.setDuration(200);

    AnimatorSet animSet = new AnimatorSet();
    if(allowItemRotationAnim)
        animSet.playTogether(animScaleX,animScaleY,animAlpha,animRotation);
    else
        animSet.playTogether(animScaleX,animScaleY,animAlpha);
    animSet.setStartDelay(delay);
    animSet.setInterpolator(new AccelerateDecelerateInterpolator());
    animSet.start();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号