Fixed
Status Update
Comments
sh...@google.com <sh...@google.com> #3
Hey, thanks for the bug.
I did some experimentation and digging and did discover some behavior in the material slider that I need to discuss with that team. And then hopefully I can start steering toward a solution.
The issue seems to be related to the fact that in Compose we do not yet implement "shouldDelayChildPressedState()" and it seems that when the slider is delayed in that way, if there is a very small drag, it returns false from onTouchEvent() such that it no longer receives events. I'm asking the material team about that second bit.
Thanks!
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 829343f09551cfa642011e648db7e056568738c8
Author: Shep Shapard <shepshapard@google.com>
Date: Mon Oct 12 15:46:09 2020
PointerInteropFilter more inline with Android.
PointerInteropFilter was no longer sending events to an Android View after it returned false from onTouchEvent for all actions. This was not inline with how Android ViewGroups work, which would only stop sending events to a child that returns false from onPointerInput when the event type was ACTION_DOWN.
Now PointerInteropFilter works this way as well.
RelNote: "Improved Android interop by continuing to send MotionEvents to child Android Views that return false for onTouchEvent for all actions except ACTION_DOWN"
Fixes: 170320973
Test: ./gradlew compose:ui:ui:test
Test: ./gradlew compose:ui:ui:connectedCheck
Change-Id: I94c5ae24d8fd33d8e2f3d0086ed53654a0a57fea
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInteropFilterTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/PointerInteropFilter.kt
https://android-review.googlesource.com/1458763
Branch: androidx-master-dev
commit 829343f09551cfa642011e648db7e056568738c8
Author: Shep Shapard <shepshapard@google.com>
Date: Mon Oct 12 15:46:09 2020
PointerInteropFilter more inline with Android.
PointerInteropFilter was no longer sending events to an Android View after it returned false from onTouchEvent for all actions. This was not inline with how Android ViewGroups work, which would only stop sending events to a child that returns false from onPointerInput when the event type was ACTION_DOWN.
Now PointerInteropFilter works this way as well.
RelNote: "Improved Android interop by continuing to send MotionEvents to child Android Views that return false for onTouchEvent for all actions except ACTION_DOWN"
Fixes: 170320973
Test: ./gradlew compose:ui:ui:test
Test: ./gradlew compose:ui:ui:connectedCheck
Change-Id: I94c5ae24d8fd33d8e2f3d0086ed53654a0a57fea
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/pointer/PointerInteropFilterTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/PointerInteropFilter.kt
Description
Jetpack Compose release version:
1.0.0-alpha04
I have the following view:
But when I try to interact with the slider nothing happens. The slider works fine outside of Compose.
When doing some quick debugging (on alpha 3 however) I noticed the touch events that the
RangeSlider
receives looks something like this:ACTION_CANCEL
ACTION_DOWN
ACTION_MOVE
ACTION_CANCEL
Which would explain why it wasn't working but I don't know why it doesn't receive the touch events correctly.