show retry button after failed call
This commit is contained in:
parent
f7d1e02d4b
commit
00f273b0c0
|
@ -1,6 +1,7 @@
|
||||||
package eu.siacs.conversations.ui;
|
package eu.siacs.conversations.ui;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.res.ColorStateList;
|
||||||
import android.databinding.DataBindingUtil;
|
import android.databinding.DataBindingUtil;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -47,9 +48,6 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
;
|
;
|
||||||
Log.d(Config.LOGTAG, "RtpSessionActivity.onCreate()");
|
Log.d(Config.LOGTAG, "RtpSessionActivity.onCreate()");
|
||||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_rtp_session);
|
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
|
@Override
|
||||||
|
@ -166,14 +164,20 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
break;
|
break;
|
||||||
case DECLINED_OR_BUSY:
|
case DECLINED_OR_BUSY:
|
||||||
binding.status.setText(R.string.rtp_state_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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateButtonConfiguration(final RtpEndUserState state) {
|
private void updateButtonConfiguration(final RtpEndUserState state) {
|
||||||
if (state == RtpEndUserState.INCOMING_CALL) {
|
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.rejectCall.show();
|
||||||
this.binding.endCall.hide();
|
this.binding.endCall.hide();
|
||||||
|
this.binding.acceptCall.setOnClickListener(this::acceptCall);
|
||||||
|
this.binding.acceptCall.setImageResource(R.drawable.ic_call_white_48dp);
|
||||||
this.binding.acceptCall.show();
|
this.binding.acceptCall.show();
|
||||||
} else if (state == RtpEndUserState.ENDING_CALL) {
|
} else if (state == RtpEndUserState.ENDING_CALL) {
|
||||||
this.binding.rejectCall.hide();
|
this.binding.rejectCall.hide();
|
||||||
|
@ -181,19 +185,31 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
|
||||||
this.binding.acceptCall.hide();
|
this.binding.acceptCall.hide();
|
||||||
} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
|
} else if (state == RtpEndUserState.DECLINED_OR_BUSY) {
|
||||||
this.binding.rejectCall.hide();
|
this.binding.rejectCall.hide();
|
||||||
|
this.binding.endCall.setOnClickListener(this::exit);
|
||||||
this.binding.endCall.setImageResource(R.drawable.ic_clear_white_48dp);
|
this.binding.endCall.setImageResource(R.drawable.ic_clear_white_48dp);
|
||||||
this.binding.endCall.show();
|
this.binding.endCall.show();
|
||||||
this.binding.endCall.setOnClickListener(this::exit);
|
|
||||||
this.binding.acceptCall.hide();
|
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 {
|
} else {
|
||||||
this.binding.rejectCall.hide();
|
this.binding.rejectCall.hide();
|
||||||
|
this.binding.endCall.setOnClickListener(this::endCall);
|
||||||
this.binding.endCall.setImageResource(R.drawable.ic_call_end_white_48dp);
|
this.binding.endCall.setImageResource(R.drawable.ic_call_end_white_48dp);
|
||||||
this.binding.endCall.show();
|
this.binding.endCall.show();
|
||||||
this.binding.endCall.setOnClickListener(this::endCall);
|
|
||||||
this.binding.acceptCall.hide();
|
this.binding.acceptCall.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void retry(View view) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void exit(View view) {
|
private void exit(View view) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import org.webrtc.AudioTrack;
|
||||||
import org.webrtc.Camera1Capturer;
|
import org.webrtc.Camera1Capturer;
|
||||||
import org.webrtc.Camera1Enumerator;
|
import org.webrtc.Camera1Enumerator;
|
||||||
import org.webrtc.CameraVideoCapturer;
|
import org.webrtc.CameraVideoCapturer;
|
||||||
|
import org.webrtc.CandidatePairChangeEvent;
|
||||||
import org.webrtc.DataChannel;
|
import org.webrtc.DataChannel;
|
||||||
import org.webrtc.IceCandidate;
|
import org.webrtc.IceCandidate;
|
||||||
import org.webrtc.MediaConstraints;
|
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
|
@Override
|
||||||
public void onIceConnectionReceivingChange(boolean b) {
|
public void onIceConnectionReceivingChange(boolean b) {
|
||||||
|
|
||||||
|
|
BIN
src/main/res/drawable-hdpi/ic_replay_white_48dp.png
Normal file
BIN
src/main/res/drawable-hdpi/ic_replay_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 675 B |
BIN
src/main/res/drawable-mdpi/ic_replay_white_48dp.png
Normal file
BIN
src/main/res/drawable-mdpi/ic_replay_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 457 B |
BIN
src/main/res/drawable-xhdpi/ic_replay_white_48dp.png
Normal file
BIN
src/main/res/drawable-xhdpi/ic_replay_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 908 B |
BIN
src/main/res/drawable-xxhdpi/ic_replay_white_48dp.png
Normal file
BIN
src/main/res/drawable-xxhdpi/ic_replay_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
src/main/res/drawable-xxxhdpi/ic_replay_white_48dp.png
Normal file
BIN
src/main/res/drawable-xxxhdpi/ic_replay_white_48dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
|
@ -897,6 +897,7 @@
|
||||||
<string name="rtp_state_finding_device">Locating devices</string>
|
<string name="rtp_state_finding_device">Locating devices</string>
|
||||||
<string name="rtp_state_ringing">Ringing</string>
|
<string name="rtp_state_ringing">Ringing</string>
|
||||||
<string name="rtp_state_declined_or_busy">Busy</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">
|
<plurals name="view_users">
|
||||||
<item quantity="one">View %1$d Participant</item>
|
<item quantity="one">View %1$d Participant</item>
|
||||||
<item quantity="other">View %1$d Participants</item>
|
<item quantity="other">View %1$d Participants</item>
|
||||||
|
|
Loading…
Reference in a new issue