-
Notifications
You must be signed in to change notification settings - Fork 220
Support for shaped clipped event handler #2633
Conversation
@keianhzo Looks like this needs to be rebased. |
26e66c9
to
34dcdc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you click on a button, move the pointer outside and release the pointer outside it triggers the click action. As a user I'd expect the click to be cancelled if it was released outside of the button area
@keianhzo master has also some instances of this behaviour but it got worse with this PR. Example:
|
Ideally we should cancel all the clicks if they are released outside the area (unless the button is small and needs some extra margin to avoid failing touches) |
But isn't this how we wanted sticky buttons to work? When you pressed in a button it would capture focus until it was released? |
The problem we had is that after pressing if the pointer was moved the touch was cancelled and the click missed. For me the correct behavior is capture the focus until it's released, but if released outside of the button shape it should cancel the click. You can try the behavior in Oculus Launcher tray menu, it works that way. |
Okay, to be clear we still want the keyboard keys to work the same, where even if you release outside of the key, it is still pressed. But for other bigger buttons, we don't want the button pressed if the pointer is outside the button? |
34dcdc2
to
ae12697
Compare
@MortimerGoro I've updated the PR and added support for cancelling the events when released outside the button bounds. |
@keianhzo this one needs to be rebased too, conflicts with the changes for Android 8: // Android >8 doesn't perform a click when long clicking in ImageViews even if long click is disabled |
I don't think this is worth landing. There seems to be a few side effect and the benefit doesn't justify the risk of regressions. |
Adds a delegate to handle sticky shape clipped events for UI buttons.
This is a continuation of the work done for the honeycomb buttons input clipping based on the background shape.
You can appreciate the clipping in the URL bar buttons and the back buttons in the panels as they extend from UIBUtton. We can easily extend this to the rest of the UI buttons using the same delegate so all the input is background shape clipped.
Related to: #2601