|
@@ -21,6 +21,7 @@ import com.wdkl.ncs.android.component.home.util.MediaPlayHelper
|
|
import com.wdkl.ncs.android.component.home.util.SpeechUtil
|
|
import com.wdkl.ncs.android.component.home.util.SpeechUtil
|
|
import com.wdkl.ncs.android.component.home.util.Util
|
|
import com.wdkl.ncs.android.component.home.util.Util
|
|
import com.wdkl.ncs.android.lib.base.BaseActivity
|
|
import com.wdkl.ncs.android.lib.base.BaseActivity
|
|
|
|
+import com.wdkl.ncs.android.lib.base.BaseApplication
|
|
import com.wdkl.ncs.android.lib.utils.AppTool
|
|
import com.wdkl.ncs.android.lib.utils.AppTool
|
|
import com.wdkl.ncs.android.lib.utils.showMessage
|
|
import com.wdkl.ncs.android.lib.utils.showMessage
|
|
import com.wdkl.ncs.android.middleware.logic.contract.home.NewEventListContract
|
|
import com.wdkl.ncs.android.middleware.logic.contract.home.NewEventListContract
|
|
@@ -61,7 +62,12 @@ class NewEventListActivity : BaseActivity<NewEventListPresenter,ActivityEventLis
|
|
HomeLaunch.component.inject(this)
|
|
HomeLaunch.component.inject(this)
|
|
}
|
|
}
|
|
|
|
|
|
- override fun init() {
|
|
|
|
|
|
+ override fun onStart() {
|
|
|
|
+ super.onStart()
|
|
|
|
+ //TTS初始化
|
|
|
|
+// SpeechUtil.getInstance().init(BaseApplication.appContext)
|
|
|
|
+// SpeechUtil.getInstance().startSpeechThread()
|
|
|
|
+
|
|
WdKeepAliveService.mNewEventListActive = true
|
|
WdKeepAliveService.mNewEventListActive = true
|
|
//震动
|
|
//震动
|
|
mVibrator = getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
|
|
mVibrator = getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
|
|
@@ -75,9 +81,11 @@ class NewEventListActivity : BaseActivity<NewEventListPresenter,ActivityEventLis
|
|
//语音播放
|
|
//语音播放
|
|
if (tcpModel.type == TcpType.EVENT && tcpModel.action == TcpAction.EventAction.KEY_CLICK) {
|
|
if (tcpModel.type == TcpType.EVENT && tcpModel.action == TcpAction.EventAction.KEY_CLICK) {
|
|
val eventStr = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ",")) + ", " + interactionVO.data
|
|
val eventStr = Util.appendSpace(interactionVO.fromFrameFullName.replace("-", ",")) + ", " + interactionVO.data
|
|
|
|
+ SpeechUtil.getInstance().stopSpeak()
|
|
SpeechUtil.getInstance().newSpeech("您有新的事件待处理, " + eventStr, false)
|
|
SpeechUtil.getInstance().newSpeech("您有新的事件待处理, " + eventStr, false)
|
|
|
|
|
|
} else if (tcpModel.type == TcpType.IM && tcpModel.action == TcpAction.IMAction.MSG) {
|
|
} else if (tcpModel.type == TcpType.IM && tcpModel.action == TcpAction.IMAction.MSG) {
|
|
|
|
+ SpeechUtil.getInstance().stopSpeak()
|
|
SpeechUtil.getInstance().newSpeech("您有新的语音留言待处理", false)
|
|
SpeechUtil.getInstance().newSpeech("您有新的语音留言待处理", false)
|
|
} else if (tcpModel.type == TcpType.SOS && tcpModel.action == TcpAction.SOSAction.CALL) {
|
|
} else if (tcpModel.type == TcpType.SOS && tcpModel.action == TcpAction.SOSAction.CALL) {
|
|
SpeechUtil.getInstance().stopSpeak()
|
|
SpeechUtil.getInstance().stopSpeak()
|
|
@@ -99,6 +107,10 @@ class NewEventListActivity : BaseActivity<NewEventListPresenter,ActivityEventLis
|
|
renderData(listData)
|
|
renderData(listData)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ override fun init() {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
override fun bindEvent() {
|
|
override fun bindEvent() {
|
|
|
|
|
|
}
|
|
}
|
|
@@ -178,9 +190,11 @@ class NewEventListActivity : BaseActivity<NewEventListPresenter,ActivityEventLis
|
|
showMessage("已响应"+responseInteractionVO.fromFrameFullName + " " + responseInteractionVO.data)
|
|
showMessage("已响应"+responseInteractionVO.fromFrameFullName + " " + responseInteractionVO.data)
|
|
|
|
|
|
var doFinish = false
|
|
var doFinish = false
|
|
- for (it in listData){
|
|
|
|
|
|
+ var iterator = this.listData.iterator()
|
|
|
|
+ while (iterator.hasNext()){
|
|
|
|
+ val it = iterator.next()
|
|
if (it.id == responseInteractionVO.id) {
|
|
if (it.id == responseInteractionVO.id) {
|
|
- listData.remove(it)
|
|
|
|
|
|
+ this.listData.remove(it)
|
|
|
|
|
|
if (responseInteractionVO.actionType.equals(TcpType.IM.name)){
|
|
if (responseInteractionVO.actionType.equals(TcpType.IM.name)){
|
|
AppTool.Time.delay(1000){
|
|
AppTool.Time.delay(1000){
|
|
@@ -189,27 +203,27 @@ class NewEventListActivity : BaseActivity<NewEventListPresenter,ActivityEventLis
|
|
}
|
|
}
|
|
adapter.data.remove(it)
|
|
adapter.data.remove(it)
|
|
adapter.notifyDataSetChanged()
|
|
adapter.notifyDataSetChanged()
|
|
- if (listData.isEmpty()||listData.size==0){
|
|
|
|
|
|
+ if (this.listData.isEmpty()||this.listData.size==0){
|
|
AppTool.Time.delay(1200) {
|
|
AppTool.Time.delay(1200) {
|
|
finish()
|
|
finish()
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- renderData(listData)
|
|
|
|
|
|
+ this.renderData(this.listData)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- adapter.data.remove(it)
|
|
|
|
- adapter.notifyDataSetChanged()
|
|
|
|
|
|
+ this.adapter.data.remove(it)
|
|
|
|
+ this.adapter.notifyDataSetChanged()
|
|
doFinish = true
|
|
doFinish = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if ((listData.isEmpty()||listData.size==0) && doFinish){
|
|
|
|
|
|
+ if ((this.listData.isEmpty()||this.listData.size==0) && doFinish){
|
|
AppTool.Time.delay(1200) {
|
|
AppTool.Time.delay(1200) {
|
|
finish()
|
|
finish()
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- renderData(listData)
|
|
|
|
|
|
+ this.renderData(this.listData)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -246,25 +260,27 @@ class NewEventListActivity : BaseActivity<NewEventListPresenter,ActivityEventLis
|
|
showMessage("已响应")
|
|
showMessage("已响应")
|
|
}
|
|
}
|
|
|
|
|
|
- for (it in listData){
|
|
|
|
|
|
+ var iterator = this.listData.iterator()
|
|
|
|
+ while (iterator.hasNext()){
|
|
|
|
+ val it = iterator.next()
|
|
if (it.id == responseInteractionVO.id) {
|
|
if (it.id == responseInteractionVO.id) {
|
|
- listData.remove(it)
|
|
|
|
- adapter.data.remove(it)
|
|
|
|
- adapter.notifyDataSetChanged()
|
|
|
|
|
|
+ this.listData.remove(it)
|
|
|
|
+ this.adapter.data.remove(it)
|
|
|
|
+ this.adapter.notifyDataSetChanged()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (listData.isEmpty()||listData.size==0){
|
|
|
|
|
|
+ if (this.listData.isEmpty()||this.listData.size==0){
|
|
AppTool.Time.delay(1200) {
|
|
AppTool.Time.delay(1200) {
|
|
finish()
|
|
finish()
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- renderData(listData)
|
|
|
|
|
|
+ renderData(this.listData)
|
|
}
|
|
}
|
|
|
|
|
|
} else if (tcpModel.action === TcpAction.SOSAction.CALL) {
|
|
} else if (tcpModel.action === TcpAction.SOSAction.CALL) {
|
|
- listData.add(responseInteractionVO)
|
|
|
|
- renderData(listData)
|
|
|
|
|
|
+ this.listData.add(responseInteractionVO)
|
|
|
|
+ renderData(this.listData)
|
|
|
|
|
|
SpeechUtil.getInstance().stopSpeak()
|
|
SpeechUtil.getInstance().stopSpeak()
|
|
handleVibrator()
|
|
handleVibrator()
|