FlyingPumba / SimpleRatingBar

Open source project which features a simple yet powerful RatingBar alternative to Android's default
Apache License 2.0
1.03k stars 142 forks source link

ScrollView parent - Touch vertical drag on SimpleRatingBar widget delegates the drag to ScrollView #13

Closed ghost closed 7 years ago

ghost commented 8 years ago

I think the widget should only loose its touch state when the user releases or cancels the touch event and not on move.

ghost commented 8 years ago

Actually, come to think of it, the delegation of drag to parent view is legit. What, however, should not happen is registering the rating with the widget, i.e. when the touch move is taken over by parent, the widget should not accept the new rating value.

FlyingPumba commented 8 years ago

@iontech Thanks for the bug report. I'll look into it in the weekend.

FlyingPumba commented 8 years ago

@iontech I think this is really not a problem. Is not up to the children views whether they can claim or not the touch event. If parent view group decides so, it can intercept all touch events. Also, this currently works as you described in the second comment in the sample app:

  1. User starts a touch event in a SimpleRatingBar.
  2. Moving the finger inside the view changes the rating.
  3. The moment the user touches outside the rating bar, the drag starts, which means that ScrollView intercepted the touch event for itself.
  4. Once this happens the rating bar won't get the touch event again, and so the rating is unchanged during scroll.