Fix improper glare handling.

This commit is contained in:
Cody Henthorne
2021-11-03 13:07:16 -04:00
committed by Greyson Parrelli
parent 09dd2583b9
commit 49270e677e
10 changed files with 67 additions and 89 deletions

View File

@@ -116,6 +116,7 @@ public class WebRtcCallView extends ConstraintLayout {
private View foldParticipantCountWrapper;
private TextView foldParticipantCount;
private AvatarImageView largeHeaderAvatar;
private ConstraintSet largeHeaderConstraints;
private ConstraintSet smallHeaderConstraints;
private Guideline statusBarGuideline;
private View fullScreenShade;
@@ -293,6 +294,9 @@ public class WebRtcCallView extends ConstraintLayout {
rotatableControls.add(smallLocalRender.findViewById(R.id.call_participant_mic_muted));
rotatableControls.add(ringToggle);
largeHeaderConstraints = new ConstraintSet();
largeHeaderConstraints.clone(getContext(), R.layout.webrtc_call_view_header_large);
smallHeaderConstraints = new ConstraintSet();
smallHeaderConstraints.clone(getContext(), R.layout.webrtc_call_view_header_small);
}
@@ -689,6 +693,7 @@ public class WebRtcCallView extends ConstraintLayout {
if (!visibleViewSet.equals(lastVisibleSet) ||
!controls.isFadeOutEnabled() ||
(webRtcControls.showSmallHeader() && largeHeaderAvatar.getVisibility() == View.VISIBLE) ||
(!webRtcControls.showSmallHeader() && largeHeaderAvatar.getVisibility() == View.GONE) ||
forceUpdate)
{
@@ -930,6 +935,8 @@ public class WebRtcCallView extends ConstraintLayout {
if (showSmallHeader) {
smallHeaderConstraints.applyTo(toolbar);
} else {
largeHeaderConstraints.applyTo(toolbar);
}
}

View File

@@ -343,6 +343,9 @@ public class WebRtcCallViewModel extends ViewModel {
case CALL_DISCONNECTED:
callState = WebRtcControls.CallState.ENDING;
break;
case CALL_DISCONNECTED_GLARE:
callState = WebRtcControls.CallState.INCOMING;
break;
case NETWORK_FAILURE:
callState = WebRtcControls.CallState.ERROR;
break;