From 00f273b0c058f8701fe271edb555cdb786d4802d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 8 Apr 2020 13:30:12 +0200 Subject: [PATCH] show retry button after failed call --- .../conversations/ui/RtpSessionActivity.java | 26 ++++++++++++++---- .../xmpp/jingle/WebRTCWrapper.java | 7 +++++ .../drawable-hdpi/ic_replay_white_48dp.png | Bin 0 -> 675 bytes .../drawable-mdpi/ic_replay_white_48dp.png | Bin 0 -> 457 bytes .../drawable-xhdpi/ic_replay_white_48dp.png | Bin 0 -> 908 bytes .../drawable-xxhdpi/ic_replay_white_48dp.png | Bin 0 -> 1390 bytes .../drawable-xxxhdpi/ic_replay_white_48dp.png | Bin 0 -> 1885 bytes src/main/res/values/strings.xml | 1 + 8 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 src/main/res/drawable-hdpi/ic_replay_white_48dp.png create mode 100644 src/main/res/drawable-mdpi/ic_replay_white_48dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_replay_white_48dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_replay_white_48dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_replay_white_48dp.png diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index 1aef98afc..7c4024fe0 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -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(); } diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java index f7d79771e..f8e7947b7 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java @@ -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) { diff --git a/src/main/res/drawable-hdpi/ic_replay_white_48dp.png b/src/main/res/drawable-hdpi/ic_replay_white_48dp.png new file mode 100644 index 0000000000000000000000000000000000000000..fcddcf02ddb58ee1680889e7315757d76419b4b2 GIT binary patch literal 675 zcmV;U0$lxxP)i^4O#T$_9m82|5VvpF*wP4OP zM$UZi@^>7mIp;Yu=T~<=&tBi0Ip_J;@t6l6eCkO56W1~dg3&=h1q zQ;-2oK?XDh8PF7DKvR$bO+kjAeDJ~pr|dFMzEwenMqRT?w%I|3a4PK3rz1$XY>?9M z$o%dYv=53msmx64U;8dHjIzKUk9_ChB>7>S;1G`>C)ufEh%>(Om`-|fb*SR^#z4}` zk1=8_ANv5(l+5L85*Xb37G?llB;BT5>A(ui94pbtcshM*TjCYGR_ z-6MNIjB5B%pCT4Cy!N|@y;y<{>^_Y1h{sr_j%UPd_@F#~6P7u_$u$?{J9LdWv<^B( zTt-`dtRg&yta3*15X;emvQ!XfRzVjCmrT?J+75nB>W0d9%nhW=(93#VAeC5$p_bT;=ksFy7&G{R+*d}}W7vaE1LouAaX zWSLB>FM)fQW1AE1DN&FTt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?^)IpJQ zC~$)oVryJ;_A*F;awzhBRG;YTz@uDdxXb~P?psnaT;V0<;<@!m_9(Wo#9CP45&fK^ zm0dKDWCIB{)4(oTIZZ#0Sz#>{I2`q70$a!<#VdblmKEeqBTtav5BJ6{FUU`l0m9~* z`?oM!L%nU}35z-RnM+)dA!%+A1~=V*R#Jl8+0QtYYudtsG%831sUQ`k wf>e+SQb8(6qk>eB3Q|ETNCl}N6{IobUk;_uiK)$-$N&HU07*qoM6N<$g8NE^b^rhX literal 0 HcmV?d00001 diff --git a/src/main/res/drawable-xxxhdpi/ic_replay_white_48dp.png b/src/main/res/drawable-xxxhdpi/ic_replay_white_48dp.png new file mode 100644 index 0000000000000000000000000000000000000000..04cbde9af1926410c77e666492a8c5407d938f2b GIT binary patch literal 1885 zcmV-j2cr0iP)G0000LhNkl?*|(>Q-}x=BZLQ4&YpE&mJ&MS+o(x;tb+l&fx65xW;&^oP6*;;qZ`277j0&B;g2y13QyVxcB2x=EDkM`q92JwP7LF>&R0l^@ zWU7IqT37j=K`wEM_jsFaJi{v5DanN4NXjtpvz;}}lo=0>dN|9gbkZzyEgbbU#4aA8 zQRXK&((omlnJeIN0diU~(n^z$bb4~{H3$n7c`99eROtxQ(2;K-J9 ztWdGw$ePz^QIX)tno}%Rk>JRh5uQ|$;K-g=Xi#zB$etcrRU9~~)5H{JvygjP&5P`! zk0Gk{A=6bHII5uQP@;q9+0P)AJIgE;2abwqTr_YWuQNbpF3_&xz)>Lu(9CLjC==fW zW~n%ER78=mfZdD{*IA~kIB--zkujGyxI#Srw5m98#HLv2;281r(4gYL5tCw~#8Z4l z99=3B9I>bZ+{!z|u}(#TBL-E7XBj1`5f-UPa73nxaTn)^>JwU2Bsd~c6_`pNQEgYT z;D|(3p_Ri#Q|2KR3yug>B^v1_n$Ngd#eyS9Rii{V(fmV2gCjsSKqH5V;xfNi(cth> zP0&goQ5;b5;P6n5(8hV9SgGQ{F)q~%cQZ=Z2^A5Jaj1rPo+utw5#hKY)fD>(>sK-1 zxB=A^Q}~*&2UScsuA>^`X~KF{R5*S^HAad55K?BIiVDXyRC9DNM#xJlE*!t21h9jU zFPNm_!to0wfVqqj^00~w$Ip}qx(Rtp#fIZYN(2ij<2OK)iVepPln{CeS*fDKffB+R zLb_ydN(e0s;&(s}pO7bHl0ySS_;tx7i39i@lSvXU;5R6fB<>_+woGy; zF^pfQOp@rwZ@o;C=*Dl0Op@4$-(Hy{u@=80GD%`7ekWy;Lqo1 zGD)HtzcHnatN1l3$7sfHOljkL{H7?!Xv1$rX=4z-*~&5I;P;2zgmqK_?+S${7w4vO-xwGeh{5S)d$Y5oP=aXi|2ti;#aRN7zHiPGt#?5Hd!) za)S9>C8SeXLL*-i@`iGPorGLslCp)(gj`{RC89@{O zCW=w!Df`$;G`lG&11PbFXf`Pin9Mn%*-fKTMiYC8=2Kdf53C@n!?Y?z+`_+zrpyD% z4_+gxKH8KLrttw$btzA1;WSa5=WeBdd-$BFKBigu!eT~ zNgVr_qB>zJ?-Ivqp|mlQH7yW3uv%>6|65F}hix8e$Q97$dI#F-`f$EG`gVnO@e=qAJnCIu24M zzVpn~#6UY2sLUWcxSs}9fJrRlO$MpVdFE*1U>0Yo+zyvz!kWGch&c!DmDF+?1L9Az7iGef3Um`x|^ z*}`6qaFUA*Fv1vPjPNZNImr?BvW4|@a+{1X#u#IaF~%5Uj4{R-V~jDz7-NhvCN=*D X>#M$jzV5xv00000NkvXXu0mjfXY*@a literal 0 HcmV?d00001 diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 0a1d6f78c..487ee434b 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -897,6 +897,7 @@ Locating devices Ringing Busy + Unable to connect call View %1$d Participant View %1$d Participants