mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-02 08:23:00 +01:00
Fix call controls flickering when starting a video call.
Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
committed by
Cody Henthorne
parent
cf862af3ca
commit
4d6cacdb3d
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user