All Projects → saran2020 → DragRating

saran2020 / DragRating

Licence: other
Easy to use Drag Rating with customisation with custom assets

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to DragRating

Gaiasky
Mirror of Gaia Sky repository hosted on Gitlab: https://gitlab.com/langurmonkey/gaiasky
Stars: ✭ 162 (+671.43%)
Mutual labels:  stars
jquery-google-reviews
simple jquery Plugin that utilizes Google API to get data from a Place on Google Maps
Stars: ✭ 33 (+57.14%)
Mutual labels:  stars
spacehunter
❤🍳 Space Hunter is a PWA (Progressive Web App) in which the user can have access to information regarding the universe.
Stars: ✭ 15 (-28.57%)
Mutual labels:  stars
Astral
Organize Your GitHub Stars With Ease
Stars: ✭ 2,695 (+12733.33%)
Mutual labels:  stars
React Sortable Hoc
A set of higher-order components to turn any list into an animated, accessible and touch-friendly sortable list✌️
Stars: ✭ 9,747 (+46314.29%)
Mutual labels:  dragging
sort-awesome-lists
Sorts awesome lists by number of stars in each GitHub repository
Stars: ✭ 56 (+166.67%)
Mutual labels:  stars
Ngx Bar Rating
Angular Bar Rating
Stars: ✭ 146 (+595.24%)
Mutual labels:  stars
planisphere
Make your own cardboard model planisphere
Stars: ✭ 28 (+33.33%)
Mutual labels:  stars
astrolabe
Make your own cardboard model astrolabe
Stars: ✭ 32 (+52.38%)
Mutual labels:  stars
fullstackDevelopment
Material & Projects related to full stack development
Stars: ✭ 90 (+328.57%)
Mutual labels:  stars
Stellarium
Stellarium is a free GPL software which renders realistic skies in real time with OpenGL. It is available for Linux/Unix, Windows and macOS. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.
Stars: ✭ 3,010 (+14233.33%)
Mutual labels:  stars
Dragula
👌 Drag and drop so simple it hurts
Stars: ✭ 21,011 (+99952.38%)
Mutual labels:  dragging
starclass
Stellar Classification
Stars: ✭ 15 (-28.57%)
Mutual labels:  stars
Go Web Framework Stars
⭐ Web frameworks for Go, most starred on GitHub
Stars: ✭ 2,394 (+11300%)
Mutual labels:  stars
v-drag
The simplest way to integrate dragging on Vue.js
Stars: ✭ 71 (+238.1%)
Mutual labels:  dragging
Celerite
Scalable 1D Gaussian Processes in C++, Python, and Julia
Stars: ✭ 155 (+638.1%)
Mutual labels:  stars
export-github-stars
View / Sort / Export your Starred repositories.
Stars: ✭ 124 (+490.48%)
Mutual labels:  stars
crystal-web-framework-stars
⭐️ Web frameworks for Crystal, most starred on Github
Stars: ✭ 40 (+90.48%)
Mutual labels:  stars
compose-ratingbar
A ratingbar composable for jetpack compose 🚀🌟
Stars: ✭ 89 (+323.81%)
Mutual labels:  ratingbar
average-rating
Calculate average score and rating based on Wilson Score Equation
Stars: ✭ 28 (+33.33%)
Mutual labels:  rating-stars

Drag Rating

Drag rating is a rating view inspired of Drag Review from Book My Show app. The purpose of this library is to create simple and easy to use Drag Rating Widget with support for custom assets.

Include this library by adding below line to the module level build.gradle

dependencies {
    implementation 'com.github.saran2020:DragRating:2.1.0'
}

layout.xml

<com.github.saran2020.dragrating.DragRatingView
    android:id="@+id/slide_rating"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:initial_rating="2.5"
    app:rating_space="8dp"
    app:max_rating="5" />

initial_rating - It's used to set the initial rating to the widget.
max_rating - It's used to set the maximum allowed rating. The number you provide here is the number of stars that will be drawn.
rating_space - It can be used to control the space between two star views.

Current rating can be read using getRating() and to set the rating use method setRating(3.5f).

To provide custom asset for the view, you need to set a Map with the multiplier for the asset and the asset like shown below.

Passing custom asset resource id

ratingView.setDrawableResourceAssetMap(
    mapOf(
        0f to R.drawable.ic_star_empty,
        0.5f to R.drawable.ic_star_half,
        1f to R.drawable.ic_star_full
    )
)

Passing asset as Drawable in kotlin

ratingView.setDrawableAssetMap(
    mapOf(
        0f to emptyRating,
        0.5f to halfRating,
        1f to fullRating
    )
)

NOTE: You should only provide the multiplier between 0 and 1. If the current rating is 1.5 it will automatically fill one star with the asset mapped to 1f and one star with asset mapped to 0.5f

Callback when user is dragging the DragRatingView

ratingView.callback = object : DragRatingView.RatingChangeCallback {
    override fun onRatingChange(previous: Float, new: Float) {
        Log.d(TAG, "previous rating = $previous new rating = $current")
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].