RectKey.java 文件源码

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

项目:PasscodeView 作者:
/**
 * Public constructor.
 *
 * @param pinView {@link PinView}
 * @param digit   title of the key. (-1 for the backspace key)
 * @param bounds  {@link Rect} bound.
 */
private RectKey(@NonNull PinView pinView,
                @NonNull String digit,
                @NonNull Rect bounds,
                @NonNull RectKey.Builder builder) {
    super(pinView, digit, bounds, builder);

    mBounds = bounds;
    mBuilder = builder;

    //Error animator
    mErrorAnimator = ValueAnimator.ofInt(0, 10);
    mErrorAnimator.setInterpolator(new CycleInterpolator(2));
    mErrorAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            mBounds.left += (int) animation.getAnimatedValue();
            mBounds.right += (int) animation.getAnimatedValue();
            getPinView().invalidate();
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号