From 522f193f771ddf4cb182c42009691ce68903b83c Mon Sep 17 00:00:00 2001 From: Oussama Hassine Date: Fri, 29 Sep 2023 16:10:33 +0200 Subject: [PATCH 1/2] chore: use the new CameraPreviewBuilder to get CameraPreview --- .../android/ui/calling/common/CallVideoPreview.kt | 9 ++++++--- .../ongoing/participantsview/ParticipantTile.kt | 11 ++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/common/CallVideoPreview.kt b/app/src/main/kotlin/com/wire/android/ui/calling/common/CallVideoPreview.kt index 66fc455efe8..e25ba328af1 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/common/CallVideoPreview.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/common/CallVideoPreview.kt @@ -25,9 +25,10 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.viewinterop.AndroidView -import com.waz.avs.VideoPreview +import com.waz.avs.CameraPreviewBuilder @Composable fun CallVideoPreview( @@ -37,11 +38,13 @@ fun CallVideoPreview( ) { if (isCameraOn) { Box { + val context = LocalContext.current AndroidView( modifier = Modifier.fillMaxSize(), factory = { - val videoPreview = VideoPreview(it) - videoPreview.setShouldFill(true) + val videoPreview = CameraPreviewBuilder(context) + .shouldFill(true) + .build() onVideoPreviewCreated(videoPreview) videoPreview } diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt index 043e97630be..8380100303f 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt @@ -68,7 +68,7 @@ import androidx.constraintlayout.compose.ConstraintLayout import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver import androidx.lifecycle.LifecycleOwner -import com.waz.avs.VideoPreview +import com.waz.avs.CameraPreviewBuilder import com.waz.avs.VideoRenderer import com.wire.android.R import com.wire.android.model.UserAvatarData @@ -214,11 +214,12 @@ private fun CameraPreview( ) { if (isCameraOn) { val context = LocalContext.current + val backgroundColor = colorsScheme().callingParticipantTileBackgroundColor.value.toInt() val videoPreview = remember { - VideoPreview(context).apply { - layoutParams = FrameLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT) - setShouldFill(false) - } + CameraPreviewBuilder(context) + .setBackgroundColor(backgroundColor) + .shouldFill(false) + .build() } AndroidView( factory = { From 8f42a097e149b9adc1e95809448c7f52063bb57a Mon Sep 17 00:00:00 2001 From: Oussama Hassine Date: Fri, 29 Sep 2023 16:42:40 +0200 Subject: [PATCH 2/2] chore: update kalium reference --- kalium | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kalium b/kalium index 91c2b37c5b8..a79402cba15 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 91c2b37c5b86662f875e91aebf60f799baf7dfac +Subproject commit a79402cba1502482301703597720153b17134ce7