/**
* 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();
}
});
}
RectKey.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:PasscodeView
作者:
评论列表
文章目录