RatingView

class RatingView @JvmOverloads constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = R.attr.Default_RatingView_Style, defStyleRes: Int = R.style.BaseRatingView) : View

RatingView.

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = R.attr.Default_RatingView_Style, defStyleRes: Int = R.style.BaseRatingView)

Types

Link copied to clipboard

Listener that the rating has changed.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val mDefaultRating: Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val mDefaultStarCount: Int
Link copied to clipboard
Link copied to clipboard

The original bitmap of the selected star.

Link copied to clipboard

The original bitmap of the unselected star.

Link copied to clipboard
private val mPaint: Paint
Link copied to clipboard

Star Bitmap height(in pixels).

Link copied to clipboard

Star Bitmap width(in pixels).

Link copied to clipboard

Max number of stars.

Link copied to clipboard

Star interval width(in pixels).

Link copied to clipboard

The star orientation.

Link copied to clipboard
private var mStarRating: Float

The progress of the currently selected stars.

Link copied to clipboard

The bitmap of the selected star with required size.

Link copied to clipboard

The star selection method.

Link copied to clipboard

The bitmap of the unselected star with required size.

Functions

Link copied to clipboard
protected open override fun onDraw(canvas: Canvas)
Link copied to clipboard
protected open override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)
Link copied to clipboard
open override fun onTouchEvent(event: MotionEvent): Boolean
Link copied to clipboard
open override fun performClick(): Boolean
Link copied to clipboard

Sets the listener to be called when the rating changes.

Link copied to clipboard
fun setStarBitmapSize(@FloatRange(from = 0.0) starWidth: Float, @FloatRange(from = 0.0) starHeight: Float)
Link copied to clipboard
fun setStarCountNumber(@IntRange(from = 0) starCountNumber: Int)

Set the number of star.

Link copied to clipboard
fun setStarIntervalWidth(@FloatRange(from = 0.0) starSpaceWidth: Float)

Set star bitmap interval.

Link copied to clipboard
fun setStarOrientation(starOrientation: StarOrientation)

Set star orientation.

Link copied to clipboard
fun setStarRating(@FloatRange(from = 0.0, to = 1.0) starRating: Float)

Set star rating by starRating. If mStarRating is greater than mStarCountNumber, it will be set to mStarCountNumber.

Link copied to clipboard

Set the bitmap of the be selected star.

Set the bitmap of the be selected star by drawableId.

Link copied to clipboard
fun setStarSelectMethod(starSelectMethod: StarSelectMethod)

Set Star Select Method

Link copied to clipboard

Set the bitmap of the be unselected star.

Set the bitmap of the be unselected star by drawableId.