react-native-action-button icon indicating copy to clipboard operation
react-native-action-button copied to clipboard

Centering and shadows on android fixed with prop fixNativeFeedbackRadius

Open micnil opened this issue 7 years ago • 8 comments

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 before

After: after

micnil avatar Oct 14 '17 16:10 micnil

Please merge fixNativeFeedbackRadius=true not work on ActionButtonItem

iCodePup avatar Dec 18 '17 14:12 iCodePup

maybe if conflicts get resolved

mastermoo avatar Dec 18 '17 16:12 mastermoo

I'm struggling a bit to fix this merge conflict without reintroducing bug #223 . I'll give it another go this week.

micnil avatar Dec 19 '17 09:12 micnil

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.

micnil avatar Dec 19 '17 21:12 micnil

@mastermoo some news ? 👍

iCodePup avatar Jan 04 '18 09:01 iCodePup

@iCodePup sry, I didn't find the time to test it yet and I don't want to merge it blindly

mastermoo avatar Jan 04 '18 10:01 mastermoo

@mastermoo thanks! can you please publish a new release with this issue fixed?

zhaonian avatar Jan 17 '18 17:01 zhaonian

Hey , someone may test this PR on IOS before merged please ?

iCodePup avatar Feb 16 '18 09:02 iCodePup