react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.49k stars 280 forks source link

fix(android): spinner background issues #290

Closed mateusz1913 closed 3 years ago

mateusz1913 commented 3 years ago

closes #266 closes #235 closes #112

In order to fix issues with buggy color/style changes to android spinner's background I created custom background resource which should look identical to default one

It allowed to finally have proper color/background change possibilities.

With default background, if one had applied custom backgroundColor in JS, it overriden whole background for spinner, which resulted in removing dropdown icon completely.

With new custom background resource, we can apply color changes directly to icon or spinner background.

As a side-effect, I introduced possibility to change icon ripple color also, it is exposed as dropdownIconRippleColor prop

NOTE: minSdkVersion was increased to 21 (now it matches with react-native core)

dohooo commented 3 years ago

fix it?please go on

dohooo commented 3 years ago

It was a great PR~!

Naturalclar commented 3 years ago

:tada: This PR is included in version 1.16.6 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

rurikoaraki commented 3 years ago

Thanks for the fix/support of ColorValue! I just tried integrating this in my repo and found that in this change, while the docs claim that dropdownIconColor is type ColorValue, the type file of defines its type as the return type of processColor, which is different from ColorValue. In order to get this to work, I need to call processColor on the color I pass into dropdownIconColor.

This isn't a huge issue for me, but wanted to give you a heads up on the mismatch.

Saadnajmi commented 3 years ago

Thanks for the fix/support of ColorValue! I just tried integrating this in my repo and found that in this change, while the docs claim that dropdownIconColor is type ColorValue, the type file of defines its type as the return type of processColor, which is different from ColorValue. In order to get this to work, I need to call processColor on the color I pass into dropdownIconColor.

This isn't a huge issue for me, but wanted to give you a heads up on the mismatch.

I would actually call that an issue, because it implies you should call processColor as a client, and you should not be (that is an internal API) and returns a different object than a ColorValue