| | |
| | | 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 |
| | | |
| | |
| | | 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) |
| | |
| | | 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{ |