Skip to content

bealitamoor/Android-CustomRatingBar

Repository files navigation

Android-CustomRatingBar

CustomRatingBar is a library to help you show custom rating bar in your android app.

screen shot

Install

You can download from jitpack.

Latest version is

Step 1. Add the JitPack repository to your build file

  allprojects {
		repositories {
			...
			maven { url 'https://www.jitpack.io' }
		}
	}

Step 2. Add the dependency

dependencies {
	        implementation 'com.github.bealitamoor:Android-CustomRatingBar:Tag'
	}

Usage

Configuration

Android-Rate provides methods to configure its behavior.

class MainActivity : AppCompatActivity(), CustomRatingBar.OnStarChangeListener {

    protected var mRb: CustomRatingBar? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        mRb = findViewById(R.id.rb)
        mRb!!.onStarChangeListener = this
    }

    override fun onStarChange(ratingBar: CustomRatingBar?, star: Float) {
        //Toast.makeText(this, "Rating: $star", Toast.LENGTH_SHORT).show()
    }
}

XML attributes

app:currentStar="3.5"
app:maxStar="5"
app:minStar="0.5"
app:padding="10dp"
app:starHeight="15dp"
app:starWidth="15dp"

Support

Android-Rate supports API level 24 and up.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages