Skip to content

Commit aa4f5c9

Browse files
committed
Fix bug 5434403 - invalidation problem with seek bars at edges
Explicitly invalidate the seek bar thumb area when we change drawable states for touch down. This prevents the thumb from only being half-invalidated at the edges since it extends into the view's padding region. Change-Id: Icc4e608aca044b2d05f3a9378eced839c03947e6
1 parent 1a4c433 commit aa4f5c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/java/android/widget/AbsSeekBar.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ public boolean onTouchEvent(MotionEvent event) {
335335
mTouchDownX = event.getX();
336336
} else {
337337
setPressed(true);
338+
invalidate(mThumb.getBounds()); // This may be within the padding region
338339
onStartTrackingTouch();
339340
trackTouchEvent(event);
340341
attemptClaimDrag();
@@ -348,6 +349,7 @@ public boolean onTouchEvent(MotionEvent event) {
348349
final float x = event.getX();
349350
if (Math.abs(x - mTouchDownX) > mScaledTouchSlop) {
350351
setPressed(true);
352+
invalidate(mThumb.getBounds()); // This may be within the padding region
351353
onStartTrackingTouch();
352354
trackTouchEvent(event);
353355
attemptClaimDrag();

0 commit comments

Comments
 (0)