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

Commit 2546fcf5 authored by Alan Viverette's avatar Alan Viverette
Browse files

Constrain starting sub row to list bounds

BUG: 13077653
Change-Id: Id01da055e8502b1447519666eb439d8480437c6c
parent 6dd4e28b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -7188,7 +7188,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
                startOffsetRatio = -firstChild.getTop() / (float) firstChildHeight;
            }

            final float startSubRow = firstRow + startOffsetRatio;
            final float startSubRow = MathUtils.constrain(
                    firstRow + startOffsetRatio, 0, getCount());
            if (startSubRow == endSubRow && mOffset == 0) {
                // Don't scroll, target is already in position.
                return;