mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 02:08:40 +00:00
Fix unresponsiveness of calling screen when in landscape.
This commit is contained in:
committed by
Jeffrey Starke
parent
47508495ed
commit
7c7f2ff2aa
@@ -211,47 +211,27 @@ fun CallScreen(
|
||||
label = "animate-as-state"
|
||||
)
|
||||
|
||||
if (!isPortrait) {
|
||||
Viewport(
|
||||
localParticipant = localParticipant,
|
||||
localRenderState = localRenderState,
|
||||
webRtcCallState = webRtcCallState,
|
||||
callParticipantsPagerState = callParticipantsPagerState,
|
||||
overflowParticipants = overflowParticipants,
|
||||
scaffoldState = scaffoldState,
|
||||
callControlsState = callControlsState,
|
||||
callScreenState = callScreenState,
|
||||
onPipClick = onLocalPictureInPictureClicked,
|
||||
onControlsToggled = onControlsToggled,
|
||||
callScreenController = callScreenController
|
||||
)
|
||||
}
|
||||
Viewport(
|
||||
localParticipant = localParticipant,
|
||||
localRenderState = localRenderState,
|
||||
webRtcCallState = webRtcCallState,
|
||||
callParticipantsPagerState = callParticipantsPagerState,
|
||||
overflowParticipants = overflowParticipants,
|
||||
scaffoldState = scaffoldState,
|
||||
callControlsState = callControlsState,
|
||||
callScreenState = callScreenState,
|
||||
onPipClick = onLocalPictureInPictureClicked,
|
||||
onControlsToggled = onControlsToggled,
|
||||
callScreenController = callScreenController,
|
||||
modifier = if (isPortrait) {
|
||||
Modifier.padding(bottom = padding)
|
||||
} else Modifier
|
||||
)
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(bottom = padding)
|
||||
.fillMaxSize()
|
||||
) {
|
||||
if (isPortrait) {
|
||||
Viewport(
|
||||
localParticipant = localParticipant,
|
||||
localRenderState = localRenderState,
|
||||
webRtcCallState = webRtcCallState,
|
||||
callParticipantsPagerState = callParticipantsPagerState,
|
||||
overflowParticipants = overflowParticipants,
|
||||
scaffoldState = scaffoldState,
|
||||
callControlsState = callControlsState,
|
||||
callScreenState = callScreenState,
|
||||
onPipClick = onLocalPictureInPictureClicked,
|
||||
onControlsToggled = onControlsToggled,
|
||||
callScreenController = callScreenController
|
||||
)
|
||||
}
|
||||
|
||||
CallScreenReactionsContainer(
|
||||
reactions = reactions
|
||||
)
|
||||
}
|
||||
CallScreenReactionsContainer(
|
||||
reactions = reactions,
|
||||
modifier = Modifier.padding(bottom = padding)
|
||||
)
|
||||
|
||||
val onCallInfoClick: () -> Unit = {
|
||||
scope.launch {
|
||||
@@ -331,11 +311,13 @@ private fun BoxScope.Viewport(
|
||||
callScreenState: CallScreenState,
|
||||
callScreenController: CallScreenController,
|
||||
onPipClick: () -> Unit,
|
||||
onControlsToggled: (Boolean) -> Unit
|
||||
onControlsToggled: (Boolean) -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
if (webRtcCallState.isPreJoinOrNetworkUnavailable) {
|
||||
LargeLocalVideoRenderer(
|
||||
localParticipant = localParticipant
|
||||
localParticipant = localParticipant,
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
|
||||
@@ -353,7 +335,7 @@ private fun BoxScope.Viewport(
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
Row(modifier = modifier) {
|
||||
Column(
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
@@ -408,7 +390,8 @@ private fun BoxScope.Viewport(
|
||||
SmallMoveableLocalVideoRenderer(
|
||||
localParticipant = localParticipant,
|
||||
localRenderState = localRenderState,
|
||||
onClick = onPipClick
|
||||
onClick = onPipClick,
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -418,11 +401,12 @@ private fun BoxScope.Viewport(
|
||||
*/
|
||||
@Composable
|
||||
private fun LargeLocalVideoRenderer(
|
||||
localParticipant: CallParticipant
|
||||
localParticipant: CallParticipant,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
LocalParticipantRenderer(
|
||||
localParticipant = localParticipant,
|
||||
modifier = Modifier
|
||||
modifier = modifier
|
||||
.fillMaxSize()
|
||||
)
|
||||
}
|
||||
@@ -469,7 +453,8 @@ private fun TinyLocalVideoRenderer(
|
||||
private fun SmallMoveableLocalVideoRenderer(
|
||||
localParticipant: CallParticipant,
|
||||
localRenderState: WebRtcLocalRenderState,
|
||||
onClick: () -> Unit
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
val isPortrait = LocalConfiguration.current.orientation == Configuration.ORIENTATION_PORTRAIT
|
||||
|
||||
@@ -489,6 +474,7 @@ private fun SmallMoveableLocalVideoRenderer(
|
||||
contentSize = DpSize(targetWidth, targetHeight),
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.then(modifier)
|
||||
.padding(16.dp)
|
||||
.statusBarsPadding()
|
||||
) {
|
||||
|
||||
@@ -28,7 +28,8 @@ import org.thoughtcrime.securesms.events.GroupCallReactionEvent
|
||||
*/
|
||||
@Composable
|
||||
fun CallScreenReactionsContainer(
|
||||
reactions: List<GroupCallReactionEvent>
|
||||
reactions: List<GroupCallReactionEvent>,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
val adapter = remember { WebRtcReactionsRecyclerAdapter() }
|
||||
AndroidView(factory = {
|
||||
@@ -41,7 +42,7 @@ fun CallScreenReactionsContainer(
|
||||
view.isVerticalScrollBarEnabled = false
|
||||
|
||||
view
|
||||
}, modifier = Modifier.fillMaxSize().padding(16.dp).padding(bottom = 16.dp)) {
|
||||
}, modifier = modifier.fillMaxSize().padding(16.dp).padding(bottom = 16.dp)) {
|
||||
adapter.submitList(reactions.toMutableList())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user