react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

Wrap Gesture Handler button with `View` and transform styles

Open j-piasecki opened this issue 2 years ago • 0 comments

Description

There are many issues with styling buttons provided by Gesture Handler, mostly on Android where the class responsible for button extends ViewGroup instead of ReactViewGroup as it changes the behavior of onTouchEvent.

The best solution to those issues is wrapping the button with a View and styling the outer view instead. This PR attempts to make it happen auto-magically, which should make the buttons look as expected.

The main problem is correctly transforming the provided styles into two separate objects that when applied to two composed views give the same effect as the original styles applied to just one view.

Test plan

For now, made sure that the changes don't break the Example app.

j-piasecki avatar Jun 09 '22 10:06 j-piasecki