lmw
2 天以前 855a7e18a795f0db2453a19e3e8f26ba2ff553b4
app/src/main/java/com/dollearn/student/ui/home/ListenFragment.kt
@@ -17,6 +17,7 @@
import com.dollearn.student.utils.AudioUtils
import com.dollearn.student.utils.Const
import com.dollearn.student.utils.extention.clickDelay
import com.dollearn.student.utils.glide.GlideUtil
import kotlinx.android.synthetic.main.fragment_listen.*
import org.jetbrains.anko.imageResource
@@ -96,10 +97,14 @@
        data?.apply {
            val originList = subjectList[group]
            correctVoice = originList[index].correct
            iv_1.setImageURI(randomList[0].img)
            iv_2.setImageURI(randomList[1].img)
            iv_3.setImageURI(randomList[2].img)
            iv_4.setImageURI(randomList[3].img)
            GlideUtil.load(requireContext(),randomList[0].img,iv_1,0)
            GlideUtil.load(requireContext(),randomList[1].img,iv_2,0)
            GlideUtil.load(requireContext(),randomList[2].img,iv_3,0)
            GlideUtil.load(requireContext(),randomList[3].img,iv_4,0)
//            iv_1.setImageURI(randomList[0].img)
//            iv_2.setImageURI(randomList[1].img)
//            iv_3.setImageURI(randomList[2].img)
//            iv_4.setImageURI(randomList[3].img)
            resultViewList.forEachIndexed { index, imageView ->
                imageView.imageResource = if (randomList[index].correct == correctVoice){
                    motion.setTransition(R.id.start,if (index == 0) R.id.end_1 else if (index == 1) R.id.end_2 else if (index == 2) R.id.end_3 else R.id.end_4)
@@ -133,11 +138,11 @@
        hasRight = false
        right = true
        handler?.sendEmptyMessageDelayed(PLAY_VOICE,200) //改为立即播放
        cl_1.progress = 0f
        cl_2.progress = 0f
        cl_3.progress = 0f
        cl_4.progress = 0f
        motion.progress = 0f
        cl_1?.progress = 0f
        cl_2?.progress = 0f
        cl_3?.progress = 0f
        cl_4?.progress = 0f
        motion?.progress = 0f
    }
    companion object{