Android Library that helps to easily integrate image choose option. It shows camera and gallery option.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}dependencies {
compile 'com.github.NileshJarad:ImagePicker:v1.0.2'
} <application
...>
<provider
android:name="android.support.v4.content.FileProvider"
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>ImagePicker.build(new DialogConfiguration()
.setTitle("Choose")
.setOptionOrientation(LinearLayoutCompat.HORIZONTAL),
new ImageResultListener() {
@Override
public void onImageResult(ImageResult imageResult) {
ivImage.setImageBitmap(imageResult.getBitmap());
}
}).show(getSupportFragmentManager());ImagePicker.build(new DialogConfiguration()
, new ImageResultListener() {
@Override
public void onImageResult(ImageResult imageResult) {
ivImage.setImageBitmap(imageResult.getBitmap());
}
}).show(getSupportFragmentManager()); ImagePicker.build(new DialogConfiguration()
.setTitle("Choose")
.setOptionOrientation(LinearLayoutCompat.HORIZONTAL), new ImageResultListener() {
@Override
public void onImageResult(ImageResult imageResult) {
ivImage.setImageBitmap(imageResult.getBitmap());
}
}).show(getChildFragmentManager());You can get Image Uri , path and Bitmap from ImageResult object in callback.