Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/razaghimahdi/imageswitch
A library to give you Switch with image background + UI Sample by Jetpack Compose
https://github.com/razaghimahdi/imageswitch
andorid checkbox compose jetpack jetpack-compose kotlin switch ui ui-components ui-design
Last synced: about 1 month ago
JSON representation
A library to give you Switch with image background + UI Sample by Jetpack Compose
- Host: GitHub
- URL: https://github.com/razaghimahdi/imageswitch
- Owner: razaghimahdi
- License: apache-2.0
- Created: 2023-03-18T20:34:04.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-30T06:00:30.000Z (over 1 year ago)
- Last Synced: 2024-11-08T18:52:35.203Z (3 months ago)
- Topics: andorid, checkbox, compose, jetpack, jetpack-compose, kotlin, switch, ui, ui-components, ui-design
- Language: Kotlin
- Homepage: https://github.com/razaghimahdi/ImageSwitch
- Size: 465 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# ImageSwitch
A library to give you Switch with image background + UI Sample by Jetpack Compose
## Give a Star! ⭐
If you like or are using this project to learn or start your solution, please give it a star. Thanks![![](https://jitpack.io/v/razaghimahdi/ImageSwitch.svg)](https://jitpack.io/#razaghimahdi/ImageSwitch)
### Step 1. Add it in your project-level `build.gradle` or `settings.gradle` file:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}### Step 2. Add the dependency
dependencies {
implementation 'com.github.razaghimahdi:ImageSwitch:1.0.0'
}### Step 3. How to use
```kotlin
val checkedState = remember { mutableStateOf(true) }ImageSwitch(
checkedImage = painterResource(R.drawable.good_morning),
unCheckedImage = painterResource(R.drawable.good_night),
size = 150.dp,
checked = checkedState.value,
onCheckedChange = { checkedState.value = it }
)
```https://user-images.githubusercontent.com/61207818/226142337-db631f05-9f8e-40a0-8c54-da3f533de99d.mp4
Developed by Mahdi Razzaghi Ghaleh