ui-ninja / react-native-rating-element

A simple rating library for react native supporting: decimal points, direction aware icons, custom icon set from Ionicons, custom images and record rating given by users.
MIT License
25 stars 5 forks source link

[Feature Request] Custom Images as Rating #5

Closed Relax594 closed 4 years ago

Relax594 commented 4 years ago

Instead of defining just an icon, let us define a type with ["icon", "custom"] (defaults to icon) and if we set the type to custom, we can use an custom image (for example a .png file). This way we would be able to setup something like this: Unbenannt

Thanks a lot!

ui-ninja commented 4 years ago

@Relax594 Images are always a problem.. it was the reason why I created this tiny library. Especially when we think in terms of wrapping <Rating /> inside <TocuhableOpacity />, width/height scaling of image, background color leakage etc etc.

I faced similar issues on existing libraries like this

But let me think and analyse more over weekend..and see if this can be something which will add more value to library.

Relax594 commented 4 years ago

I modified the react-native-ratings repo (which is used in React-Native-Elements) to make it work like in my picture posted above. The way it works is the same as the way you do it in this repo. I just added a PNG which is transparent fill and has a border. A second layer with the fill-color is growing in height or width depending on rating.

Having this feature in this library would allow me to get rid of react-native-ratings, which is kinda abandoned.

ui-ninja commented 4 years ago

@Relax594 ok! will check and revert.. should not be a big thing to implement.

ui-ninja commented 4 years ago

@Relax594 Check v5.1.0

ui-ninja commented 4 years ago

@Relax594 I am closing this request as requested feature is added and released in v5.1.0. Feel free to reopen if request not fulfilled.

Relax594 commented 4 years ago

Looks really solid! Appreciate it!