Fix for ScrollView absorbing fling stretch

Bug: 288270962

When a fling was absorbed, it wasn't releasing the absorbed
stretch. This CL fixes that.

Test: new tests
Change-Id: Id328cb63911eed1644ed2d5e0ee6f2cdc5d4cce8
This commit is contained in:
George Mount
2023-07-05 14:46:24 -07:00
parent 46354c7d8e
commit d8dc760158

View File

@@ -1550,6 +1550,7 @@ public class ScrollView extends FrameLayout {
float deltaDistance = -unconsumed * FLING_DESTRETCH_FACTOR / size;
int consumed = Math.round(-size / FLING_DESTRETCH_FACTOR
* mEdgeGlowTop.onPullDistance(deltaDistance, 0.5f));
mEdgeGlowTop.onRelease();
if (consumed != unconsumed) {
mEdgeGlowTop.finish();
}
@@ -1560,6 +1561,7 @@ public class ScrollView extends FrameLayout {
float deltaDistance = unconsumed * FLING_DESTRETCH_FACTOR / size;
int consumed = Math.round(size / FLING_DESTRETCH_FACTOR
* mEdgeGlowBottom.onPullDistance(deltaDistance, 0.5f));
mEdgeGlowBottom.onRelease();
if (consumed != unconsumed) {
mEdgeGlowBottom.finish();
}