ExactRatingBar

General

Category
Free
Tag
Feedback & Ratings
License
N/A
Min SDK
19 (Android 4.4 KitKat)
Registered
Sep 25, 2019
Favorites
1
Link
https://github.com/Jamshid-M/ExactRatingBar
See also
Maoni
FeedbackDialog
EasyFeedback
FeedbackManager
AndroidRate

Additional

Language
Kotlin
Version
1.0.0 (Sep 25, 2019)
Created
Sep 25, 2019
Updated
Sep 26, 2019
Owner
Jamshid Mamatkulov (Jamshid-M)
Contributor
Jamshid Mamatkulov (Jamshid-M)
1
Activity
Badge
Generate
Download
Source code
APK file

Advertisement

ExactRatingBar

RatingBar with exact values.

Usage

Add it in your root build.gradle at the end of repositories

repositories {

        maven { url 'https://jitpack.io' }
    }
dependencies {
 implementation 'com.github.Jamshid-M:ExactRatingBar:1.0.0'
}

Open activity and specify ExactRatingBar object and setup listener for it, you can use simple interface callback or lambda

        var rate = findViewById<ExactRatingBar>(R.id.rate)
        rate.onRatingBarChanged = object : ExactRatingBar.OnRatingBarChanged{
            override fun newRate(rate: Float) {
                Toast.makeText(this@MainActivity, rate.toString(), Toast.LENGTH_LONG).show()
                Log.d("MYTAG", "interface$rate")
            }
        }

        rate.onRateChanged = {
            Log.d("MYTAG", "lambda$it")
        }

You can set properties of RatingBar in xml

<uz.jamshid.library.ExactRatingBar
        android:id="@+id/rate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        app:starCount="5"
        app:isIndicator="false"
        app:starFillColor="@color/colorAccent"
        app:starSize="96"
        app:starValue="3.5"
        />

starCount specifies number of stars starValue rate of star, e.g 3.5 out of 5
starSize size of star
starFillColor color of star
isIndicator enables/disables touch listener, by which user enables or disables seeking in RatingBar