From 3b7e52061bf51a66adfb2b1049831627274e6c1b Mon Sep 17 00:00:00 2001 From: Oussama Hassine Date: Fri, 22 Sep 2023 17:48:17 +0200 Subject: [PATCH] chore: revert changes of #2246 --- .../ongoing/participantsview/ParticipantTile.kt | 10 ++++++---- .../ongoing/participantsview/ParticipantsTiles.kt | 12 ++---------- .../participantsview/gridview/CallingGridView.kt | 2 +- .../horizentalview/CallingHorizontalView.kt | 2 +- 4 files changed, 10 insertions(+), 16 deletions(-) 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 a27fa7f1a7c..043e97630be 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 @@ -96,7 +96,8 @@ fun ParticipantTile( onSelfUserVideoPreviewCreated: (view: View) -> Unit, onClearSelfUserVideoPreview: () -> Unit ) { - val alpha = if (participantTitleState.hasEstablishedAudio) ContentAlpha.high else ContentAlpha.medium + val alpha = + if (participantTitleState.hasEstablishedAudio) ContentAlpha.high else ContentAlpha.medium Surface( modifier = modifier, color = colorsScheme().callingParticipantTileBackgroundColor, @@ -220,9 +221,9 @@ private fun CameraPreview( } } AndroidView( - factory = { videoPreview }, - update = { + factory = { onSelfUserVideoPreviewCreated(videoPreview) + videoPreview } ) } else { @@ -245,7 +246,8 @@ private fun OthersVideoRenderer( var offsetY by remember { mutableStateOf(0f) } val context = LocalContext.current - val rendererFillColor = (colorsScheme().callingParticipantTileBackgroundColor.value shr 32).toLong() + val rendererFillColor = + (colorsScheme().callingParticipantTileBackgroundColor.value shr 32).toLong() if (isCameraOn || isSharingScreen) { val videoRenderer = remember { diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantsTiles.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantsTiles.kt index adc282c94e4..e54dd168fa3 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantsTiles.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantsTiles.kt @@ -103,11 +103,7 @@ fun VerticalCallingPager( isSelfUserMuted = isSelfUserMuted, isSelfUserCameraOn = isSelfUserCameraOn, contentHeight = contentHeight, - onSelfVideoPreviewCreated = { - if (pagerState.currentPage == 0) { - onSelfVideoPreviewCreated(it) - } - }, + onSelfVideoPreviewCreated = onSelfVideoPreviewCreated, onSelfClearVideoPreview = onSelfClearVideoPreview, onDoubleTap = onDoubleTap ) @@ -118,11 +114,7 @@ fun VerticalCallingPager( isSelfUserMuted = isSelfUserMuted, isSelfUserCameraOn = isSelfUserCameraOn, contentHeight = contentHeight, - onSelfVideoPreviewCreated = { - if (pagerState.currentPage == 0) { - onSelfVideoPreviewCreated(it) - } - }, + onSelfVideoPreviewCreated = onSelfVideoPreviewCreated, onSelfClearVideoPreview = onSelfClearVideoPreview, onDoubleTap = onDoubleTap ) diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/gridview/CallingGridView.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/gridview/CallingGridView.kt index cf1f5a1d098..ae939b6ac83 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/gridview/CallingGridView.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/gridview/CallingGridView.kt @@ -98,7 +98,7 @@ fun GroupCallGrid( ParticipantTile( modifier = Modifier - .pointerInput(isSelfUserCameraOn, isSelfUserMuted) { + .pointerInput(Unit) { detectTapGestures( onDoubleTap = { onDoubleTap( diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/horizentalview/CallingHorizontalView.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/horizentalview/CallingHorizontalView.kt index 3f3ba87cc6d..c852670920c 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/horizentalview/CallingHorizontalView.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/horizentalview/CallingHorizontalView.kt @@ -80,7 +80,7 @@ fun CallingHorizontalView( ParticipantTile( modifier = Modifier - .pointerInput(isSelfUserCameraOn, isSelfUserMuted) { + .pointerInput(Unit) { detectTapGestures( onDoubleTap = { onDoubleTap(