Skip to content

Commit 8289bc8

Browse files
committed
V7.12.4 latest code all update
1 parent 1d53541 commit 8289bc8

File tree

56 files changed

+1039
-480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1039
-480
lines changed

app/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ android {
4646
buildTypes {
4747
debug {
4848
buildConfigField 'Boolean', 'IS_QA_BUILD', 'true'
49+
//buildConfigField 'String', 'SDK_BASE_URL', '"https://api-preprod-sandbox.mirrorfly.com/api/v1/"'
4950
buildConfigField 'String', 'LICENSE', '"Please enter your License key"'
5051
buildConfigField 'String', 'WEB_CHAT_LOGIN', '"https://webchat-preprod-sandbox.mirrorfly.com/"'
52+
//buildConfigField 'Boolean', 'IS_TRIAL_LICENSE', 'true'
5153
buildConfigField "String", "SUPPORT_MAIL", '"[email protected]"'
5254
resValue("string", "app_name", "UI Kit")
5355
shrinkResources false
@@ -57,11 +59,14 @@ android {
5759
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
5860
}
5961

62+
6063
release {
6164
initWith debug
6265
buildConfigField 'Boolean', 'IS_QA_BUILD', 'true'
66+
//buildConfigField 'String', 'SDK_BASE_URL', '"https://api-preprod-sandbox.mirrorfly.com/api/v1/"'
6367
buildConfigField 'String', 'LICENSE', '"Please enter your License key"'
6468
buildConfigField 'String', 'WEB_CHAT_LOGIN', '"https://webchat-preprod-sandbox.mirrorfly.com/"'
69+
//buildConfigField 'Boolean', 'IS_TRIAL_LICENSE', 'true'
6570
buildConfigField "String", "SUPPORT_MAIL", '"[email protected]"'
6671
resValue("string", "app_name", "UI Kit")
6772
shrinkResources false
@@ -202,7 +207,7 @@ dependencies {
202207
implementation project(':sdk:googletranslation')
203208
implementation project(path: ':call')
204209

205-
implementation 'com.mirrorfly.sdk:mirrorflysdk:7.12.0'
210+
implementation 'com.mirrorfly.sdk:mirrorflysdk:7.12.4'
206211

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

app/contus_internal_keystore.jks

2.26 KB
Binary file not shown.

app/keystore.jks

2.2 KB
Binary file not shown.

app/src/main/java/com/contusfly/activities/ChatActivity.kt

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
118118

119119
private var smartReply:String ?= null
120120

121-
private var forwardClickedPostition:Int = -1
121+
private var forwardClickedItem:ChatMessage?=null
122122

123123
private var selectedReportMessage = Constants.EMPTY_STRING
124124

@@ -286,7 +286,7 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
286286
) {
287287
removeUnReadMsgSeparatorOnMessageReceiver()
288288
loadNextData()
289-
playForgroundNotificationSound(this)
289+
playForegroundNotificationSound(this)
290290
}
291291
}
292292
}
@@ -544,14 +544,17 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
544544
}
545545

546546
private fun initChatAdapter() {
547-
chatAdapter = ChatAdapter(mainList, clickedMessages, chat.chatType, this, userJid)
547+
chatAdapter = ChatAdapter(mainList, clickedMessages, chat.chatType, this, userJid, listChats = listChats)
548548
chatAdapter.hasStableIds()
549549
listChats.setHasFixedSize(true)
550550
listChats.adapter = chatAdapter
551551
chatAdapter.setOnDownloadClickListener(this)
552552
val messageSwipeController = MessageSwipeController(this, object : MessageSwipeController.SwipeControllerActions {
553553
override fun showSwipeInReplyUI(position: Int) {
554-
if (profileDetails.isBlocked || profileDetails.isAdminBlocked)
554+
if (profileDetails.isBlocked || profileDetails.isAdminBlocked || (chatType == ChatType.TYPE_GROUP_CHAT && !parentViewModel.isGroupUserExist(
555+
chat.toUser,
556+
SharedPreferenceManager.getCurrentUserJid()
557+
)))
555558
return
556559
Handler(Looper.getMainLooper()).postDelayed({
557560
isReplyTagged = true
@@ -654,11 +657,21 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
654657
}
655658

656659
private fun highlightGivenMessage() {
657-
if (mainList.isNotEmpty()) {
658-
if (messageId.isNotEmpty() && messageId != unreadMessageTypeMessageId)
659-
highlightGivenMessageId(messageId)
660-
else
661-
listChats.scrollToPosition(mainList.size - 1)
660+
try {
661+
if (mainList.isNotEmpty()) {
662+
if (messageId.isNotEmpty() && messageId != unreadMessageTypeMessageId)
663+
highlightGivenMessageId(messageId)
664+
else {
665+
val tempMessage = mainList.lastOrNull()
666+
if (tempMessage != null) {
667+
scrollPosition(tempMessage)
668+
} else {
669+
listChats.scrollToPosition(mainList.size - 1)
670+
}
671+
}
672+
}
673+
}catch (e:Exception){
674+
LogMessage.e(TAG,e.toString())
662675
}
663676
}
664677

@@ -1452,7 +1465,7 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
14521465
clickDone = true
14531466
}
14541467
R.id.action_reply -> {
1455-
if (!profileDetails.isAdminBlocked) {
1468+
if (isAdminAndUserProfileNotBlocked()) {
14561469
isReplyTagged = true
14571470
replyMessageActionMenuClicked()
14581471
chatMessageEditText.showSoftKeyboard()
@@ -1472,6 +1485,10 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
14721485
return clickDone
14731486
}
14741487

1488+
private fun isAdminAndUserProfileNotBlocked(): Boolean {
1489+
return !profileDetails.isAdminBlocked && !profileDetails.isBlocked
1490+
}
1491+
14751492
private fun launchEditMessageActivity(){
14761493
val intent = Intent(this, EditMessageActivity::class.java).apply {
14771494
putExtra(LibConstants.JID, chat.toUser)
@@ -1801,7 +1818,7 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
18011818
if (clickedMessages.isNotEmpty())
18021819
forwardMessageActionMenuClicked(clickedMessages)
18031820
else
1804-
senderMediaForward(forwardClickedPostition)
1821+
senderMediaForward(forwardClickedItem)
18051822
} else {
18061823
CustomToast.show(context, data.getMessage())
18071824
}
@@ -1850,9 +1867,13 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
18501867
handleCommonDeleteOperation(isRecalled)
18511868
smartReplyForPreviousMessage()
18521869
} else if (position == 2) {
1853-
isRecalled = true
1854-
recallSelectedMessages()
1855-
handleCommonDeleteOperation(isRecalled)
1870+
if(isGroupUserAvailableInGroupChatOrSingleChat()) {
1871+
isRecalled = true
1872+
recallSelectedMessages()
1873+
handleCommonDeleteOperation(isRecalled)
1874+
}else{
1875+
actionMode?.finish()
1876+
}
18561877
}
18571878
}
18581879

@@ -2008,24 +2029,24 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
20082029
onItemClick(position)
20092030
return
20102031
}else{
2011-
forwardClickedPostition = position
2032+
forwardClickedItem = item
20122033
}
20132034

20142035
if (SystemClock.elapsedRealtime() - lastClickTime > 1000) {
20152036
try {
20162037
hideKeyboard()
2017-
senderMediaForward(position)
2038+
senderMediaForward(item)
20182039
} catch (e: Exception) {
20192040
LogMessage.e(Constants.TAG, e)
20202041
}
20212042
}
20222043
lastClickTime = SystemClock.elapsedRealtime()
20232044
}
20242045

2025-
private fun senderMediaForward(position: Int) {
2046+
private fun senderMediaForward(item: ChatMessage?=null) {
20262047
val forwardMediaMessageSelected: ChatMessage
2027-
if (position.isValidIndex()) {
2028-
forwardMediaMessageSelected = mainList[position]
2048+
if (item!=null) {
2049+
forwardMediaMessageSelected = item
20292050
if (clickedMessages.contains(forwardMediaMessageSelected.messageId))
20302051
return
20312052
if (!forwardMediaMessageSelected.isNotificationMessage() && (!FlyCore.isBusyStatusEnabled() || chat.getChatType().name == ChatType.TYPE_GROUP_CHAT)) {
@@ -2437,8 +2458,10 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
24372458

24382459
if (!videoMessage.first)
24392460
showAudioVideoDurationValidationDialog(videoDuration.toString(), Constants.MSG_TYPE_VIDEO)
2461+
else if(!videoMessage.second)
2462+
showUploadAlert(Constants.MAX_VIDEO_UPLOAD_SIZE)
24402463
else
2441-
validateAndSendMessage(videoMessage.second!!)
2464+
validateAndSendMessage(videoMessage.third!!)
24422465
}
24432466

24442467
private fun sendImageFromGallery(intent: Intent) {
@@ -2665,6 +2688,9 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
26652688
leftUserJid=removedMemberJid
26662689
viewModel.getProfileDetails()
26672690
handleOnResume()
2691+
if (removedMemberJid == SharedPreferenceManager.getCurrentUserJid()) {
2692+
invalidateActionMode() // to update the action items.
2693+
}
26682694
}
26692695
}
26702696

@@ -3048,7 +3074,7 @@ class ChatActivity : ChatParent(), ActionMode.Callback, View.OnTouchListener, Em
30483074

30493075

30503076
private fun setMentionPopupBackground(){
3051-
if( groupTagAdapter.itemCount > 0 && isSoftKeyboardShown && isMentionTriggered) {
3077+
if( groupTagAdapter.itemCount > 0 && isSoftKeyboardShown && chatMessageEditText.text.toString().isNotEmpty()) {
30523078
viewChat.background = ContextCompat.getDrawable(
30533079
this@ChatActivity,
30543080
R.drawable.bg_chat_footer_shape_mention

app/src/main/java/com/contusfly/activities/DashboardActivity.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import androidx.viewpager2.widget.ViewPager2
1818
import com.contusfly.*
1919
import com.contusfly.activities.parent.DashboardParent
2020
import com.contusfly.adapters.ViewPagerAdapter
21+
import com.contusfly.call.MissedCallNotificationUtils.clearMissedCallNotificationDetails
2122
import com.contusfly.call.calllog.CallHistoryFragment
2223
import com.contusfly.call.groupcall.utils.CallUtils
2324
import com.contusfly.databinding.ActivityDashboardBinding
@@ -202,6 +203,7 @@ class DashboardActivity : DashboardParent(), View.OnClickListener, ActionMode.Ca
202203
1 -> {
203204
swipeRefreshLayout.isEnabled = false
204205
dashboardBinding.newChatFab.visibility = View.GONE
206+
clearMissedCallNotificationDetails()
205207
//mark missed calls as read
206208
CallLogManager.markAllUnreadMissedCallsAsRead()
207209
validateMissedCallsCount()
@@ -398,9 +400,9 @@ class DashboardActivity : DashboardParent(), View.OnClickListener, ActionMode.Ca
398400
viewModel.getPrivateChatStatus()
399401
viewModel.getArchivedChatStatus()
400402
viewModel.updateUnReadChatCount()
401-
callLogviewModel.resetPagination()
403+
callLogviewModel.resetPagination(context = context!!)
402404
if (callLogviewModel.isCallLogScreenInitiated()) {
403-
callLogviewModel.addLoaderToTheList()
405+
callLogviewModel.addLoaderToTheList(context = context)
404406
callLogviewModel.getCallLogsList(isLoadCallLogsOnMainThread)
405407
CallUtils.setCallsTabToBeShown(false)
406408
}
@@ -573,14 +575,16 @@ class DashboardActivity : DashboardParent(), View.OnClickListener, ActionMode.Ca
573575
checkListForMuteUnMuteIcon.add(recentList[i].isMuted)
574576

575577
when {
576-
checkListForMuteUnMuteIcon.contains(false) -> {
577-
actionModeMenu.findItem(R.id.action_mute).isVisible = true
578-
actionModeMenu.findItem(R.id.action_unmute).isVisible = false
579-
}
580578
checkListForMuteUnMuteIcon.contains(true) -> {
581579
actionModeMenu.findItem(R.id.action_mute).isVisible = false
582580
actionModeMenu.findItem(R.id.action_unmute).isVisible = true
583581
}
582+
583+
checkListForMuteUnMuteIcon.contains(false) -> {
584+
actionModeMenu.findItem(R.id.action_mute).isVisible = true
585+
actionModeMenu.findItem(R.id.action_unmute).isVisible = false
586+
}
587+
584588
else -> {
585589
actionModeMenu.findItem(R.id.action_mute).isVisible = false
586590
actionModeMenu.findItem(R.id.action_unmute).isVisible = false
@@ -832,5 +836,6 @@ class DashboardActivity : DashboardParent(), View.OnClickListener, ActionMode.Ca
832836
super.onConnected()
833837
LogMessage.d("DashboardActivity", "#dashboard #recent onConnected chatHistoryMigration")
834838
viewModel.chatHistoryMigration()
839+
callLogviewModel.uploadUnSyncedCallLogs()
835840
}
836841
}

app/src/main/java/com/contusfly/activities/EditMessageActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class EditMessageActivity : EditChatParent(), View.OnTouchListener,
8686
val message = getMessage()
8787
if (message != null) {
8888
mainList.add(message)
89-
chatAdapter = ChatAdapter(mainList, arrayListOf(), chat.chatType, this, toUser,true)
89+
chatAdapter = ChatAdapter(mainList, arrayListOf(), chat.chatType, this, toUser,true, listChats)
9090
chatAdapter.hasStableIds()
9191
listChats.adapter = chatAdapter
9292
setMessageInEditText(message)

app/src/main/java/com/contusfly/activities/ForwardMessageActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,8 @@ class ForwardMessageActivity : BaseActivity(), CoroutineScope {
479479
val intent = Intent(context, ChatActivity::class.java)
480480
startActivity(intent.putExtra(LibConstants.JID, selectedUsersWithNames.keys.first())
481481
.putExtra(Constants.CHAT_TYPE, ProfileDetailsUtils.getProfileDetails(selectedUsersWithNames.keys.first())?.getChatType())
482-
.putExtra("externalCall", true))
482+
.putExtra("externalCall", true)
483+
.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
483484
finish()
484485
}
485486
}

app/src/main/java/com/contusfly/activities/GroupInfoActivity.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ class GroupInfoActivity : BaseActivity(),CommonAlertDialog.CommonDialogClosedLis
312312
SharedPreferenceManager.setString(com.contusfly.utils.Constants.ON_GOING_CHAT_USER,groupProfileDetails.jid)
313313
commonAlertDialog = CommonAlertDialog(this)
314314
commonAlertDialog!!.setOnDialogCloseListener(this)
315+
enableCollapsingToolbar(false)
316+
showLoader(true)
315317
checkPrivateChatAvailable()
316318
onClickFunction()
317319
groupMembersAdapter.setHasStableIds(true)
@@ -1177,6 +1179,22 @@ class GroupInfoActivity : BaseActivity(),CommonAlertDialog.CommonDialogClosedLis
11771179
showOrHideAddParticipant(false)
11781180
}
11791181
}
1182+
private fun enableCollapsingToolbar(enable: Boolean) {
1183+
binding.collapsingToolbar.setScrimsShown(enable)
1184+
val params = binding.collapsingToolbar.layoutParams as AppBarLayout.LayoutParams
1185+
if (enable) {
1186+
params.scrollFlags = AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL or
1187+
AppBarLayout.LayoutParams.SCROLL_FLAG_EXIT_UNTIL_COLLAPSED
1188+
1189+
}
1190+
else {
1191+
params.scrollFlags = AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL
1192+
}
1193+
}
1194+
1195+
private fun showLoader(show:Boolean){
1196+
binding.progressSpinner.visibility = if(show) View.VISIBLE else View.GONE
1197+
}
11801198

11811199
/**
11821200
* Loads the Group adapter data into the list
@@ -1205,6 +1223,8 @@ class GroupInfoActivity : BaseActivity(),CommonAlertDialog.CommonDialogClosedLis
12051223
groupMembersList.addAll(usersList)
12061224
groupMembersAdapter.notifyDataSetChanged()
12071225
invalidateOptionsMenu()
1226+
enableCollapsingToolbar(true)
1227+
showLoader(false)
12081228
}
12091229
}
12101230
}

0 commit comments

Comments
 (0)