FlipAnimation.java 文件源码

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

项目:Flashcards-Demo 作者:
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
    final double radians = Math.PI * interpolatedTime;
    float degrees = (float) (180.0 * radians / Math.PI);

    if (interpolatedTime >= 0.5f) { // Alternate the visibility of views at the exact half of animation duration.
        degrees -= 180.f;
        fromView.setVisibility(View.GONE);
        toView.setVisibility(View.VISIBLE);
    }

    if (forward)
        degrees = -degrees;

    final Matrix matrix = t.getMatrix();
    camera.save();
    camera.rotateY(degrees);
    camera.getMatrix(matrix);
    camera.restore();
    matrix.preTranslate(-centerX, -centerY);
    matrix.postTranslate(centerX, centerY);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号