Skip to content

Commit 5b8c546

Browse files
committed
Release version 7.13.0
1 parent a8d1a71 commit 5b8c546

File tree

18 files changed

+329
-41
lines changed

18 files changed

+329
-41
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ android {
3434
minSdkVersion 21
3535
targetSdkVersion 34
3636
compileSdk(34)
37-
versionCode 16
38-
versionName "7.12.0"
37+
versionCode 17
38+
versionName "7.13.0"
3939
multiDexEnabled true
4040
buildConfigField "java.util.Date", "BUILD_TIME", "new java.util.Date(" + System.currentTimeMillis() + "L)"
4141
vectorDrawables.useSupportLibrary = true
@@ -203,7 +203,7 @@ dependencies {
203203
implementation project(':sdk:googletranslation')
204204
implementation project(path: ':call')
205205

206-
implementation 'com.mirrorfly.sdk:mirrorflysdk:7.12.4'
206+
implementation 'com.mirrorfly.sdk:mirrorflysdk:7.13.0'
207207

208208
//Socket - versions.gradle
209209
implementation 'com.github.nkzawa:socket.io-client:0.6.0'

app/src/main/java/com/contusfly/call/groupcall/CallExtention.kt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fun CallManager.isVideoCallUICanShow() = isVideoCall() && !isRemoteVideoMuted(ge
3131

3232
fun CallManager.isAudioCall() = getCallType() == CallType.AUDIO_CALL
3333

34+
fun CallManager.isCallAttended() = isCallAnswered() && !isCallConnected()
3435
fun CallManager.isCallNotConnected() = !isCallConnected() && !isCallAnswered()
3536

3637
fun CallManager.isLocalTileCanResize() =
@@ -68,7 +69,7 @@ fun CallManager.getCallConnectedStatus(context: Context): String {
6869
CallStatus.RECONNECTING -> context.getString(R.string.reconnecting)
6970
else -> {
7071
when (val remoteCallStatus = getCallStatus(getEndCallerJid())) {
71-
CallStatus.CALLING, CallStatus.RINGING, CallStatus.ON_HOLD,CallStatus.RECONNECTING -> remoteCallStatus
72+
CallStatus.CALLING, CallStatus.RINGING, CallStatus.ON_HOLD,CallStatus.RECONNECTING,CallStatus.CONNECTING -> remoteCallStatus
7273
else -> Constants.EMPTY_STRING
7374
}
7475
}
@@ -79,21 +80,25 @@ fun CallManager.getCallConnectedStatus(context: Context): String {
7980

8081
fun CallManager.getOutGoingCallStatus(context: Context): String {
8182
val localCallStatus = getCallStatus(getCurrentUserId())
82-
LogMessage.d(TAG, "${CallConstants.CALL_UI} ${CallConstants.JOIN_CALL} ${CallConstants.CALL_FLOW_TAG} getOutGoingCallStatus : $localCallStatus")
83+
LogMessage.d(TAG, "${CallConstants.CALL_UI} ${CallConstants.JOIN_CALL} getOutGoingCallStatus : $localCallStatus")
8384
return when {
8485
isCallTryingToConnect(localCallStatus) -> context.getString(R.string.trying_to_connect)
8586
isCallTimeOut(localCallStatus) -> context.getString(R.string.call_try_again_info)
86-
isCallConnecting(localCallStatus) -> CallStatus.RINGING
87+
isCallRinging(localCallStatus) -> CallStatus.RINGING
88+
isCallConnecting(localCallStatus) -> CallStatus.CONNECTING
8789
else -> localCallStatus
8890
}
8991
}
9092

93+
9194
fun CallManager.isReconnecting() = getCallStatus(getCurrentUserId()) == CallStatus.RECONNECTING
9295

9396
fun isCallTryingToConnect(callStatus: String) = callStatus.isEmpty()
94-
|| callStatus == CallStatus.DISCONNECTED || callStatus == CallStatus.CONNECTING
97+
|| callStatus == CallStatus.DISCONNECTED
98+
99+
fun isCallConnecting(callStatus: String) = callStatus == CallStatus.CONNECTING
95100

96-
fun isCallConnecting(callStatus: String) = callStatus == CallStatus.RINGING
101+
fun isCallRinging(callStatus: String) = callStatus == CallStatus.RINGING
97102

98103
fun isCallTimeOut(callStatus: String) =
99104
callStatus.isNotBlank() && (callStatus == CallStatus.CALL_TIME_OUT || callStatus == CallStatus.OUTGOING_CALL_TIME_OUT)

app/src/main/java/com/contusfly/call/groupcall/GroupCallActivity.kt

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ import com.mirrorflysdk.flycall.webrtc.WebRtcCallService.Companion.setupVideoCap
3939
import com.mirrorflysdk.flycall.webrtc.api.CallActionListener
4040
import com.mirrorflysdk.flycall.webrtc.api.CallEventsListener
4141
import com.mirrorflysdk.flycall.webrtc.api.CallManager
42+
import com.mirrorflysdk.flycall.webrtc.api.ConnectionQuality
43+
import com.mirrorflysdk.flycall.webrtc.api.ConnectionQualityListener
4244
import com.mirrorflysdk.flycommons.Features
4345
import com.mirrorflysdk.flycommons.LogMessage
4446
import com.mirrorflysdk.flycommons.exception.FlyException
@@ -225,6 +227,7 @@ class GroupCallActivity : BaseActivity(), View.OnClickListener, ActivityOnClickL
225227
//register for call events
226228
CallManager.setCallEventsListener(customCallEventsListener)
227229
CallManager.setupCallActionListener(customCallEventsListener)
230+
CallManager.setConnectionQualityListener(customCallEventsListener)
228231

229232
initClickListeners()
230233
setUpCallDataAndUI()
@@ -681,6 +684,7 @@ class GroupCallActivity : BaseActivity(), View.OnClickListener, ActivityOnClickL
681684
LogMessage.d(TAG, "$CALL_UI onDestroy called()")
682685
CallManager.removeCallEventsListener(customCallEventsListener)
683686
CallManager.removeCallActionListener(customCallEventsListener)
687+
CallManager.removeConnectionQualityListener(customCallEventsListener)
684688
CallUtils.setVideoViewInitialization(false)
685689
super.onDestroy()
686690
}
@@ -753,7 +757,7 @@ class GroupCallActivity : BaseActivity(), View.OnClickListener, ActivityOnClickL
753757
}
754758
}
755759

756-
private inner class CustomCallEventsListener : CallEventsListener,CallActionListener{
760+
private inner class CustomCallEventsListener : CallEventsListener,CallActionListener,ConnectionQualityListener{
757761
override fun onCallStatusUpdated(callStatus: String, userJid: String) {
758762
handleCallStatusMessages(callStatus, userJid)
759763
}
@@ -809,8 +813,8 @@ class GroupCallActivity : BaseActivity(), View.OnClickListener, ActivityOnClickL
809813
CallStatus.CONNECTED -> handleCallStatusConnected(userJid)
810814
CallStatus.DISCONNECTED -> disconnectCall(true, callEvent)
811815
CallStatus.CONNECTING -> {
812-
callViewHelper.updateStatusAdapter(userJid)
813-
setUpCallUI()
816+
if (CallManager.isCallAttended()) callViewHelper.updateCallStatus()
817+
else callViewHelper.updateStatusAdapter(userJid)
814818
}
815819
CallStatus.OUTGOING_CALL_TIME_OUT -> {
816820
LogMessage.d(TAG, "$CALL_UI $JOIN_CALL CALL_TIME_OUT userJid:${CallStatus.OUTGOING_CALL_TIME_OUT}")
@@ -843,13 +847,18 @@ class GroupCallActivity : BaseActivity(), View.OnClickListener, ActivityOnClickL
843847
CallStatus.ON_RESUME -> handleCallStatusResume(userJid)
844848
CallStatus.RECONNECTING, CallStatus.ON_HOLD -> {
845849
LogMessage.d(TAG, "$CALL_UI $JOIN_CALL #reconnecting userJid:$userJid")
846-
setUpCallUI()
847-
if(callEvent.equals(CallStatus.RECONNECTING,true)){
848-
CallUtils.clearPeakSpeakingUser(userJid)
849-
onUserStoppedSpeaking(userJid)
850-
durationHandler.postDelayed({checkAndUpdateStatusForUser(userJid)},1200)
850+
if (CallManager.isCallAttended()) {
851+
callViewHelper.updateCallStatus()
851852
}else{
852-
checkAndUpdateStatusForUser(userJid)
853+
checkAndDismissPoorConnection()
854+
setUpCallUI()
855+
if(callEvent.equals(CallStatus.RECONNECTING,true)){
856+
CallUtils.clearPeakSpeakingUser(userJid)
857+
onUserStoppedSpeaking(userJid)
858+
durationHandler.postDelayed({checkAndUpdateStatusForUser(userJid)},1200)
859+
}else{
860+
checkAndUpdateStatusForUser(userJid)
861+
}
853862
}
854863
}
855864

@@ -971,6 +980,13 @@ class GroupCallActivity : BaseActivity(), View.OnClickListener, ActivityOnClickL
971980
Toast.makeText(this@GroupCallActivity, errorMessage, Toast.LENGTH_SHORT).show()
972981
}
973982
}
983+
984+
override fun onQualityUpdated(quality: ConnectionQuality) {
985+
LogMessage.d(TAG, "$CALL_UI onQualityUpdated received quality:$quality isInPIPMode:${isInPIPMode()}")
986+
if(!isInPIPMode()){
987+
checkAndShowPoorConnection(quality)
988+
}
989+
}
974990
}
975991

976992

@@ -1278,4 +1294,46 @@ class GroupCallActivity : BaseActivity(), View.OnClickListener, ActivityOnClickL
12781294
com.contusfly.utils.LogMessage.d(TAG,"#fullscreen fullScreenNotificationPermission Launcher enabled!!")
12791295
}
12801296
}
1297+
1298+
private fun dismissPoorConnectionLayout() {
1299+
activityBinding.layoutCallOptions.layoutSlowNetwork.poorConnectionRoot.visibility =
1300+
View.GONE
1301+
callViewHelper.updatePoorConnectionLayout()
1302+
checkAndUpdateUiForPoorConnection()
1303+
}
1304+
1305+
private fun checkAndShowPoorConnection(connectionQuality: ConnectionQuality) {
1306+
LogMessage.d(
1307+
TAG,
1308+
"$CALL_UI #callconnectionquality checkAndShowPoorConnection connectionQuality: $connectionQuality"
1309+
)
1310+
if(connectionQuality == ConnectionQuality.POOR){
1311+
activityBinding.layoutCallOptions.layoutSlowNetwork.poorConnectionRoot.visibility =
1312+
View.VISIBLE
1313+
activityBinding.layoutCallOptions.layoutSlowNetwork.closeSnack.setOnClickListener(1000) {
1314+
dismissPoorConnectionLayout()
1315+
}
1316+
callViewHelper.updatePoorConnectionLayout()
1317+
activityBinding.layoutCallOptions.layoutSlowNetwork.poorConnectionRoot.postDelayed({
1318+
dismissPoorConnectionLayout()
1319+
}, 5000)
1320+
}else{
1321+
checkAndUpdateUiForPoorConnection()
1322+
}
1323+
1324+
}
1325+
1326+
private fun checkAndUpdateUiForPoorConnection() {
1327+
callViewHelper.updateUiForCallConnectionQuality()
1328+
}
1329+
1330+
private fun checkAndDismissPoorConnection(){
1331+
if(activityBinding.layoutCallOptions.layoutSlowNetwork.poorConnectionRoot.visibility == View.VISIBLE){
1332+
LogMessage.d(
1333+
TAG,
1334+
"$CALL_UI #callconnectionquality checkAndDismissPoorConnection"
1335+
)
1336+
dismissPoorConnectionLayout()
1337+
}
1338+
}
12811339
}

