Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/a914-gowtham/compose-ratingbar
ratingbar composable for jetpack compose :rocket::star2:
https://github.com/a914-gowtham/compose-ratingbar
android-jetpack compose-rating-bar jetpack jetpack-components jetpack-compose jetpack-compose-ratingbar jetpack-ratingbar rating-bar rating-bar-compose ratingbar ratingbar-compose
Last synced: 3 months ago
JSON representation
ratingbar composable for jetpack compose :rocket::star2:
- Host: GitHub
- URL: https://github.com/a914-gowtham/compose-ratingbar
- Owner: a914-gowtham
- License: mit
- Created: 2021-04-03T06:23:00.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T19:50:13.000Z (9 months ago)
- Last Synced: 2024-08-01T00:41:50.765Z (6 months ago)
- Topics: android-jetpack, compose-rating-bar, jetpack, jetpack-components, jetpack-compose, jetpack-compose-ratingbar, jetpack-ratingbar, rating-bar, rating-bar-compose, ratingbar, ratingbar-compose
- Language: Kotlin
- Homepage:
- Size: 3.6 MB
- Stars: 227
- Watchers: 1
- Forks: 20
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jetpack-compose-awesome - compose-ratingbar - Ratingbar for Jetpack Compose. (Libraries / UI)
- jetpack-compose-awesome - compose-ratingbar - Ratingbar for Jetpack Compose. (Libraries / UI)
README
# Compose-Ratingbar
A ratingbar for jetpack compose[![](https://jitpack.io/v/a914-gowtham/compose-ratingbar.svg)](https://jitpack.io/#a914-gowtham/compose-ratingbar)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.a914-gowtham/compose-ratingbar.svg?label=mavenCentral)](https://search.maven.org/artifact/io.github.a914-gowtham/compose-ratingbar/1.1.0/aar)
[![](https://jitpack.io/v/a914-gowtham/compose-ratingbar/month.svg)](https://jitpack.io/#a914-gowtham/compose-ratingbar)Download
--------
Add in project build.gradle:```gradle
repositories {
maven { url 'https://jitpack.io' }
}// App build.gradle
dependencies {
implementation 'com.github.a914-gowtham:compose-ratingbar:1.3.12'
//mavenCentral
// implementation 'io.github.a914-gowtham:compose-ratingbar:1.2.3'}
```## Usage
```kotlin
import androidx.compose.runtime.*var rating: Float by remember { mutableStateOf(3.2f) }
RatingBar(
value = rating,
style = RatingBarStyle.Fill(),
onValueChange = {
rating = it
},
onRatingChanged = {
Log.d("TAG", "onRatingChanged: $it")
}
)
```#### Other optional params:
```kotlin
fun RatingBar(
value: Float,
modifier: Modifier = Modifier,
numOfStars: Int = 5,
size: Dp = 32.dp,
spaceBetween: Dp = 6.dp,
isIndicator: Boolean = false,
stepSize: StepSize = StepSize.ONE,
hideInactiveStars: Boolean = false,
style: RatingBarStyle,
onValueChange: (Float) -> Unit,
onRatingChanged: (Float) -> Unit
)
```## More Customization✨
Icon can be changed using ```painterEmpty``` ```painterFilled``` params.
```kotlin
RatingBar(
value = rating,
painterEmpty = painterResource(id = R.drawable.icon_empty),
painterFilled = painterResource(id = R.drawable.icon_filled),
onValueChange = {
rating = it
},
onRatingChanged = {
Log.d("TAG", "onRatingChanged: $it")
}
)
```
## Library Info
* Forked from [compose-rating-bar](https://github.com/jsachica/compose-rating-bar)
* Current version of the library only supports Stepsize 1f and 0.5f when click or drag. However, Initial Rating value could be any float value like 3.8 etc.## Show some ❤ and support
Give a ⭐️ if this project helped you!