From 8421d46cd78b434d5df2c584d9a8f27139171067 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 6 Dec 2021 21:53:34 +0100 Subject: [PATCH] Use `observeViewEvents` facility --- .../vector/app/features/call/VectorCallActivity.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt b/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt index 2406cbc625..995dc3d5e8 100644 --- a/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt +++ b/vector/src/main/java/im/vector/app/features/call/VectorCallActivity.kt @@ -35,7 +35,6 @@ import androidx.core.content.ContextCompat import androidx.core.content.getSystemService import androidx.core.view.isInvisible import androidx.core.view.isVisible -import androidx.lifecycle.lifecycleScope import com.airbnb.mvrx.Fail import com.airbnb.mvrx.Mavericks import com.airbnb.mvrx.viewModel @@ -62,8 +61,6 @@ import im.vector.app.features.home.room.detail.RoomDetailActivity import im.vector.app.features.home.room.detail.RoomDetailArgs import io.github.hyuwah.draggableviewlib.DraggableView import io.github.hyuwah.draggableviewlib.setupDraggable -import kotlinx.coroutines.flow.launchIn -import kotlinx.coroutines.flow.onEach import kotlinx.parcelize.Parcelize import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.logger.LoggerTag @@ -142,12 +139,9 @@ class VectorCallActivity : VectorBaseActivity(), CallContro } } - callViewModel.viewEvents - .stream() - .onEach { - handleViewEvents(it) - } - .launchIn(lifecycleScope) + callViewModel.observeViewEvents { + handleViewEvents(it) + } callViewModel.onEach(VectorCallViewState::callId, VectorCallViewState::isVideoCall) { _, isVideoCall -> if (isVideoCall) {