private Animation generateLineRTLAnimation(final RectF rectF, long offset) {
final float currentLeft = rectF.left;
final float currentRight = rectF.right;
Animation animation = new Animation() {
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
super.applyTransformation(interpolatedTime, t);
if (getCurrentState() == HBButtonState.NORMAL) {
rectF.set(currentLeft + (currentRight - currentLeft) / 2 * interpolatedTime, rectF.top, rectF.right, rectF.bottom);
} else {
rectF.set(currentLeft - (currentRight - currentLeft) * interpolatedTime, rectF.top, rectF.right, rectF.bottom);
}
invalidate();
}
};
animation.setDuration(getAnimationDuration());
animation.setStartOffset(offset);
return animation;
}
HBButton.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:Hamburger-Button
作者:
评论列表
文章目录