Skip to content

Commit aa79a5d

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Fix bug 5455676 - seek bars without thumbs" into ics-mr0
2 parents 534b7af + 2c5b8cc commit aa79a5d

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)