From 855a7e18a795f0db2453a19e3e8f26ba2ff553b4 Mon Sep 17 00:00:00 2001
From: lmw <125975490@qq.com>
Date: 星期四, 29 五月 2025 16:32:41 +0800
Subject: [PATCH] UI调整

---
 app/src/main/java/com/dollearn/student/ui/home/ListenFragment.kt |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/app/src/main/java/com/dollearn/student/ui/home/ListenFragment.kt b/app/src/main/java/com/dollearn/student/ui/home/ListenFragment.kt
index 9789583..1e343a0 100644
--- a/app/src/main/java/com/dollearn/student/ui/home/ListenFragment.kt
+++ b/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{

--
Gitblit v1.7.1