|
|
@@ -1,7 +1,9 @@
|
|
|
package com.yingyangfly.baselib.dialog
|
|
|
|
|
|
+import android.annotation.SuppressLint
|
|
|
import android.os.Bundle
|
|
|
import android.view.LayoutInflater
|
|
|
+import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
|
import android.widget.RadioGroup
|
|
|
@@ -9,12 +11,14 @@ import androidx.fragment.app.DialogFragment
|
|
|
import com.gyf.immersionbar.BarHide
|
|
|
import com.gyf.immersionbar.ktx.immersionBar
|
|
|
import com.yingyangfly.baselib.R
|
|
|
+import com.yingyangfly.baselib.utils.LiveEventBusUtil
|
|
|
+import com.yingyangfly.baselib.utils.RxBusCodes
|
|
|
import com.yingyangfly.baselib.utils.ViewTool
|
|
|
|
|
|
/**
|
|
|
* 协助判断
|
|
|
*/
|
|
|
-class AnswerJudgmentFragment : DialogFragment() {
|
|
|
+class AnswerJudgmentFragment : DialogFragment(), View.OnTouchListener {
|
|
|
|
|
|
private var radioChoice: RadioGroup? = null
|
|
|
var onDialogClickListener: ((status: String) -> Unit)? = null
|
|
|
@@ -43,6 +47,7 @@ class AnswerJudgmentFragment : DialogFragment() {
|
|
|
val rootView = ViewTool.inflateFragmentPixels(
|
|
|
activity, R.layout.fragment_answer_judgment, container, 1194, 834
|
|
|
)
|
|
|
+ speak("请陪同人员判定患者回答是否正确?")
|
|
|
findId(rootView)
|
|
|
init()
|
|
|
return rootView
|
|
|
@@ -65,4 +70,26 @@ class AnswerJudgmentFragment : DialogFragment() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 播放语音合成内容
|
|
|
+ */
|
|
|
+ private fun speak(taskDesn: String) {
|
|
|
+ LiveEventBusUtil.send(RxBusCodes.SPEECHSYNTHESIS, taskDesn)
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun dismiss() {
|
|
|
+ LiveEventBusUtil.send(RxBusCodes.STOPVOICE, "")
|
|
|
+ super.dismiss()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @SuppressLint("ClickableViewAccessibility")
|
|
|
+ override fun onTouch(v: View?, event: MotionEvent?): Boolean {
|
|
|
+ if (isCancelable && dialog?.isShowing == true) {
|
|
|
+ dismiss()
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|