Loading app/ui/legacy/src/main/java/com/fsck/k9/ui/FlowExtensions.kt +3 −3 Original line number Diff line number Diff line Loading @@ -5,13 +5,13 @@ import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.FlowCollector import kotlinx.coroutines.launch fun <T> Flow<T>.observe(lifecycleOwner: LifecycleOwner, action: suspend (T) -> Unit) { fun <T> Flow<T>.observe(lifecycleOwner: LifecycleOwner, collector: FlowCollector<T>) { lifecycleOwner.lifecycleScope.launch { lifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { collect(action) collect(collector) } } } build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ buildscript { versions = [ 'kotlin': '1.6.10', 'kotlinCoroutines': '1.5.2', 'kotlinCoroutines': '1.6.0', 'androidxAppCompat': '1.3.1', 'androidxActivity': '1.4.0', 'androidxRecyclerView': '1.2.1', Loading Loading
app/ui/legacy/src/main/java/com/fsck/k9/ui/FlowExtensions.kt +3 −3 Original line number Diff line number Diff line Loading @@ -5,13 +5,13 @@ import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.FlowCollector import kotlinx.coroutines.launch fun <T> Flow<T>.observe(lifecycleOwner: LifecycleOwner, action: suspend (T) -> Unit) { fun <T> Flow<T>.observe(lifecycleOwner: LifecycleOwner, collector: FlowCollector<T>) { lifecycleOwner.lifecycleScope.launch { lifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { collect(action) collect(collector) } } }
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ buildscript { versions = [ 'kotlin': '1.6.10', 'kotlinCoroutines': '1.5.2', 'kotlinCoroutines': '1.6.0', 'androidxAppCompat': '1.3.1', 'androidxActivity': '1.4.0', 'androidxRecyclerView': '1.2.1', Loading