[290 bus司机端] 滑动出发按钮优化

This commit is contained in:
wangmingjun
2022-07-29 17:56:49 +08:00
parent d5d8ab39e7
commit 70c1fb7071

View File

@@ -85,6 +85,7 @@ public class SlidePanelView extends View {
private LinearGradient textGradient;
private ObjectAnimator matrixAnim;
private ObjectAnimator blockBackanimator;
private String blockText = STRING_SLIDE_TO_RIGHT;
private Paint.FontMetrics blockTextMetrics = new Paint.FontMetrics();
@@ -239,10 +240,10 @@ public class SlidePanelView extends View {
}
private void startBlockBackAnim() {
ObjectAnimator animator = ObjectAnimator.ofInt(this, "blockOffset", blockOffset, 0);
animator.setInterpolator(new DecelerateInterpolator());
animator.setDuration(1000 * blockOffset / getWidth());
animator.start();
blockBackanimator = ObjectAnimator.ofInt(this, "blockOffset", blockOffset, 0);
blockBackanimator.setInterpolator(new DecelerateInterpolator());
blockBackanimator.setDuration(1000 * blockOffset / getWidth());
blockBackanimator.start();
lastX = 0;
}