RxJava wrapper for Android Gallery & Camera.
With RxGallery you get rid of Activity.onActivityResult() and receive the result on the call site. Also, no runtime permissions are required
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
};
Pick Multiple Audio Files
new RxGallery ()
.multipleAudio (fragmentActivity )
.subscribe (result -> {
// Handle logic here
};
Yo can request any type by
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
};
See 'app' module for the full code.