lmw
2025-03-07 f84c51bb2f6be93b1ff6e48077316eaabd713d9f
app/src/main/java/com/dollearn/student/ui/home/ChooseVoiceFragment.kt
@@ -58,6 +58,8 @@
    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()
@@ -117,7 +119,7 @@
        }
        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()
@@ -143,7 +145,7 @@
        }
        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()
@@ -170,7 +172,7 @@
        }
        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()
@@ -243,15 +245,16 @@
        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
@@ -441,4 +444,8 @@
        player.stopPlayMusic()
    }
    override fun onDestroy() {
        super.onDestroy()
        handler?.removeCallbacksAndMessages(null)
    }
}