浏览代码

1.修复通讯录更新可能出现异常问题
2.优化交互历史记录显示
3.优化按键留言功能

weizhengliang 3 年之前
父节点
当前提交
4ea52d76c8

+ 2 - 2
build.gradle

@@ -47,12 +47,12 @@ buildscript {
     /**
     /**
      * APP版本码
      * APP版本码
      */
      */
-    ext.app_version_code = 127
+    ext.app_version_code = 128
 
 
     /**
     /**
      * APP版本号
      * APP版本号
      */
      */
-    ext.app_version = "1.3.45"
+    ext.app_version = "1.3.46"
 
 
     /**
     /**
      * 项目依赖库
      * 项目依赖库

+ 1 - 1
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/NewEventItemAdapter.kt

@@ -131,7 +131,7 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
                             MediaPlayHelper.getInstance().playUrlMusic(ApiManager.urlManager.device_url + itemData.data, 1f, false)
                             MediaPlayHelper.getInstance().playUrlMusic(ApiManager.urlManager.device_url + itemData.data, 1f, false)
                             ImPlayDialogHelper.showImPlayDialog(activity, itemData.fromFrameFullName, TimeTransition().stampToTime(itemData.createDate*1000))
                             ImPlayDialogHelper.showImPlayDialog(activity, itemData.fromFrameFullName, TimeTransition().stampToTime(itemData.createDate*1000))
                             //如果是自己发的留言则不发送已读tcp
                             //如果是自己发的留言则不发送已读tcp
-                            if (Constants.deviceId != itemData.fromDeviceId) {
+                            if (Constants.memberId != itemData.fromDeviceMemberId) {
                                 val tcpModel = ImUtil.imRead(Constants.deviceId, itemData.fromDeviceId, itemData.id)
                                 val tcpModel = ImUtil.imRead(Constants.deviceId, itemData.fromDeviceId, itemData.id)
                                 NettyClient.instance.sendMsg(tcpModel.toJson()).subscribe {
                                 NettyClient.instance.sendMsg(tcpModel.toJson()).subscribe {
                                     if (it) {
                                     if (it) {

+ 7 - 7
home/src/main/code/com/wdkl/ncs/android/component/home/adapter/WatchCallRecordsItemAdapter.kt

@@ -76,11 +76,11 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                 //判断是呼入还是呼出 1 分机到主机 2主机到分机
                 //判断是呼入还是呼出 1 分机到主机 2主机到分机
                 if (itemData.fromDeviceMemberId == Constants.memberId){
                 if (itemData.fromDeviceMemberId == Constants.memberId){
                     binding.sickbedTv.text = itemData.toFrameFullName
                     binding.sickbedTv.text = itemData.toFrameFullName
-                    binding.nameTv.text = itemData.toMemberName
+                    binding.nameTv.text = "To: " + itemData.toMemberName
                     binding.callStatusImagev.setImageResource(R.drawable.hu_chu_yi_jie)
                     binding.callStatusImagev.setImageResource(R.drawable.hu_chu_yi_jie)
                 } else {
                 } else {
                     binding.sickbedTv.text = itemData.fromFrameFullName
                     binding.sickbedTv.text = itemData.fromFrameFullName
-                    binding.nameTv.text = itemData.fromMemberName
+                    binding.nameTv.text = "From: " + itemData.fromMemberName
                     binding.callStatusImagev.setImageResource(R.drawable.hu_ru_yi_jie)
                     binding.callStatusImagev.setImageResource(R.drawable.hu_ru_yi_jie)
                 }
                 }
 
 
@@ -109,7 +109,7 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                     binding.conductorNameTv.visibility = View.GONE
                     binding.conductorNameTv.visibility = View.GONE
                     binding.playTv.setBackgroundResource(R.drawable.yi_bo_fang)
                     binding.playTv.setBackgroundResource(R.drawable.yi_bo_fang)
                     //检查是否自己发的留言
                     //检查是否自己发的留言
-                    if (Constants.deviceId == itemData.fromDeviceId) {
+                    if (itemData.fromDeviceMemberId == Constants.memberId) {
                         binding.processingTimeTv.text = "对方已播放"
                         binding.processingTimeTv.text = "对方已播放"
                     } else {
                     } else {
                         binding.processingTimeTv.text = "已播放"
                         binding.processingTimeTv.text = "已播放"
@@ -138,13 +138,13 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                 binding.processingTimeTv.visibility = View.VISIBLE
                 binding.processingTimeTv.visibility = View.VISIBLE
 
 
                 //判断是呼入还是呼出 1 分机到主机 2主机到分机
                 //判断是呼入还是呼出 1 分机到主机 2主机到分机
-                if(Constants.memberId!=itemData.fromDeviceMemberId){
+                if(Constants.memberId != itemData.fromDeviceMemberId){
                     binding.sickbedTv.text = itemData.fromFrameFullName
                     binding.sickbedTv.text = itemData.fromFrameFullName
-                    binding.nameTv.text = itemData.fromMemberName
+                    binding.nameTv.text = "From: " + itemData.fromMemberName
                     binding.callStatusImagev.setImageResource(R.drawable.hu_ru_wei_jie)
                     binding.callStatusImagev.setImageResource(R.drawable.hu_ru_wei_jie)
                 }else{
                 }else{
                     binding.sickbedTv.text = itemData.toFrameFullName
                     binding.sickbedTv.text = itemData.toFrameFullName
-                    binding.nameTv.text = itemData.toMemberName
+                    binding.nameTv.text = "To: " + itemData.toMemberName
                     binding.callStatusImagev.setImageResource(R.drawable.hu_chu_wei_jie)
                     binding.callStatusImagev.setImageResource(R.drawable.hu_chu_wei_jie)
                 }
                 }
 
 
@@ -167,7 +167,7 @@ class WatchCallRecordsItemAdapter(val data: ArrayList<InteractionVO>) : BaseDele
                     binding.playTv.visibility = View.VISIBLE
                     binding.playTv.visibility = View.VISIBLE
                     binding.playTv.setBackgroundResource(R.drawable.wei_bo_fang)
                     binding.playTv.setBackgroundResource(R.drawable.wei_bo_fang)
                     //检查是否自己发的留言
                     //检查是否自己发的留言
-                    if (Constants.deviceId == itemData.fromDeviceId) {
+                    if (itemData.fromDeviceMemberId == Constants.memberId) {
                         binding.processingTimeTv.text = "对方未播放"
                         binding.processingTimeTv.text = "对方未播放"
                     } else {
                     } else {
                         binding.processingTimeTv.text = "未播放"
                         binding.processingTimeTv.text = "未播放"

+ 1 - 1
home/src/main/code/com/wdkl/ncs/android/component/home/service/WdKeepAliveService.kt

@@ -840,7 +840,7 @@ class WdKeepAliveService : AbsWorkService() {
                 if (action != null) {
                 if (action != null) {
                     if (action.equals(Intent.ACTION_MEDIA_BUTTON)) {
                     if (action.equals(Intent.ACTION_MEDIA_BUTTON)) {
                         val keyEvent = intent.getParcelableExtra<KeyEvent>(Intent.EXTRA_KEY_EVENT)
                         val keyEvent = intent.getParcelableExtra<KeyEvent>(Intent.EXTRA_KEY_EVENT)
-                        if (keyEvent!!.action == KeyEvent.ACTION_DOWN) {
+                        if (keyEvent!!.action == KeyEvent.ACTION_UP) {
                             val keyCode = keyEvent.keyCode
                             val keyCode = keyEvent.keyCode
                             Log.i("wdkeepalive", "mediasession keycode $keyCode")
                             Log.i("wdkeepalive", "mediasession keycode $keyCode")
                             when (keyCode) {
                             when (keyCode) {

+ 1 - 1
home/src/main/code/com/wdkl/ncs/android/component/home/util/RecordHelper.java

@@ -145,7 +145,7 @@ public class RecordHelper {
     public void execRecordVoiceMsg() {
     public void execRecordVoiceMsg() {
         //连续点击2次开始留言
         //连续点击2次开始留言
         long curTime = System.currentTimeMillis();
         long curTime = System.currentTimeMillis();
-        if (!recordRunning && curTime - clickTime > 150 && curTime - clickTime < 1500 && curTime - pressDownTime > 3500 && curTime - pressUpTime > 2500) {
+        if (!recordRunning && curTime - clickTime > 200 && curTime - clickTime < 1500 && curTime - pressDownTime > 3500 && curTime - pressUpTime > 2500) {
             showMessage("开始留言");
             showMessage("开始留言");
             //先停止其他语音或铃声
             //先停止其他语音或铃声
             RingPlayHelper.stopRingTone();
             RingPlayHelper.stopRingTone();

+ 2 - 2
middleware/src/main/code/com/wdkl/ncs/android/middleware/utils/ContactHelper.java

@@ -79,7 +79,7 @@ public class ContactHelper {
             ContentResolver resolver = context.getContentResolver();
             ContentResolver resolver = context.getContentResolver();
             cursor = resolver.query(uri, new String[]{ContactsContract.Data.CONTACT_ID},
             cursor = resolver.query(uri, new String[]{ContactsContract.Data.CONTACT_ID},
                     null, null, null); //从raw_contact表中返回display_name
                     null, null, null); //从raw_contact表中返回display_name
-            if (cursor.moveToFirst()) {
+            if (cursor != null && cursor.moveToFirst()) {
                 int contact_id = cursor.getInt(0);
                 int contact_id = cursor.getInt(0);
                 Log.i("联系人ID", contact_id + "");
                 Log.i("联系人ID", contact_id + "");
                 cursor.close();
                 cursor.close();
@@ -108,7 +108,7 @@ public class ContactHelper {
         Uri uri = Uri.parse("content://com.android.contacts/raw_contacts");
         Uri uri = Uri.parse("content://com.android.contacts/raw_contacts");
         ContentResolver resolver = context.getContentResolver();
         ContentResolver resolver = context.getContentResolver();
         Cursor cursor = resolver.query(uri, new String[]{ContactsContract.Data._ID}, "display_name=?", new String[]{name}, null);
         Cursor cursor = resolver.query(uri, new String[]{ContactsContract.Data._ID}, "display_name=?", new String[]{name}, null);
-        if (cursor.moveToFirst()) {
+        if (cursor != null && cursor.moveToFirst()) {
             int id = cursor.getInt(0);
             int id = cursor.getInt(0);
             cursor.close();
             cursor.close();
             return id;
             return id;