|
@@ -8,6 +8,8 @@ import com.alibaba.android.vlayout.DelegateAdapter
|
|
import com.alibaba.android.vlayout.VirtualLayoutManager
|
|
import com.alibaba.android.vlayout.VirtualLayoutManager
|
|
import com.enation.javashop.android.jrouter.external.annotation.Router
|
|
import com.enation.javashop.android.jrouter.external.annotation.Router
|
|
import com.enation.javashop.net.engine.model.NetState
|
|
import com.enation.javashop.net.engine.model.NetState
|
|
|
|
+import com.google.gson.FieldNamingPolicy
|
|
|
|
+import com.google.gson.GsonBuilder
|
|
import com.scwang.smartrefresh.layout.footer.ClassicsFooter
|
|
import com.scwang.smartrefresh.layout.footer.ClassicsFooter
|
|
import com.wdkl.ncs.android.component.home.R
|
|
import com.wdkl.ncs.android.component.home.R
|
|
import com.wdkl.ncs.android.component.home.adapter.WatchCallRecordsItemAdapter
|
|
import com.wdkl.ncs.android.component.home.adapter.WatchCallRecordsItemAdapter
|
|
@@ -22,6 +24,8 @@ import com.wdkl.ncs.android.middleware.logic.presenter.home.WatchActivityPresent
|
|
import com.wdkl.ncs.android.middleware.logic.presenter.home.WatchCallRecordsFragmentPresenter
|
|
import com.wdkl.ncs.android.middleware.logic.presenter.home.WatchCallRecordsFragmentPresenter
|
|
import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
|
|
import com.wdkl.ncs.android.middleware.model.vo.InteractionVO
|
|
import com.wdkl.ncs.android.middleware.model.vo.WatchContactsVO
|
|
import com.wdkl.ncs.android.middleware.model.vo.WatchContactsVO
|
|
|
|
+import com.wdkl.ncs.android.middleware.tcp.TcpClient
|
|
|
|
+import com.wdkl.ncs.android.middleware.tcp.channel.VoiceUtil
|
|
import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
|
|
import com.wdkl.ncs.android.middleware.tcp.dto.TcpModel
|
|
import com.wdkl.ncs.android.middleware.utils.MessageEvent
|
|
import com.wdkl.ncs.android.middleware.utils.MessageEvent
|
|
import kotlinx.android.synthetic.main.watch_activity_call_records.*
|
|
import kotlinx.android.synthetic.main.watch_activity_call_records.*
|
|
@@ -30,7 +34,7 @@ import org.greenrobot.eventbus.ThreadMode
|
|
|
|
|
|
|
|
|
|
@Router(path = "/watch/callrecords")
|
|
@Router(path = "/watch/callrecords")
|
|
-class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter, WatchActivityCallRecordsBinding>(), WatchCallRecordsFragmentContract.View {
|
|
|
|
|
|
+class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter, WatchActivityCallRecordsBinding>(), WatchCallRecordsFragmentContract.View, View.OnClickListener {
|
|
|
|
|
|
|
|
|
|
var TAG = WatchCallRecordsActivity::class.java.getSimpleName()
|
|
var TAG = WatchCallRecordsActivity::class.java.getSimpleName()
|
|
@@ -56,6 +60,7 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
|
|
var all = "ALL"
|
|
var all = "ALL"
|
|
var initiator = "INITATOR"
|
|
var initiator = "INITATOR"
|
|
var action: String? = null
|
|
var action: String? = null
|
|
|
|
+ var receivedData :WatchContactsVO? = null
|
|
|
|
|
|
|
|
|
|
override fun getLayId(): Int {
|
|
override fun getLayId(): Int {
|
|
@@ -79,6 +84,7 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
|
|
call_records_recyv.layoutManager = virtualLayoutManager
|
|
call_records_recyv.layoutManager = virtualLayoutManager
|
|
call_records_recyv.adapter = delegateAdapter
|
|
call_records_recyv.adapter = delegateAdapter
|
|
|
|
|
|
|
|
+ receivedData = intent.getSerializableExtra("data") as WatchContactsVO?
|
|
action = intent.getStringExtra("action")
|
|
action = intent.getStringExtra("action")
|
|
customerId = intent.getStringExtra("customer_id")
|
|
customerId = intent.getStringExtra("customer_id")
|
|
if (action == all) {
|
|
if (action == all) {
|
|
@@ -89,10 +95,26 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
|
|
}else {
|
|
}else {
|
|
call_relyout.visibility = View.VISIBLE
|
|
call_relyout.visibility = View.VISIBLE
|
|
presenter.loadFloor(initiator, 1, 30,Constants.ids.toInt(),customerId.toInt())
|
|
presenter.loadFloor(initiator, 1, 30,Constants.ids.toInt(),customerId.toInt())
|
|
|
|
+ call_relyout.setOnClickListener{
|
|
|
|
+ Log.i(TAG, "call_relyout click 111")
|
|
|
|
+ var tcpModel = VoiceUtil.voiceCall(Integer.parseInt(Constants.ids),21)
|
|
|
|
+ TcpClient.getInstance().sendMsg(tcpModel.toJson())
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ override fun onClick(p0: View) {
|
|
|
|
+ when (p0.id) {
|
|
|
|
+ R.id.call_relyout -> {
|
|
|
|
+ Log.i(TAG, "call_relyout click 222")
|
|
|
|
+ var tcpModel = VoiceUtil.voiceCall(Integer.parseInt(Constants.ids),receivedData?.deviceId)
|
|
|
|
+ TcpClient.getInstance().sendMsg(tcpModel.toJson())
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
override fun bindEvent() {
|
|
override fun bindEvent() {
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
override fun destory() {
|
|
override fun destory() {
|
|
@@ -140,10 +162,20 @@ class WatchCallRecordsActivity : BaseActivity<WatchCallRecordsFragmentPresenter,
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
fun onMoonEvent(messageEvent: MessageEvent) {
|
|
fun onMoonEvent(messageEvent: MessageEvent) {
|
|
- var messageEvent = messageEvent.getMessage() as TcpModel
|
|
|
|
-// if(messageEvent.getAction() === TcpAction.EventAction.KEY_CLICK){
|
|
|
|
-// Log.e(TAG,"收到tcp消息")
|
|
|
|
-// }
|
|
|
|
|
|
+ if (messageEvent.type == 1){
|
|
|
|
+ var tcpModel = messageEvent.getMessage() as TcpModel
|
|
|
|
+ //data 是 InteractionVO
|
|
|
|
+ var gson = GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create()
|
|
|
|
+ var interactionVO = gson.fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
|
|
+ //界面呈现
|
|
|
|
+ AppTool.Time.delay(300){
|
|
|
|
+ var intent = Intent()
|
|
|
|
+ intent.setClass(this,RTCVoipAudioActivity::class.java)
|
|
|
|
+ intent.putExtra("targetId", interactionVO.toSipId)
|
|
|
|
+ intent.putExtra("TcpModel",tcpModel)
|
|
|
|
+ startActivity(intent)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|