Giter VIP home page Giter VIP logo

imagepicker's Introduction

Android Library that helps to easily integrate image choose option. It shows camera and gallery option. You can select Multiple images from gallery.

What's new in current version v1.0.10.

Now you can set multi-selection to gallery intent like below to select multiple images

    ImagePicker.build(new DialogConfiguration()
                .setTitle("Choose")
                .setResultImageDimension(1000, 1000)
                .setOptionOrientation(LinearLayoutCompat.HORIZONTAL), new ImageMultiResultListener() {
            @Override
            public void onImageResult(ArrayList<ImageResult> imageResult) {
                Log.e(LOG_TAG, "onImageResult:Number of image picked " + imageResult.size());
                if (imageResult.size() > 0) {
                    ivImage.setImageBitmap(imageResult.get(0).getBitmap());
                }
            }
        }).show(getChildFragmentManager());

1) Setup

1.1) Add it in your root(Project) build.gradle at the end of repositories

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

1.2) Add the dependency to you app build.gradle

dependencies {
	        compile 'com.github.NileshJarad:ImagePicker:v1.0.10'
	}

2) Implementation

2.1) Add below line to you manifest

 <application
       ...>

        <provider
            android:name="com.nj.imagepicker.provider.ImageProvider"
            android:authorities="${applicationId}.com.nj.imagepicker.fileprovider"
            tools:replace="android:authorities">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>
       ...
    </application>

2.2.1) Launch the option dialog from Activity

ImagePicker.build(new DialogConfiguration()
                .setTitle("Choose")
                .setOptionOrientation(LinearLayoutCompat.HORIZONTAL),
                 new ImageResultListener() {
                    @Override
                    public void onImageResult(ImageResult imageResult) {
                        ivImage.setImageBitmap(imageResult.getBitmap());
                    }
        }).show(getSupportFragmentManager());

or

ImagePicker.build(new DialogConfiguration()
                , new ImageResultListener() {
                    @Override
                    public void onImageResult(ImageResult imageResult) {
                        ivImage.setImageBitmap(imageResult.getBitmap());
                    }
                }).show(getSupportFragmentManager());

2.2.2) Launch the option dialog from Fragment

 ImagePicker.build(new DialogConfiguration()
                .setTitle("Choose")
                .setOptionOrientation(LinearLayoutCompat.HORIZONTAL), new ImageResultListener() {
            @Override
            public void onImageResult(ImageResult imageResult) {
                ivImage.setImageBitmap(imageResult.getBitmap());
            }
        }).show(getChildFragmentManager());

3) Full Configuration attributes

 DialogConfiguration configuration = new DialogConfiguration()
                .setTitle("Choose Options")
                .setOptionOrientation(LinearLayoutCompat.HORIZONTAL)
                .setBackgroundColor(Color.GRAY)
                .setNegativeText("No")
                .setResultImageDimension(200,200)
                .setNegativeTextColor(Color.WHITE)
                .setTitleTextColor(Color.WHITE);

4) Change log

1.0.7 (2018-01-15)

Implemented enhancements:

Resolved build error for build gradle plugin

1.0.6 (2018-01-15)

Implemented enhancements:

  1. Added multiple image selection from gallery option

1.0.5 (2017-11-10)

1.0.4 (2017-07-27)

1.0.3 (2017-03-01)

Implemented enhancements:

  1. Closed issue of image from Camera for devices running Android L (Lollipop)
  2. Added configurations for the setting background color, text color, dimension of result image
  3. Removed unused library #1

Merged pull requests:

Removed unused library #1(Sagar Gangawane)

Closed issues:

Closed issue Camera Image is not showing #2

Author's Portfolio

imagepicker's People

Contributors

nileshjarad avatar sagargang avatar

Watchers

James Cloos 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.