Coder Social home page Coder Social logo

potter777 / pluck Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hi-manshu/pluck

0.0 0.0 0.0 6.24 MB

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

Home Page: https://www.himanshoe.com

License: Apache License 2.0

Kotlin 100.00%

pluck's Introduction

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!

pluck's People

Contributors

hi-manshu avatar renovate[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.