mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 20:18:36 +00:00
Allow users to select a compact tab bar.
This commit is contained in:
committed by
Cody Henthorne
parent
06f19aa6cd
commit
09cf8074aa
@@ -3,7 +3,11 @@
|
||||
package org.signal.core.util.concurrent
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import io.reactivex.rxjava3.core.Completable
|
||||
import io.reactivex.rxjava3.core.Flowable
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import io.reactivex.rxjava3.kotlin.subscribeBy
|
||||
import java.lang.RuntimeException
|
||||
|
||||
/**
|
||||
@@ -26,3 +30,15 @@ fun <T : Any> Single<T>.safeBlockingGet(): T {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun <T : Any> Flowable<T>.observe(viewLifecycleOwner: LifecycleOwner, onNext: (T) -> Unit) {
|
||||
val lifecycleDisposable = LifecycleDisposable()
|
||||
lifecycleDisposable.bindTo(viewLifecycleOwner)
|
||||
lifecycleDisposable += subscribeBy(onNext = onNext)
|
||||
}
|
||||
|
||||
fun Completable.observe(viewLifecycleOwner: LifecycleOwner, onComplete: () -> Unit) {
|
||||
val lifecycleDisposable = LifecycleDisposable()
|
||||
lifecycleDisposable.bindTo(viewLifecycleOwner)
|
||||
lifecycleDisposable += subscribeBy(onComplete = onComplete)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user