GithubHelp home page GithubHelp logo

ksti / react-native-star-rating-view Goto Github PK

View Code? Open in Web Editor NEW
47.0 47.0 20.0 3.34 MB

StarRatingView for react-native, supporting decimal fraction and sliding rating. Works on both Android and iOS.(星星评价打分组件:支持小数、滑动打分。支持安卓和iOS,可自定义图片)

License: MIT License

JavaScript 100.00%
android ios react-native starratingview

react-native-star-rating-view's People

Contributors

dependabot[bot] avatar ksti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-native-star-rating-view's Issues

Console logs

The component prints a lot of things to the console. Would be nicer to remove those, or add a "verbose" / "debug" prop to the component :)

Don't show score in the example

Thanks a lot for the package :)
I think the "dontShowScore" should be shown in the example, it is very useful to be able to disable it

Feature Request: add onPressIn / onPressOut to the api

I'd love the ability to be able to run callbacks that trigger based on user's touch.. For example, for the onPressIn and onPressOut events, I'm trying to dynamically render a rating display UI Component based on when the user is actively rating / touching the component or not.. Unfortunately I can't do that with the current API it seems and wrapping it in a TouchableOpacity or other touch sensing component (TouchableWithoutFeedback), makes the component behave as if it were readonly..

My initial guess / intuition is that it looks like the highest level TouchableOpacity takes precedence over the lower ones.. Is there a way to insert a call back for those properties here that I'm missing, and if not, would it be difficult to pass down a callback into whatever component is capable of handling onPress events?

What I'm attempting to do:

  <TouchableOpacity
          activeOpacity={1}
          onPressIn={() => setActivelyRating(true)}
          onPressOut={() => setActivelyRating(false)}
        >
          <StarRatingBar
            testID={testID}
            starStyle={getStarStyles({ disabled, size, customSizes })}
            readOnly={false}
            dontShowScore
            spacing={10}
            valueToFix={1} // accuracy of decimals
            continuous
            score={+rating}
            allowsHalfStars
            accurateHalfStars
            tintColor={getTintColor({ disabled })}
            onStarValueChanged={val => handleStarChange(val)}
            scoreTextStyle={getRatingTextStyle({ disabled, size })}
          />
</TouchableOpacity>

Add ability to stop logs even in debug mode

It would be fantastic if we could disable the logs in the console (even in debug / developer mode ).. I see someone has mentioned this in the past and they're enabled only in debug mode but I would still love to be able to turn those off and only turn them on when I need to debug..
Not a huge deal since I can just namespace the console logs I want to see, but it'd be a nice to have for sure...

Default value or score not filling stars when component renders first time and also not filling first star when default value is set

Thanks for this library.

I have a problem when using StarRatingView. When the component first renders the stars are not filling even when the score or value is set. Also when value is set and i swipe the stars, the first star is not filling with colour. Here is my code

`<StarRatingView
starStyle = {{
width : 50,
height : 50
}}
readOnly = { false }
//dontShowScore = { true } // true: not show the score text view
continuous = { true }
//score = { rating }
allowsHalfStars = { true }
accurateHalfStars = { true }
//maximumValue = { 5 }
//minimumValue = { 0 }
//spacing = { 10 }
value = { rating }
onStarValueChanged = {(changedScore) => ratingCompleted(changedScore, "qualityofservicerating") }
/>`

Simulator Screen Shot - iPhone 8 - 2020-09-18 at 11 55 30
Simulator Screen Shot - iPhone 8 - 2020-09-18 at 11 57 32

Can you please look into this issue. Thanks.

Custom Icon?

Thanks for library.

Can i pass custom icon from react-native-vector-icons?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.