Skip to content

Commit

Permalink
fixup! Implement new call screen UI/UX.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal committed May 4, 2020
1 parent 034db39 commit d5a005d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
Expand Up @@ -183,11 +183,22 @@ public void setAudioOutput(WebRtcAudioOutput output) {
}

public void setRemoteVideoEnabled(boolean isRemoteVideoEnabled) {
boolean wasRemoteVideoEnabled = remoteRenderContainer.getVisibility() == View.VISIBLE;

shouldFadeControls = isRemoteVideoEnabled;

if (isRemoteVideoEnabled) {
remoteRenderContainer.setVisibility(View.VISIBLE);
} else {
remoteRenderContainer.setVisibility(View.GONE);
}

if (shouldFadeControls && !wasRemoteVideoEnabled) {
fadeInControls();
} else if (!shouldFadeControls && wasRemoteVideoEnabled) {
fadeOutControls();
cancelFadeOut();
}
}

public void setLocalRenderer(@Nullable SurfaceViewRenderer surfaceViewRenderer) {
Expand Down Expand Up @@ -266,9 +277,6 @@ public void setStatus(@NonNull String status) {
}

public void setWebRtcControls(WebRtcControls webRtcControls) {
boolean wasFadingControls = shouldFadeControls;

shouldFadeControls = false;
answerWithVoiceGroup.setVisibility(View.GONE);

switch (webRtcControls) {
Expand Down Expand Up @@ -298,21 +306,13 @@ public void setWebRtcControls(WebRtcControls webRtcControls) {
ongoingCallButtons.setVisibility(View.VISIBLE);
break;
case CONNECTED:
shouldFadeControls = true;
if (!wasFadingControls) {
setTopViewsVisibility(View.VISIBLE);
incomingCallButtons.setVisibility(View.GONE);
ongoingCallButtons.setVisibility(View.VISIBLE);

post(() -> {
scheduleFadeOut();
pictureInPictureGestureHelper.setVerticalBoundaries(status.getBottom(), speakerToggle.getTop());
});
}
}
setTopViewsVisibility(View.VISIBLE);
incomingCallButtons.setVisibility(View.GONE);
ongoingCallButtons.setVisibility(View.VISIBLE);

if (!shouldFadeControls) {
cancelFadeOut();
post(() -> {
pictureInPictureGestureHelper.setVerticalBoundaries(status.getBottom(), speakerToggle.getTop());
});
}
}

Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_phone_down_28.xml
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="28dp"
android:height="28dp"
android:viewportWidth="28"
android:viewportHeight="28">
<path
android:fillColor="@color/core_white"
android:pathData="M26.92,14c-0.17,-1 -0.73,-2.64 -3.62,-4A22.94,22.94 0,0 0,4.7 10c-2.89,1.39 -3.45,3 -3.62,4a4.92,4.92 0,0 0,0.23 2.61A2.2,2.2 0,0 0,3.79 18.1l4.12,-0.73a2.18,2.18 0,0 0,1.82 -2.22c0,-0.56 0,-0.93 -0.06,-1.4a1.12,1.12 0,0 1,0.9 -1.21,23.65 23.65,0 0,1 6.86,0 1.12,1.12 0,0 1,0.9 1.21c0,0.47 0,0.84 -0.06,1.4a2.18,2.18 0,0 0,1.82 2.22l4.12,0.73a2.2,2.2 0,0 0,2.48 -1.49A4.92,4.92 0,0 0,26.92 14Z"/>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/webrtc_call_screen_hangup.xml
Expand Up @@ -3,7 +3,7 @@
<item android:drawable="@drawable/webrtc_call_screen_circle_red" />
<item
android:bottom="14dp"
android:drawable="@drawable/phone_24dp"
android:drawable="@drawable/ic_phone_down_28"
android:left="14dp"
android:right="14dp"
android:top="14dp" />
Expand Down
Expand Up @@ -3,6 +3,7 @@
android:shape="rectangle">

<gradient android:type="linear"
android:angle="270"
android:startColor="@color/transparent_black_60" />

</shape>

0 comments on commit d5a005d

Please sign in to comment.