|
@@ -77,26 +77,30 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
|
|
|
toDeviceId = itemData.fromDeviceId
|
|
|
}
|
|
|
binding.eliMemberName.text = showName
|
|
|
+ binding.eliCallout.visibility = View.GONE
|
|
|
|
|
|
- binding.eliVoiceRecorder.visibility = View.VISIBLE
|
|
|
+ /*binding.eliVoiceRecorder.visibility = View.VISIBLE
|
|
|
binding.eliVoiceRecorder.setOnClickListener{
|
|
|
var intent = Intent(activity,VoiceMsgActivity::class.java)
|
|
|
intent.putExtra(VoiceMsgActivity.TO_DEVICE_ID,toDeviceId)
|
|
|
activity.startActivity(intent)
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
when (itemData.actionType){
|
|
|
TcpType.EVENT.name->{
|
|
|
binding.eliImRead.visibility = View.GONE
|
|
|
binding.eliEventResponse.visibility = View.VISIBLE
|
|
|
+ binding.eliEventResponse.setImageResource(R.drawable.icon_switch_off)
|
|
|
binding.eliEventName.text = itemData.data
|
|
|
if (itemData.actionEndMemberId!=null){
|
|
|
- binding.eliEventResponse.visibility = View.GONE
|
|
|
+ binding.eliEventResponse.visibility = View.INVISIBLE
|
|
|
binding.eliEventName.setTextColor(Color.GREEN)
|
|
|
} else {
|
|
|
binding.eliEventName.setTextColor(activity.resources.getColor(R.color.warn_orange))
|
|
|
binding.eliEventResponse.setOnClickListener {
|
|
|
loadingDialog.show()
|
|
|
+ //binding.eliEventResponse.setImageResource(R.drawable.icon_switch_on)
|
|
|
+ binding.eliEventResponse.visibility = View.INVISIBLE
|
|
|
val tcpModel = EventUtil.eventResponse(Constants.deviceId, itemData.fromDeviceId, itemData.id)
|
|
|
val transaction: TcpCallback = object : TcpCallback(tcpModel.tid) {
|
|
|
override fun onSuccess(jsonObject: JSONObject) {
|
|
@@ -141,11 +145,11 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
|
|
|
//binding.eliVoiceRecorder.visibility = View.GONE
|
|
|
//}
|
|
|
}
|
|
|
+
|
|
|
TcpType.IM.name->{
|
|
|
binding.eliEventName.setText(R.string.event_voice_msg)
|
|
|
- binding.eliEventResponse.visibility = View.GONE
|
|
|
+ binding.eliEventResponse.visibility = View.INVISIBLE
|
|
|
if (itemData.actionEnd!=null){
|
|
|
- binding.eliEventResponse.visibility = View.GONE
|
|
|
binding.eliImRead.visibility = View.VISIBLE
|
|
|
binding.eliEventName.setTextColor(Color.GREEN)
|
|
|
|
|
@@ -202,18 +206,22 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
TcpType.SOS.name->{
|
|
|
binding.eliEventName.setTextColor(activity.resources.getColor(R.color.warn_orange))
|
|
|
binding.eliImRead.visibility = View.GONE
|
|
|
binding.eliEventResponse.visibility = View.VISIBLE
|
|
|
+ binding.eliEventResponse.setImageResource(R.drawable.icon_switch_off)
|
|
|
binding.eliEventName.text = "SOS"
|
|
|
// binding.eliEventName.setBackgroundResource(R.drawable.sos_96)
|
|
|
if (itemData.actionEnd!=null){
|
|
|
- binding.eliEventResponse.visibility = View.GONE
|
|
|
+ binding.eliEventResponse.visibility = View.INVISIBLE
|
|
|
binding.eliEventName.setTextColor(Color.GREEN)
|
|
|
} else {
|
|
|
binding.eliEventResponse.setOnClickListener {
|
|
|
loadingDialog.show()
|
|
|
+ //binding.eliEventResponse.setImageResource(R.drawable.icon_switch_on)
|
|
|
+ binding.eliEventResponse.visibility = View.INVISIBLE
|
|
|
val tcpModel = OtherUtil.SOSCancel(Constants.deviceId, itemData.fromDeviceId, itemData.id)
|
|
|
val transaction: TcpCallback = object : TcpCallback(tcpModel.tid) {
|
|
|
override fun onSuccess(jsonObject: JSONObject) {
|
|
@@ -259,13 +267,32 @@ class NewEventItemAdapter(var data:ArrayList<InteractionVO>, val activity: Activ
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
TcpType.VOICE.name->{
|
|
|
binding.eliEventName.setText(R.string.event_voice_call)
|
|
|
- binding.eliEventResponse.visibility = View.GONE
|
|
|
+ if (Constants.oldEvent) {
|
|
|
+ binding.eliCallout.visibility = View.VISIBLE
|
|
|
+ binding.eliEventResponse.visibility = View.INVISIBLE
|
|
|
+ } else {
|
|
|
+ binding.eliVoiceRecorder.visibility = View.GONE
|
|
|
+ binding.eliEventResponse.visibility = View.VISIBLE
|
|
|
+ binding.eliEventResponse.setImageResource(R.drawable.icon_switch_off)
|
|
|
+ binding.eliEventResponse.setOnClickListener {
|
|
|
+ //binding.eliEventResponse.setImageResource(R.drawable.icon_switch_on)
|
|
|
+ binding.eliEventResponse.visibility = View.INVISIBLE
|
|
|
+ val responseTcp = VoiceUtil.voiceResponse(Constants.deviceId, itemData.fromDeviceId, itemData.id)
|
|
|
+ TcpClient.getInstance().sendMsg(responseTcp.toJson())
|
|
|
+
|
|
|
+ //移除该条记录
|
|
|
+ Constants.eventList.remove(itemData)
|
|
|
+ EventBus.getDefault().post(MessageEvent(responseTcp, Constants.EVENT_UPDATE_EVENT))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
TcpType.PHONE.name->{
|
|
|
binding.eliEventName.setText(R.string.event_voice_call)
|
|
|
- binding.eliEventResponse.visibility = View.GONE
|
|
|
+ binding.eliEventResponse.visibility = View.INVISIBLE
|
|
|
}
|
|
|
}
|
|
|
|