app/src/main/java/com/contusfly/call/groupcall/GroupCallGridAdapter.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import android.content.Context
55
import android.graphics.drawable.Drawable
66
import android.os.Bundle
77
import android.view.LayoutInflater
8+
import android.view.View
89
import android.view.ViewGroup
910
import android.widget.ImageView
1011
import androidx.core.content.ContextCompat
@@ -32,6 +33,7 @@ import com.jakewharton.rxbinding3.view.clicks
3233
import com.mirrorflysdk.flycall.webrtc.CallStatus
3334
import com.mirrorflysdk.flycall.webrtc.TextureViewRenderer
3435
import com.mirrorflysdk.flycall.webrtc.api.CallManager
36+
import com.mirrorflysdk.flycall.webrtc.api.ConnectionQuality
3537
import com.mirrorflysdk.flycommons.LogMessage
3638
import com.mirrorflysdk.utils.ChatUtils
3739
import com.mirrorflysdk.utils.Utils
@@ -92,6 +94,7 @@ class GroupCallGridAdapter(val context: Context) : RecyclerView.Adapter<GroupCal
9294
updateGridConnectionStatus(holder, position)
9395
updateGridPinnedPosition(holder, position)
9496
updateUserSpeaking(holder, position, CallUtils.getUserSpeakingLevel(gridCallUserList[position]))
97+
updatePoorNetworkIndicator(holder,position)
9598

