Package org.dexcare.dal.exts

Functions

displayToast
Link copied to clipboard
fun Context.displayToast(text: String)
An extension function that can be used to display a simple toast message to the user.
getNetworkLinkBandwidthKbps
Link copied to clipboard
fun Context.getNetworkLinkBandwidthKbps(): Pair<Int, Int>
Gets the current mobile network link's bandwidth.
getWiFiLinkBandwidthKbps
Link copied to clipboard
fun Context.getWiFiLinkBandwidthKbps(): Int
Gets the current wifi network link's bandwidth.
isConnectedToMobileNetwork
Link copied to clipboard
fun Context.isConnectedToMobileNetwork(): Boolean
Check if the device is connected to mobile data, vs.
observeOnMain
Link copied to clipboard
fun Completable.observeOnMain(): Completable
fun <T : Any> Flowable<T>.observeOnMain(): Flowable<T>
fun <T : Any> Observable<T>.observeOnMain(): Observable<T>
fun <T : Any> Single<T>.observeOnMain(): Single<T>
readFromRaw
Link copied to clipboard
fun Context.readFromRaw(@RawRes() rawID: Int): String
An extension function for reading files in the Raw resource folder and converting them to a string
retryWithDelay
Link copied to clipboard
fun Completable.retryWithDelay(retryAttempts: Int = 2, retryDelayMS: Long = 1000L): Completable
fun <T : Any> Flowable<T>.retryWithDelay(retryAttempts: Int = 2, retryDelayMS: Long = 1000L): Flowable<T>
fun <T : Any> Single<T>.retryWithDelay(retryAttempts: Int = 2, retryDelayMS: Long = 1000L): Single<T>
showMaterialDialog
Link copied to clipboard
fun Context.showMaterialDialog(title: String? = null, message: String? = null, positiveButtonText: String? = null, positiveButtonCallback: () -> Unit = {}, negativeButtonText: String? = null, negativeButtonCallback: () -> Unit = {}, isCancelable: Boolean = true)
An extension function that can be used to display a material dialog to the user.
subscribeForDataObs
Link copied to clipboard
fun Completable.subscribeForDataObs(): DataObserver<Unit>
Provides an extension function for generating a dataObserver for your data class
fun <T : Any> Observable<T>.subscribeForDataObs(): DataObserver<T>
Provides an extension function for generating a dataObserver for your data class
fun <T : Any> Single<T>.subscribeForDataObs(): DataObserver<T>
Provides an extension function for generating a dataObserver for your data class
subscribeOnIO
Link copied to clipboard
fun Completable.subscribeOnIO(): Completable
fun <T : Any> Flowable<T>.subscribeOnIO(): Flowable<T>
fun <T : Any> Observable<T>.subscribeOnIO(): Observable<T>
fun <T : Any> Single<T>.subscribeOnIO(): Single<T>