summaryrefslogtreecommitdiff
path: root/libs/androidfw/ResourceTimer.cpp
diff options
context:
space:
mode:
author Alejandro Nijamkin <nijamkin@google.com> 2025-03-07 13:43:38 -0800
committer Alejandro Nijamkin <nijamkin@google.com> 2025-03-07 14:16:05 -0800
commit93780a19de44071f186f1f0b9398ad789267713d (patch)
treeabd0861eb1b48e8d0a14c08e20c671f314edd035 /libs/androidfw/ResourceTimer.cpp
parentf20414a213ad79fec6a905c61dcb0e3b473d8c7e (diff)
[Media] Reject seek bar scrubbing if too vertical.
If a drag gesture begins on the seek bar and that drag gesture ends up being more vertical than horizontal, don't commit the result of the scrubbing when the drag gesture ends. As it turns out, there's no support for this in the Slider composable from the Material library. It just reports onValueChangeFinished regardless of how vertical the drag was; it doesn't even have a mechanism by which to observe or receive the actual delta. Therefore, I went around it. I used .pointerInput which is the low-level user input API in Compose to just watch for all gestures on the Slider. Then, I collected and reported the drag delta to the view-model so it has the information it needs to make its own decision when it handles the onValueChangeFinished. Bug: 397989775 Test: manually verified in the Compose Gallery app - starting a drag in the bounds of the seek bar, dragging too far up or down, and releasing reverts the position back to where it first was. Also verified that doing the same but going more horizontally than vertically works correctly. Flag: EXEMPT - code not yet used in production code. Change-Id: I5998cc8dd161769036f7e3a654394df24c9f9b2d
Diffstat (limited to 'libs/androidfw/ResourceTimer.cpp')
0 files changed, 0 insertions, 0 deletions