Skip to content

Commit 2c5b8cc

Browse files
committed
Fix bug 5455676 - seek bars without thumbs
Change-Id: I9a4257b91a89cceeca7d5acf9358a8254446c784
1 parent a6708c6 commit 2c5b8cc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/java/android/widget/AbsSeekBar.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ 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
338+
if (mThumb != null) {
339+
invalidate(mThumb.getBounds()); // This may be within the padding region
340+
}
339341
onStartTrackingTouch();
340342
trackTouchEvent(event);
341343
attemptClaimDrag();
@@ -349,7 +351,9 @@ public boolean onTouchEvent(MotionEvent event) {
349351
final float x = event.getX();
350352
if (Math.abs(x - mTouchDownX) > mScaledTouchSlop) {
351353
setPressed(true);
352-
invalidate(mThumb.getBounds()); // This may be within the padding region
354+
if (mThumb != null) {
355+
invalidate(mThumb.getBounds()); // This may be within the padding region
356+
}
353357
onStartTrackingTouch();
354358
trackTouchEvent(event);
355359
attemptClaimDrag();

0 commit comments

Comments
 (0)