Fix call controls flickering when starting a video call.

Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
Alex Hart
2026-02-23 11:00:32 -04:00
committed by Cody Henthorne
parent cf862af3ca
commit 4d6cacdb3d
3 changed files with 14 additions and 1 deletions

View File

@@ -216,6 +216,16 @@ data class CallControlsState(
val startCallButtonText: Int = R.string.WebRtcCallView__start_call,
val displayEndCallButton: Boolean = false
) {
val hasAnyControls: Boolean
get() = displayAudioOutputToggle ||
displayVideoToggle ||
displayMicToggle ||
displayGroupRingingToggle ||
displayAdditionalActions ||
displayStartCallButton ||
displayEndCallButton
companion object {
/**
* Presentation-level method to build out the controls state from legacy objects.

View File

@@ -180,11 +180,12 @@ fun CallScreen(
val maxOffset = maxHeight - maxSheetHeight
var peekHeight by remember { mutableFloatStateOf(88f) }
val effectivePeekHeight = if (callControlsState.hasAnyControls) peekHeight else 0f
BottomSheetScaffold(
scaffoldState = callScreenController.scaffoldState,
sheetDragHandle = null,
sheetPeekHeight = peekHeight.dp,
sheetPeekHeight = effectivePeekHeight.dp,
sheetContainerColor = SignalTheme.colors.colorSurface1,
containerColor = Color.Black,
sheetMaxWidth = CallScreenMetrics.SheetMaxWidth,

View File

@@ -22,6 +22,7 @@ import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
@@ -174,6 +175,7 @@ class WebRtcCallViewModel : ViewModel() {
0
}
}
.onStart { emit(0) }
return combine(
callParticipantsState,