| | |
| | | |
| | | private var nowVoiceView:View? = null |
| | | |
| | | private val isShowText by lazy { SPUtils.instance().getBoolean(Const.IS_SHOW_TEXT,true) } |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | player.setOnAudioStatusUpdateListener(this) |
| | | player.stopPlayMusic() |
| | |
| | | } |
| | | |
| | | rl_check_1.clickDelay { |
| | | if (playing) |
| | | if (playing||data!!.subjectList[group].filter { it.completed }.size == data!!.subjectList[group].size) |
| | | return@clickDelay |
| | | if (rl_check_2.visibility == View.VISIBLE&&rl_check_3.visibility == View.VISIBLE){ |
| | | dot_1.visible() |
| | |
| | | } |
| | | |
| | | rl_check_2.clickDelay { |
| | | if (playing) |
| | | if (playing||data!!.subjectList[group].filter { it.completed }.size == data!!.subjectList[group].size) |
| | | return@clickDelay |
| | | if (rl_check_1.visibility == View.VISIBLE&&rl_check_3.visibility == View.VISIBLE) { |
| | | dot_2.visible() |
| | |
| | | |
| | | } |
| | | rl_check_3.clickDelay { |
| | | if (playing) |
| | | if (playing||data!!.subjectList[group].filter { it.completed }.size == data!!.subjectList[group].size) |
| | | return@clickDelay |
| | | if (rl_check_2.visibility == View.VISIBLE&&rl_check_3.visibility == View.VISIBLE) { |
| | | dot_3.visible() |
| | |
| | | val shuffledList = list.shuffled() |
| | | voiceList.clear() |
| | | voiceList.addAll(shuffledList) |
| | | nameViews.forEachIndexed { index, textView -> |
| | | if (index == currentIndex){ |
| | | textView.text = originList[index].name |
| | | textView.backgroundResource = R.color.textColor99 |
| | | }else{ |
| | | textView.text = "" |
| | | textView.backgroundResource = R.color.page_bg |
| | | if (isShowText) |
| | | nameViews.forEachIndexed { index, textView -> |
| | | if (index == currentIndex){ |
| | | textView.text = originList[index].name |
| | | textView.backgroundResource = R.color.textColor99 |
| | | }else{ |
| | | textView.text = "" |
| | | textView.backgroundResource = R.color.page_bg |
| | | } |
| | | } |
| | | } |
| | | //设置动画飞行路径 3对4 |
| | | val rightVoiceIndex = voiceList.indexOf(imageNow.correct) |
| | | var start = 0 |
| | |
| | | player.stopPlayMusic() |
| | | } |
| | | |
| | | override fun onDestroy() { |
| | | super.onDestroy() |
| | | handler?.removeCallbacksAndMessages(null) |
| | | } |
| | | } |