9699
holder.binding.rootLayout.clicks().throttleFirst(500, TimeUnit.MILLISECONDS).subscribe {
97100
onTapOnRecyclerView()
@@ -312,6 +315,10 @@ class GroupCallGridAdapter(val context: Context) : RecyclerView.Adapter<GroupCal
312315
CallActions.NOTIFY_USER_PROFILE -> {
313316
setUserInfo(holder, position)
314317
}
318+
319+
CallActions.NOTIFY_USER_POOR_CONNECTION -> {
320+
updatePoorNetworkIndicator(holder,position)
321+
}
315322
}
316323
}
317324
}
@@ -478,6 +485,14 @@ class GroupCallGridAdapter(val context: Context) : RecyclerView.Adapter<GroupCal
478485
return gridCallUserList.size
479486
}
480487

488+
private fun updatePoorNetworkIndicator(holder: CallUserGridViewHolder, position: Int){
489+
if(CallManager.getCallConnectionQuality()== ConnectionQuality.POOR && gridCallUserList[position] == CallManager.getCurrentUserId() && !CallManager.getCallStatus(CallManager.getCurrentUserId()).equals(CallStatus.RECONNECTING)){
490+
holder.binding.imageGridPoorNetworkIndicator.visibility = View.VISIBLE
491+
}else{
492+
holder.binding.imageGridPoorNetworkIndicator.visibility = View.GONE
493+
}
494+
}
495+
481496
inner class CallUserGridViewHolder(val binding: CallGridUserItemBinding) : BaseViewHolder(binding.root)
482497

