WebRTC call: fix pip showing

This commit is contained in:
ganfra 2021-07-13 19:03:21 +02:00
parent 94981d5f37
commit 0da8a46311
2 changed files with 9 additions and 9 deletions

View File

@ -232,7 +232,6 @@ class VectorCallActivity : VectorBaseActivity<ActivityCallBinding>(), CallContro
private fun renderFullScreenMode(state: VectorCallViewState) {
views.callToolbar.isVisible = true
views.callControlsView.isVisible = true
views.pipRendererWrapper.isVisible = true
views.callControlsView.updateForState(state)
val callState = state.callState.invoke()
views.callActionText.setOnClickListener(null)
@ -243,13 +242,13 @@ class VectorCallActivity : VectorBaseActivity<ActivityCallBinding>(), CallContro
is CallState.CreateOffer,
is CallState.LocalRinging,
is CallState.Dialing -> {
views.callVideoGroup.isInvisible = true
views.callVideoGroup.isVisible = false
views.callInfoGroup.isVisible = true
views.callToolbar.setSubtitle(R.string.call_ringing)
configureCallInfo(state)
}
is CallState.Answering -> {
views.callVideoGroup.isInvisible = true
views.callVideoGroup.isVisible = false
views.callInfoGroup.isVisible = true
views.callToolbar.setSubtitle(R.string.call_connecting)
configureCallInfo(state)
@ -259,7 +258,7 @@ class VectorCallActivity : VectorBaseActivity<ActivityCallBinding>(), CallContro
if (callState.iceConnectionState == MxPeerConnectionState.CONNECTED) {
if (state.isLocalOnHold || state.isRemoteOnHold) {
views.smallIsHeldIcon.isVisible = true
views.callVideoGroup.isInvisible = true
views.callVideoGroup.isVisible = false
views.callInfoGroup.isVisible = true
configureCallInfo(state, blurAvatar = true)
if (state.isRemoteOnHold) {
@ -290,13 +289,13 @@ class VectorCallActivity : VectorBaseActivity<ActivityCallBinding>(), CallContro
views.callInfoGroup.isVisible = false
views.pipRenderer.isVisible = !state.isVideoCaptureInError && state.otherKnownCallInfo == null
} else {
views.callVideoGroup.isInvisible = true
views.callVideoGroup.isVisible = false
views.callInfoGroup.isVisible = true
}
}
} else {
// This state is not final, if you change network, new candidates will be sent
views.callVideoGroup.isInvisible = true
views.callVideoGroup.isVisible = false
views.callInfoGroup.isVisible = true
configureCallInfo(state)
views.callToolbar.setSubtitle(R.string.call_connecting)

View File

@ -36,6 +36,7 @@
app:cardCornerRadius="@dimen/call_pip_radius"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
app:layout_goneMarginEnd="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/callControlsView">
@ -71,16 +72,16 @@
android:id="@+id/otherKnownCallLayout"
android:layout_width="@dimen/call_pip_width"
android:layout_height="@dimen/call_pip_height"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:background="@color/element_background_light"
android:foreground="?attr/selectableItemBackground"
android:visibility="gone"
app:cardBackgroundColor="@color/bg_call_screen"
app:cardCornerRadius="@dimen/call_pip_radius"
app:cardElevation="4dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/callControlsView"
app:layout_constraintEnd_toStartOf="@id/pipRendererWrapper"
tools:visibility="visible">
<ImageView