This PR adds support for hit slop on the MenuView component for Android, improving touch responsiveness and user experience.
Changes
MenuView.kt
Added mHitSlopRect property to store the hit slop rectangle
Implemented setHitSlopRect method to update the hit slop and trigger touch delegate update
Added onSizeChanged and onAttachedToWindow overrides to update touch delegate
Implemented updateTouchDelegate method to apply hit slop and set touch delegate
Testing
Please test the following scenarios:
Menu opens correctly with default touch area
Menu opens correctly when hit slop is applied
Hit slop works as expected for all sides (left, top, right, bottom)
Touch delegate updates properly when view size changes or when attached to window
Notes
This implementation enhances the touch area of the MenuView component, making it easier for users to interact with the menu, especially on smaller devices or for users with accessibility needs.
Add Hit Slop Support for MenuView on Android
This PR adds support for hit slop on the MenuView component for Android, improving touch responsiveness and user experience.
Changes
MenuView.kt
mHitSlopRect
property to store the hit slop rectanglesetHitSlopRect
method to update the hit slop and trigger touch delegate updateonSizeChanged
andonAttachedToWindow
overrides to update touch delegateupdateTouchDelegate
method to apply hit slop and set touch delegateTesting
Please test the following scenarios:
Notes
This implementation enhances the touch area of the MenuView component, making it easier for users to interact with the menu, especially on smaller devices or for users with accessibility needs.