Skip to content
This repository was archived by the owner on Mar 15, 2025. It is now read-only.
/ Pluck Public archive

Pluck, a library that helps you to pick image via Gallery/Camera built using Compose

License

Notifications You must be signed in to change notification settings

hi-manshu/Pluck

Folders and files

NameName
Last commit message
Last commit date
Feb 3, 2022
Jul 19, 2022
Feb 3, 2022
Jul 19, 2022
Feb 2, 2022
Jul 19, 2022
Feb 2, 2022
Feb 3, 2022
Jul 19, 2022
Feb 2, 2022
Feb 8, 2022
Feb 2, 2022
Feb 2, 2022
Feb 2, 2022
Aug 24, 2022
Feb 2, 2022

Repository files navigation

Pluck - The image-picker library for Compose

Pluck

This is an image-picker for your jetpack compose project. You can select from Gallery/Camera. This uses Material you and will be getting support for it in future as well.

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-RC2")
}

Usage

01

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

Pluck(onPhotoSelected = {
    // List of PluckImage when selecting from Gallery/Camera. When checking with Camera
    // It returns only one item in list
})

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/Camera. When checking with Camera
        // It returns only one item in list
    })
}

03

If you want to configure do you want to select single image or multiple image from gallery you need to edit the PluckConfiguration like,

    Pluck(
        pluckConfiguration = PluckConfiguration(multipleImagesAllowed = true),
        onPhotoSelected = { }
    )

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