| | |
| | | showVoiceUi() |
| | | |
| | | rl_check_1.clickDelay { |
| | | if (playing) |
| | | return@clickDelay |
| | | if (list[questionIndex].completed) //已作答 |
| | | return@clickDelay |
| | | act.totalCount++ |
| | |
| | | Log.e(TAG,"选择正确") |
| | | transAnimation(cl_answer_1,voiceViews[questionIndex]) |
| | | list[questionIndex].completed = true |
| | | cl_answer_1.callOnClick() |
| | | }else{ |
| | | dot_1.visible() |
| | | iv_error_1.visible() |
| | |
| | | } |
| | | } |
| | | rl_check_2.clickDelay { |
| | | if (playing) |
| | | return@clickDelay |
| | | if (list[questionIndex].completed) //已作答 |
| | | return@clickDelay |
| | | act.totalCount++ |
| | |
| | | Log.e(TAG,"选择正确") |
| | | transAnimation(cl_answer_2,voiceViews[questionIndex]) |
| | | list[questionIndex].completed = true |
| | | cl_answer_2.callOnClick() |
| | | }else{ |
| | | dot_2.visible() |
| | | iv_error_2.visible() |
| | |
| | | } |
| | | } |
| | | rl_check_3.clickDelay { |
| | | if (playing) |
| | | return@clickDelay |
| | | if (list[questionIndex].completed) //已作答 |
| | | return@clickDelay |
| | | act.totalCount++ |
| | |
| | | Log.e(TAG,"选择正确") |
| | | transAnimation(cl_answer_3,voiceViews[questionIndex]) |
| | | list[questionIndex].completed = true |
| | | cl_answer_3.callOnClick() |
| | | }else{ |
| | | dot_3.visible() |
| | | iv_error_3.visible() |
| | |
| | | cl_answer_1.visible() |
| | | cl_answer_2.visible() |
| | | cl_answer_3.visible() |
| | | answerList.clear() |
| | | answerList.add(list[position].correct) |
| | | answerList.addAll(list[position].error?.split(",")?: arrayListOf()) |
| | | answerList.shuffle() |
| | | cl_answer_1.setOnClickListener { |
| | | if (playing) |
| | | return@setOnClickListener |
| | | voiceIndex = 4 |
| | | handler?.sendEmptyMessage(PLAY_VOICE) |
| | | } |
| | | cl_answer_2.setOnClickListener { |
| | | if (playing) |
| | | return@setOnClickListener |
| | | voiceIndex = 5 |
| | | handler?.sendEmptyMessage(PLAY_VOICE) |
| | | } |
| | | cl_answer_3.setOnClickListener { |
| | | if (playing) |
| | | return@setOnClickListener |
| | | voiceIndex = 6 |
| | | handler?.sendEmptyMessage(PLAY_VOICE) |
| | | } |
| | |
| | | v1Views[voiceIndex].gone() |
| | | v2Views[voiceIndex].gone() |
| | | playingViews[voiceIndex].visible() |
| | | if (voiceIndex == 0&&!list[1].completed){ |
| | | if (voiceIndex == 0&&list[0].isQuestion == 1&&!list[1].completed){ |
| | | showAnswerView(1) |
| | | } |
| | | if (voiceIndex == 1&&!list[0].completed){ |
| | | if (voiceIndex == 1&&list[1].isQuestion == 1&&!list[0].completed){ |
| | | showAnswerView(0) |
| | | |
| | | } |
| | | if (voiceIndex == 2&&!list[3].completed){ |
| | | if (voiceIndex == 2&&list[2].isQuestion == 1&&!list[3].completed){ |
| | | showAnswerView(3) |
| | | } |
| | | if (voiceIndex == 3&&!list[2].completed){ |
| | | if (voiceIndex == 3&&list[3].isQuestion == 1&&!list[2].completed){ |
| | | showAnswerView(2) |
| | | } |
| | | } |
| | |
| | | v1Views[voiceIndex].visible() |
| | | v2Views[voiceIndex].visible() |
| | | playingViews[voiceIndex].gone() |
| | | if (list.filter { it.completed }.size == 2){ //全部作答,3秒后下一题 |
| | | handler?.sendEmptyMessageDelayed(TO_NEXT,3000) |
| | | } |
| | | } |
| | | } |