483498
companion object {

app/src/main/java/com/contusfly/call/groupcall/GroupCallListAdapter.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.content.Context
44
import android.graphics.drawable.Drawable
55
import android.os.Bundle
66
import android.view.LayoutInflater
7+
import android.view.View
78
import android.view.ViewGroup
89
import android.widget.ImageView
910
import androidx.core.content.ContextCompat
@@ -32,6 +33,7 @@ import com.jakewharton.rxbinding3.view.clicks
3233
import com.mirrorflysdk.flycall.webrtc.CallStatus
3334
import com.mirrorflysdk.flycall.webrtc.TextureViewRenderer
3435
import com.mirrorflysdk.flycall.webrtc.api.CallManager
36+
import com.mirrorflysdk.flycall.webrtc.api.ConnectionQuality
3537
import com.mirrorflysdk.flycommons.LogMessage
3638
import com.mirrorflysdk.utils.ChatUtils
3739
import com.mirrorflysdk.utils.Utils
@@ -110,6 +112,7 @@ class GroupCallListAdapter(val context: Context) :
110112
updateConnectionStatus(holder, position)
111113
updateListPinnedPosition(holder, position)
112114
updateUserSpeaking(holder, position, CallUtils.getUserSpeakingLevel(callUserList[position]))
115+
updatePoorNetworkIndicator(holder,position)
113116

114117
holder.binding.rootLayout.clicks().throttleFirst(500, TimeUnit.MILLISECONDS).subscribe {
115118
onTapOnRecyclerView()
@@ -392,6 +395,10 @@ class GroupCallListAdapter(val context: Context) :
392395
CallActions.NOTIFY_USER_PROFILE -> {
393396
setUserInfo(holder, position)
394397
}
398+
399+
CallActions.NOTIFY_USER_POOR_CONNECTION -> {
400+
updatePoorNetworkIndicator(holder,position)
401+
}
395402
}
396403
}
397404
}
@@ -592,6 +599,14 @@ class GroupCallListAdapter(val context: Context) :
592599
setUpAudioMuted(holder, position)
593600
}
594601

602+
private fun updatePoorNetworkIndicator(holder: CallUserViewHolder, position: Int){
603+
if(CallManager.getCallConnectionQuality()== ConnectionQuality.POOR && callUserList[position] == CallManager.getCurrentUserId() && !CallManager.getCallStatus(CallManager.getCurrentUserId()).equals(CallStatus.RECONNECTING)){
604+
holder.binding.imagePoorNetworkIndicatorList.visibility = View.VISIBLE
605+
}else{
606+
holder.binding.imagePoorNetworkIndicatorList.visibility = View.GONE
607+
}
608+
}
609+
595610
inner class CallUserViewHolder(val binding: CallUserItemBinding) : BaseViewHolder(binding.root)
596611

