Ensure a11y ids for LabeledSeekBar are in bounds
Bug: 64124736 Test: I just played with it with TalkBack on. The crash was difficult to reproduce before, and I can't make it fail now. I believe I got it. Change-Id: I17ffe8d83e21e716d1c0cadea52afcf09bff6e97
This commit is contained in:
@@ -201,6 +201,7 @@ public class LabeledSeekBar extends SeekBar {
|
|||||||
int posBase = Math.max(0,
|
int posBase = Math.max(0,
|
||||||
((int) x - LabeledSeekBar.this.getPaddingStart()) / getHalfVirtualViewWidth());
|
((int) x - LabeledSeekBar.this.getPaddingStart()) / getHalfVirtualViewWidth());
|
||||||
posBase = (posBase + 1) / 2;
|
posBase = (posBase + 1) / 2;
|
||||||
|
posBase = Math.min(posBase, LabeledSeekBar.this.getMax());
|
||||||
return mIsLayoutRtl ? LabeledSeekBar.this.getMax() - posBase : posBase;
|
return mIsLayoutRtl ? LabeledSeekBar.this.getMax() - posBase : posBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user