Skip to content

Commit

Permalink
fix: stay in call screen after back button from fullscreen [WPB-640] (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Garzas authored Mar 19, 2024
1 parent 40e0afb commit 334db7b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,14 @@ private fun OngoingCallContent(
hideDoubleTapToast()
FullScreenTile(
selectedParticipant = selectedParticipantForFullScreen,
height = this@BoxWithConstraints.maxHeight - dimensions().spacing4x
) {
shouldOpenFullScreen = !shouldOpenFullScreen
}
height = this@BoxWithConstraints.maxHeight - dimensions().spacing4x,
closeFullScreen = {
shouldOpenFullScreen = !shouldOpenFullScreen
},
onBackButtonClicked = {
shouldOpenFullScreen = !shouldOpenFullScreen
}
)
} else {
VerticalCallingPager(
participants = participants,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package com.wire.android.ui.calling.ongoing.fullscreen

import androidx.activity.compose.BackHandler
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -50,10 +51,15 @@ fun FullScreenTile(
sharedCallingViewModel: SharedCallingViewModel = hiltViewModel(),
selectedParticipant: SelectedParticipant,
height: Dp,
onDoubleTap: (offset: Offset) -> Unit
closeFullScreen: (offset: Offset) -> Unit,
onBackButtonClicked: () -> Unit
) {
var shouldShowDoubleTapToast by remember { mutableStateOf(false) }

BackHandler {
onBackButtonClicked()
}

sharedCallingViewModel.callState.participants.find {
it.id == selectedParticipant.userId && it.clientId == selectedParticipant.clientId
}?.let {
Expand All @@ -64,7 +70,7 @@ fun FullScreenTile(
.clipToBounds()
.pointerInput(Unit) {
detectTapGestures(
onDoubleTap = onDoubleTap
onDoubleTap = closeFullScreen
)
}
.height(height)
Expand Down Expand Up @@ -114,6 +120,7 @@ fun PreviewFullScreenVideoCall() {
FullScreenTile(
selectedParticipant = SelectedParticipant(),
height = 100.dp,
onDoubleTap = { }
closeFullScreen = {},
onBackButtonClicked = {}
)
}

0 comments on commit 334db7b

Please sign in to comment.