This file contains 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
import rx.Observable | |
import rx.Observable.Transformer | |
import rx.Subscription | |
import rx.android.schedulers.AndroidSchedulers.mainThread | |
import rx.schedulers.Schedulers.io | |
/** | |
* Shorthand to set [subscribeOn] and [observeOn] thread for observables | |
*/ | |
fun <T> Observable<T>.composeForIoTasks(): Observable<T> = compose<T>(Transformer { |
This file contains 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
package ***.***.android.utils; | |
import android.Manifest; | |
import android.app.Activity; | |
import android.app.Fragment; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.support.v13.app.FragmentCompat; | |
import android.support.v4.app.ActivityCompat; | |
import android.support.v4.content.ContextCompat; |