597612
companion object {

app/src/main/java/com/contusfly/call/groupcall/helpers/BaseCallViewHelper.kt

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class BaseCallViewHelper(
219219
}
220220

221221
fun updateCallStatus() {
222-
if (CallManager.isCallNotConnected())
222+
if (CallManager.isCallNotConnected() || CallManager.isCallAttended())
223223
callNotConnectedViewHelper.updateCallStatus()
224224
else {
225225
callConnectedViewHelper.updateCallStatus()
@@ -440,6 +440,11 @@ class BaseCallViewHelper(
440440
*/
441441
override fun onCallOptionsHidden() {
442442
LogMessage.d(TAG, "$CALL_UI callViewHelper onCallOptionsHidden()")
443+
444+
if(binding.layoutCallOptions.layoutSlowNetwork.poorConnectionRoot.visibility == View.VISIBLE){
445+
LogMessage.d(TAG, "$CALL_UI skip callViewHelper onCallOptionsHidden() poorConnectionRoot VISIBLE")
446+
return
447+
}
443448
val bottomMarginStart =
444449
binding.layoutCallOptions.layoutCallOptions.height // margin start value
445450
if (CallManager.isOneToOneCall()) {
@@ -556,6 +561,10 @@ class BaseCallViewHelper(
556561

557562
private fun showListViewAboveCallOptions() {
558563
LogMessage.d(TAG, "$CALL_UI callViewHelper showListViewAboveCallOptions()")
564+
LogMessage.i(
565+
TAG,
566+
"$CALL_UI #callconnectionquality showListViewAboveCallOptions()"
567+
)
559568
val bottomMarginTo =
560569
binding.layoutCallOptions.layoutCallOptions.height // where to animate to
561570
val layoutMargin = CommonUtils.convertDpToPixel(activity, 10) // margin value
@@ -977,7 +986,7 @@ class BaseCallViewHelper(
977986
} else {
978987
LogMessage.i(
979988
TAG,
980-
"$CALL_UI callViewHelper resizeLocalTile skip one to one call tile update"
989+
"$CALL_UI #callconnectionquality callViewHelper resizeLocalTile skip one to one call tile update getIsListViewAnimated:${CallUtils.getIsListViewAnimated()}"
981990
)
982991
if (!CallUtils.getIsListViewAnimated())
983992
animateListViewWithCallOptions()
@@ -995,9 +1004,9 @@ class BaseCallViewHelper(
9951004
if (!CallUtils.getIsGridViewEnabled() && CallManager.isCallConnected())
9961005
binding.layoutCallOptions.layoutCallOptions.post {
9971006
CallUtils.setIsListViewAnimated(true)
998-
if (binding.layoutCallOptions.layoutCallOptions.visibility == View.VISIBLE) {
1007+
if (binding.layoutCallOptions.layoutCallOptions.visibility == View.VISIBLE ) {
9991008
val layoutMargin = CommonUtils.convertDpToPixel(activity, 20)
1000-
if (layoutMargin >= binding.layoutCallConnected.callUsersRecyclerview.marginBottom)
1009+
if (layoutMargin >= binding.layoutCallConnected.callUsersRecyclerview.marginBottom || CallUtils.getIsFromPoorInternetUpdate())
10011010
showListViewAboveCallOptions()
10021011
} else
10031012
showListViewAtBottom()
@@ -1095,4 +1104,14 @@ class BaseCallViewHelper(
10951104
fun updateFeatureActions() {
10961105
callConnectedViewHelper.checkAddParticipantsAvailable()
10971106
}
1107+
1108+
fun updatePoorConnectionLayout(){
1109+
showCallOptions()
1110+
CallUtils.setIsFromPoorInternetUpdate(true)
1111+
CallUtils.setIsListViewAnimated(false)
1112+
resizeLocalTile()
1113+
}
1114+
fun updateUiForCallConnectionQuality(){
1115+
callConnectedViewHelper.checkAndShowPoorConnectionQuality()
1116+
}
10981117
}

0 commit comments

Comments
 (0)