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

Commit 00b98292 authored by Alan Viverette's avatar Alan Viverette
Browse files

Fix scrolling when the bound target offset is too high

BUG: 13033556
Change-Id: I7a61548d3c604f004726117b40882f84ddf75337
parent f9bf991c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -7196,7 +7196,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            // within that row by subtracting the height of each preceeding row.
            int remainingOffset = mOffset;
            int targetHeight = getHeightForRow(targetRow);
            while (targetRow > 0 && remainingOffset > targetHeight) {
            while (targetRow > 1 && remainingOffset > targetHeight) {
                targetRow--;
                remainingOffset -= targetHeight;
                targetHeight = getHeightForRow(targetRow);
@@ -7204,7 +7204,10 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te

            // Compute the offset within the actual target row.
            final float targetOffsetRatio;
            if (targetHeight == 0) {
            if (remainingOffset > 0) {
                // We can't reach that offset given the row count.
                targetOffsetRatio = 0;
            } else if (targetHeight == 0) {
                targetOffsetRatio = 1;
            } else {
                targetOffsetRatio = remainingOffset / (float) targetHeight;