|
|
@@ -8,6 +8,7 @@ import com.yingyang.moca.databinding.FragmentMemorizeNumbersBinding
|
|
|
import com.yingyangfly.baselib.base.BaseFragment
|
|
|
import com.yingyangfly.baselib.db.QuestionsBean
|
|
|
import com.yingyangfly.baselib.ext.setOnSingleClickListener
|
|
|
+import com.yingyangfly.baselib.ext.toast
|
|
|
import com.yingyangfly.baselib.voice.PlayVoice
|
|
|
|
|
|
/**
|
|
|
@@ -48,8 +49,9 @@ class MemorizeNumbersFragment : BaseFragment<FragmentMemorizeNumbersBinding>() {
|
|
|
bundle
|
|
|
)
|
|
|
} else {
|
|
|
+ questionId--
|
|
|
val controller = Navigation.findNavController(it)
|
|
|
- val bundle = bundleOf("questionId" to 49)
|
|
|
+ val bundle = bundleOf("questionId" to questionId)
|
|
|
controller.navigate(
|
|
|
R.id.action_memorizeNumbersFragment_to_memorizeResultFragment,
|
|
|
bundle
|
|
|
@@ -57,12 +59,16 @@ class MemorizeNumbersFragment : BaseFragment<FragmentMemorizeNumbersBinding>() {
|
|
|
}
|
|
|
}
|
|
|
btnNext.setOnSingleClickListener {
|
|
|
- val controller = Navigation.findNavController(it)
|
|
|
- val bundle = bundleOf("questionId" to questionId)
|
|
|
- controller.navigate(
|
|
|
- R.id.action_memorizeNumbersFragment_to_memorizeResultFragment,
|
|
|
- bundle
|
|
|
- )
|
|
|
+ if (questionId == 51) {
|
|
|
+ "节奏错了几次".toast()
|
|
|
+ } else {
|
|
|
+ val controller = Navigation.findNavController(it)
|
|
|
+ val bundle = bundleOf("questionId" to questionId)
|
|
|
+ controller.navigate(
|
|
|
+ R.id.action_memorizeNumbersFragment_to_memorizeResultFragment,
|
|
|
+ bundle
|
|
|
+ )
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -82,8 +88,10 @@ class MemorizeNumbersFragment : BaseFragment<FragmentMemorizeNumbersBinding>() {
|
|
|
private fun loadData() {
|
|
|
binding.tvTitle.text = if (questionId == 49) {
|
|
|
"下面给您听一些数字,听完后请按照顺序背出来请听题"
|
|
|
- } else {
|
|
|
+ } else if (questionId == 50) {
|
|
|
"下面再给您听一些数字,听完后请从后往前倒着背出来,请听题"
|
|
|
+ } else {
|
|
|
+ "下面将给您听一串数字,请您仔细听,当您听到数字“1”时,请敲一下桌面,听到其他数字不用做反应"
|
|
|
}
|
|
|
if (dao != null) {
|
|
|
question = dao?.getQuestion(questionId)
|