Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b605a4e2 authored by Phil Weaver's avatar Phil Weaver
Browse files

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
(cherry picked from commit 54ee713d)
parent 446c5b08
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -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;
        }
        }