Created
February 25, 2020 20:22
-
-
Save lordcodes/0090ef42c8260e89327f04fca876c9a8 to your computer and use it in GitHub Desktop.
Code for the article: "Uploading a file with progress in Kotlin"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploader.uploadAttachment(request.filename, request.file, request.mimeType) | |
.subscribeOn(appRxSchedulers.io) | |
.observeOn(appRxSchedulers.main) | |
.subscribeBy( | |
onError = { error -> | |
// Display error alert | |
}, | |
onComplete = { | |
// Display completed Snackbar | |
}, | |
onNext = { progress -> | |
// Update progress bar | |
} | |
) | |
.addTo(disposeBag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment