show retry button after failed call

This commit is contained in:
Daniel Gultsch 2020-04-08 13:30:12 +02:00
parent f7d1e02d4b
commit 00f273b0c0
8 changed files with 29 additions and 5 deletions

View File

@ -1,6 +1,7 @@
package eu.siacs.conversations.ui;
import android.content.Intent;
import android.content.res.ColorStateList;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.util.Log;
@ -47,9 +48,6 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
;
Log.d(Config.LOGTAG, "RtpSessionActivity.onCreate()");
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_rtp_session);
this.binding.rejectCall.setOnClickListener(this::rejectCall);
this.binding.endCall.setOnClickListener(this::endCall);
this.binding.acceptCall.setOnClickListener(this::acceptCall);
}
@Override
@ -166,14 +164,20 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
break;
case DECLINED_OR_BUSY:
binding.status.setText(R.string.rtp_state_declined_or_busy);
case CONNECTIVITY_ERROR:
binding.status.setText(R.string.rtp_state_connectivity_error);
break;
}
}
private void updateButtonConfiguration(final RtpEndUserState state) {
if (state == RtpEndUserState.INCOMING_CALL) {
this.binding.rejectCall.setOnClickListener(this::rejectCall);
this.binding.rejectCall.setImageResource(R.drawable.ic_call_end_white_48dp);
this.binding.rejectCall.show();
this.binding.endCall.hide();
this.binding.acceptCall.setOnClickListener(this::acceptCall);
this.binding.acceptCall.setImageResource(R.drawable.ic_call_white_48dp);
this.binding.acceptCall.show();
} else if (state == RtpEndUserState.ENDING_CALL) {
this.binding.rejectCall.hide();
@ -181,19 +185,31 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
this.binding.acceptCall.hide();
} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
this.binding.rejectCall.hide();
this.binding.endCall.setOnClickListener(this::exit);
this.binding.endCall.setImageResource(R.drawable.ic_clear_white_48dp);
this.binding.endCall.show();
this.binding.endCall.setOnClickListener(this::exit);
this.binding.acceptCall.hide();
} else if (state == RtpEndUserState.CONNECTIVITY_ERROR) {
this.binding.rejectCall.setOnClickListener(this::exit);
this.binding.rejectCall.setImageResource(R.drawable.ic_clear_white_48dp);
this.binding.rejectCall.show();
this.binding.endCall.hide();
this.binding.acceptCall.setOnClickListener(this::retry);
this.binding.acceptCall.setImageResource(R.drawable.ic_replay_white_48dp);
this.binding.acceptCall.show();
} else {
this.binding.rejectCall.hide();
this.binding.endCall.setOnClickListener(this::endCall);
this.binding.endCall.setImageResource(R.drawable.ic_call_end_white_48dp);
this.binding.endCall.show();
this.binding.endCall.setOnClickListener(this::endCall);
this.binding.acceptCall.hide();
}
}
private void retry(View view) {
}
private void exit(View view) {
finish();
}

View File

@ -14,6 +14,7 @@ import org.webrtc.AudioTrack;
import org.webrtc.Camera1Capturer;
import org.webrtc.Camera1Enumerator;
import org.webrtc.CameraVideoCapturer;
import org.webrtc.CandidatePairChangeEvent;
import org.webrtc.DataChannel;
import org.webrtc.IceCandidate;
import org.webrtc.MediaConstraints;
@ -58,6 +59,12 @@ public class WebRTCWrapper {
}
@Override
public void onSelectedCandidatePairChanged(CandidatePairChangeEvent event) {
Log.d(Config.LOGTAG, "remote candidate selected: " + event.remote);
Log.d(Config.LOGTAG, "local candidate selected: " + event.local);
}
@Override
public void onIceConnectionReceivingChange(boolean b) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -897,6 +897,7 @@
<string name="rtp_state_finding_device">Locating devices</string>
<string name="rtp_state_ringing">Ringing</string>
<string name="rtp_state_declined_or_busy">Busy</string>
<string name="rtp_state_connectivity_error">Unable to connect call</string>
<plurals name="view_users">
<item quantity="one">View %1$d Participant</item>
<item quantity="other">View %1$d Participants</item>