With RxGallery you get rid of Activity.onActivityResult() and receive the result on the call site. Also, no runtime permissions are required
- Easy-to-use APIs
- Results are delivered at the call site not at Activity.onActivityResult
- Handle all Camera and Gallery with the same APIs.
- Handle runtime permissions.
dependencies {
implementation 'com.sha.kamel:rx-gallery:1.0.0@aar'
}
repositories {
maven {
url "https://dl.bintray.com/shabankamel/android"
}
...
}
new RxGallery()
.captureImage(fragmentActivity)
.subscribe(bitmap -> imageView.setImageBitmap(bitmap));
new RxGallery()
.image(fragmentActivity)
.subscribe(result -> {
// Handle logic here
};
new RxGallery()
.multipleImages(fragmentActivity)
.subscribe(result -> {
// Handle logic here
};
new RxGallery()
.video(fragmentActivity)
.subscribe(result -> {
// Handle logic here
};
new RxGallery()
.multipleVideos(fragmentActivity)
.subscribe(result -> {
// Handle logic here
};
new RxGallery()
.audio(fragmentActivity, MimeType.VIDEO, MimeType.AUDIO)
.subscribe(result -> {
// Handle logic here
};
new RxGallery()
.multipleAudio(fragmentActivity)
.subscribe(result -> {
// Handle logic here
};
new RxGallery(fragmentActivity, MimeType.VIDEO, MimeType.AUDIO)
.requestByType()
.subscribe(result -> {
// Handle logic here
};
new RxGallery(fragmentActivity, MimeType.VIDEO, MimeType.AUDIO)
.requestMultipleByType()
.subscribe(result -> {
// Handle logic here
};