react-native-action-button
react-native-action-button copied to clipboard
Centering and shadows on android fixed with prop fixNativeFeedbackRadius
When setting fixNativeFeedbackRadius
to true and giving the ActionButton position 'Center'. The ActionButton and ActionButtonItems would have an offset from the center due to incorrect styling.
fixNativeFeedbackRadius also caused an ugly shadow on ActionButtonItems and their respective lable, and also a cropped dropshadow.
For the ActionButtonItem, this was due to the shadow styling was set on the wrong element for android. As for the lable, we do not need to set the fixNativeFeedbackRadius
to the touchableBackground (the lable is rectangular anyway). You'll notice that the ripple effect on the lable would extend in a circular fashion outside the borders of the lable.
Fixes #227
Before:
fixNativeFeedbackRadius=true on ActionButton and the second ActionButtonItem
After:
Please merge fixNativeFeedbackRadius=true not work on ActionButtonItem
maybe if conflicts get resolved
I'm struggling a bit to fix this merge conflict without reintroducing bug #223 . I'll give it another go this week.
I pushed changes that solved the conflict, but I should have written a better commit message. Before I was fairly certain I wouldn't break anything on IOS, and now i'm i bit less certain unfortunatly. This was the best I could come up with.
The shadow props needed to be applied to the parent view of Touchable
to avoid the shadow being cropped.
parentStyle
was moved from the container Animated.View
to the child view. I also removed the conditional styling of parenStyle
because I saw no need for it anymore, and it actually made it look really bad on android if fixNativeFeedbackRadius=true
was not used. Although this is the part that i'm not 100% confident in. It works superb on android though.
I've tested multiple sizes of ActionButtonItem in combination with all different position placements. Also tested with and without fixNativeFeedbackRadius=true
.
Should be tested similarly on IOS.
@mastermoo some news ? 👍
@iCodePup sry, I didn't find the time to test it yet and I don't want to merge it blindly
@mastermoo thanks! can you please publish a new release with this issue fixed?
Hey , someone may test this PR on IOS before merged please ?