Skip to content

Commit

Permalink
improve usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
connyduck committed Mar 12, 2024
1 parent d27fde2 commit 8faaf24
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions sparkbutton-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Then add the dependency:
```kotlin
dependencies {
...
implementation("at.connyduck.sparkbutton:sparkbutton-compose:1.0.0")
implementation("at.connyduck.sparkbutton:sparkbutton-compose:<version>")
}
```

Expand All @@ -33,20 +33,17 @@ SparkButton(
onCheckedChange = { newValue ->
checked = newValue
},
modifier = Modifier
.padding(32.dp)
.size(32.dp)
.align(Alignment.CenterHorizontally)
modifier = Modifier.size(32.dp)
) {
if (checked) {
Image(
painterResource(R.drawable.ic_heart_filled),
stringResource(R.string.unlike)
Icon(
painter = painterResource(R.drawable.ic_heart_filled),
contentDescription = stringResource(R.string.unlike)
)
} else {
Image(
painterResource(R.drawable.ic_heart),
stringResource(R.string.like)
painter = painterResource(R.drawable.ic_heart),
contentDescription = stringResource(R.string.like)
)
}
}
Expand Down

0 comments on commit 8faaf24

Please sign in to comment.