Pluck – The image-picker library for Compose

Pluck

This is an image-picker for your jetpack compose project. You can select from Gallery/Camera.

Made with ❤️ for Android Developers by Himanshu

Maven Central
Github Followers
Twitter Follow

Implementation

Step: 01

Add the specific permission in AndroidManifest.xml file

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.CAMERA" />

Step: 02

In build.gradle of app module, include the following dependency

dependencies {
  implementation("com.himanshoe:pluck:1.0.0-alpha01")
}

Usage

01

Now, to start using Pluck, use the composable Pluck like,

Pluck(onPhotoSelected = {
    // List of PluckImage when selecting from Gallery             
}, onPhotoClicked = {
    // Bitmap when using Camera
})

02

Now, if you want Pluck to handle the Permission for you as well. Use it like,

Permission(
    permissions = listOf(
        Manifest.permission.CAMERA,
        Manifest.permission.READ_EXTERNAL_STORAGE
    ),
    goToAppSettings = {
        // Go to App Settings
    }
) {
    Pluck(onPhotoSelected = {
        // List of PluckImage when selecting from Gallery             
    }, onPhotoClicked = {
        // Bitmap when using Camera
    })
}

Drop a ⭐ to keep me motivated to keep working on Open-Source. Updates coming Soon!

GitHub

View Github