Git Product home page Git Product logo

android-image-picker's Introduction

ImagePicker

A simple Instagram like library to select images from the gallery and camera.

Screenshot

Usage

For full example, please refer to the sample app.

Add this to your project's build.gradle

allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}

And add this to your module's build.gradle

dependencies {
    implementation 'com.github.akvelon.android-image-picker:imagepicker:x.y.z'
    // If you have a problem with Glide, please use the same Glide version or simply open an issue
    implementation 'com.github.bumptech.glide:glide:4.11.0โ€™
}

change x.y.z to version in the release page

Start image picker activity

The simplest way to start

ImagePicker.launch(this); // Activity or Fragment

If you already have selected images

ImagePicker.launchWithPreselectedImages(
this, // Activity or Fragment
 alreadySelectedImages // list of already selected files
);

Receive result

  @Override
    protected void onActivityResult(int requestCode, final int resultCode, Intent data) {
        if (ImagePicker.shouldResolve(requestCode, resultCode)) {
            // Get a list of picked images
            List<File> images = ImagePicker.getImages(data);
            // or get a single image only
            File image = ImagePicker.getSingleImageOrNull(data);
        }
        super.onActivityResult(requestCode, resultCode, data);
    }

AndroidX

As version 1.0.0 above, we already use AndroidX artifact in our library. If you have any trouble adding this version to your current project, please add this to your gradle.properties :

android.useAndroidX=true
android.enableJetifier=true

Or simply create an issue

android-image-picker's People

Contributors

rustemmuzafarov avatar mrshakirov 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.