IOSSwitch.java 文件源码

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

项目:IOSSwitch 作者:
private void off(AnimatorSet animatorSet) {
    // 按钮移动

    ObjectAnimator ballTransAnim1 = ofFloat(IOSSwitch.this, "mBallStartX", -frameStrokeWidth - ballStrokeWidth);
    ballTransAnim1.setDuration(250);

    ballTransAnim1.setInterpolator(new DecelerateInterpolator());

    ObjectAnimator ballTransAnim2 = ofFloat(IOSSwitch.this, "mBallStartX", 0);
    ballTransAnim2.setDuration(80);
    ballTransAnim2.setInterpolator(new DecelerateInterpolator());

    animatorSet.playSequentially(ballTransAnim1, ballTransAnim2);
    animatorSet.start();
    // 背景恢复
    ObjectAnimator bgColorAnim = ObjectAnimator.ofInt(this, "frameColor", frameColor, Colors.IOS_GRAY);
    bgColorAnim.setEvaluator(new ArgbEvaluator());
    bgColorAnim.setDuration(200);
    bgColorAnim.start();
    // 背景遮罩恢复
    ObjectAnimator backgroundScaleAnim = ofFloat(IOSSwitch.this, "mBackgroundStrokeWidth", frameStrokeWidth);
    backgroundScaleAnim.setDuration(300);
    backgroundScaleAnim.setInterpolator(new DecelerateInterpolator());
    backgroundScaleAnim.start();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号