Fix calling error state display bugs.

This commit is contained in:
Cody Henthorne
2024-06-07 15:07:19 -04:00
committed by Alex Hart
parent baaad0e475
commit 143a61e312
4 changed files with 18 additions and 12 deletions

View File

@@ -1102,7 +1102,7 @@ public class WebRtcCallActivity extends BaseActivity implements SafetyNumberChan
@Override
public void toggleControls() {
WebRtcControls controlState = viewModel.getWebRtcControls().getValue();
if (controlState != null && !controlState.displayIncomingCallButtons()) {
if (controlState != null && !controlState.displayIncomingCallButtons() && !controlState.displayErrorControls()) {
controlsAndInfo.toggleControls();
}
}
@@ -1287,9 +1287,12 @@ public class WebRtcCallActivity extends BaseActivity implements SafetyNumberChan
@Override
public void onHidden() {
fullscreenHelper.hideSystemUI();
if (videoTooltip != null) {
videoTooltip.dismiss();
WebRtcControls controlState = viewModel.getWebRtcControls().getValue();
if (controlState == null || !controlState.displayErrorControls()) {
fullscreenHelper.hideSystemUI();
if (videoTooltip != null) {
videoTooltip.dismiss();
}
}
}
}

View File

@@ -458,12 +458,14 @@ public class WebRtcCallView extends InsetAwareConstraintLayout {
boolean isLandscapeEnabled = callParticipantsViewState.isLandscapeEnabled();
List<WebRtcCallParticipantsPage> pages = new ArrayList<>(2);
if (!state.getGridParticipants().isEmpty()) {
pages.add(WebRtcCallParticipantsPage.forMultipleParticipants(state.getGridParticipants(), state.getFocusedParticipant(), state.isInPipMode(), isPortrait, isLandscapeEnabled, state.getHideAvatar(), navBarBottomInset));
}
if (!state.getCallState().isErrorState()) {
if (!state.getGridParticipants().isEmpty()) {
pages.add(WebRtcCallParticipantsPage.forMultipleParticipants(state.getGridParticipants(), state.getFocusedParticipant(), state.isInPipMode(), isPortrait, isLandscapeEnabled, state.getHideAvatar(), navBarBottomInset));
}
if (state.getFocusedParticipant() != CallParticipant.EMPTY && state.getAllRemoteParticipants().size() > 1) {
pages.add(WebRtcCallParticipantsPage.forSingleParticipant(state.getFocusedParticipant(), state.isInPipMode(), isPortrait, isLandscapeEnabled));
if (state.getFocusedParticipant() != CallParticipant.EMPTY && state.getAllRemoteParticipants().size() > 1) {
pages.add(WebRtcCallParticipantsPage.forSingleParticipant(state.getFocusedParticipant(), state.isInPipMode(), isPortrait, isLandscapeEnabled));
}
}
if (state.getGroupCallState().isNotIdle()) {

View File

@@ -238,7 +238,7 @@ class ControlsAndInfoController(
private fun hide(delay: Long = 0L) {
if (delay == 0L) {
if (controlState.isFadeOutEnabled || controlState == WebRtcControls.PIP) {
if (controlState.isFadeOutEnabled || controlState == WebRtcControls.PIP || controlState.displayErrorControls()) {
behavior.isHideable = true
behavior.state = BottomSheetBehavior.STATE_HIDDEN
@@ -283,7 +283,7 @@ class ControlsAndInfoController(
}
private fun showOrHideControlsOnUpdate(previousState: WebRtcControls) {
if (controlState == WebRtcControls.PIP) {
if (controlState == WebRtcControls.PIP || controlState.displayErrorControls()) {
hide()
return
}

View File

@@ -1944,7 +1944,8 @@
<string name="RedPhone_ringing">Ringing…</string>
<string name="RedPhone_busy">Busy</string>
<string name="RedPhone_recipient_unavailable">Recipient unavailable</string>
<string name="RedPhone_network_failed">Network failed!</string>
<!-- Error message shown during a call when a fatal network error occurs. -->
<string name="RedPhone_network_failed">Network failed! Please check network connection and try again.</string>
<string name="RedPhone_number_not_registered">Number not registered!</string>
<string name="RedPhone_the_number_you_dialed_does_not_support_secure_voice">The number you dialed does not support secure voice!</string>
<string name="RedPhone_got_it">Got it</string>