Kige - is an image-picker for android written for Jetpack Compose. Its give you ability to choose image from your gallery. It uses Modal Bottom Sheet State which added in Jetpack Compose Material 3 1.2.0-alpha02
Project in develop!
Maded with ♥ by Kiko
First of all, you need to add jitpack repo (in project settings.gradle)
For Groovy:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
For Kotlin DSL:
repositories {
...
maven(url="https://jitpack.io")
}
And add library in build.gradle dependency
For Groovy:
implementation 'com.github.BadKiko:kige:version'
For Kotlin DSL:
implementation("com.github.BadKiko:kige:version")
Add to manifest
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
For get image-picker you can execute in @Composable function:
var image by remember { mutableStateOf<Painter?>(null) }
val rememberKigeState = rememberKigeState()
KigePicker(rememberKigeState) {
image = it
}
image?.let {
Image(
modifier = Modifier.fillMaxSize(),
painter = it,
contentDescription = "",
contentScale = ContentScale.FillBounds
)
}