From 3f31373b05ba9f51a28f9e4ec5b605a248955ddd Mon Sep 17 00:00:00 2001 From: wlh <646507849@qq.com> Date: Wed, 28 Feb 2024 11:54:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E5=BB=BA365-=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E5=BC=80=E5=8F=91-bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drawable/shape_oval_262_border_white.xml | 6 +++++ .../act/healthrecord/HealthRecordMainAct.kt | 5 ++++ .../zj365/health/weight/HealthSurveyView.kt | 7 ++++++ .../res/layout/act_health_record_main.xml | 15 +++++++++++ .../res/layout/layout_health_survey_child.xml | 25 ++++++++++++++----- .../xty/network/model/HealthArchiveBean.kt | 7 +++++- 6 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 common/src/main/res/drawable/shape_oval_262_border_white.xml diff --git a/common/src/main/res/drawable/shape_oval_262_border_white.xml b/common/src/main/res/drawable/shape_oval_262_border_white.xml new file mode 100644 index 0000000..010bf5a --- /dev/null +++ b/common/src/main/res/drawable/shape_oval_262_border_white.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/health/src/main/java/com/zj365/health/act/healthrecord/HealthRecordMainAct.kt b/health/src/main/java/com/zj365/health/act/healthrecord/HealthRecordMainAct.kt index 525a0a3..87dbf91 100644 --- a/health/src/main/java/com/zj365/health/act/healthrecord/HealthRecordMainAct.kt +++ b/health/src/main/java/com/zj365/health/act/healthrecord/HealthRecordMainAct.kt @@ -81,6 +81,11 @@ class HealthRecordMainAct : BaseVmAct() { binding.mProgress.progress = it.data.userSchedule * 10 binding.clBody.tvScore.text = "${it.data.surveys.score}" mSurveysList = it.data.surveys.list + mSurveysList.forEach { + if (it.status == 0){ + binding.tvConfirmTest.visibility = View.VISIBLE + } + } initSurvey(mSurveysList) mAdapter.setNewInstance(it.data.healData) diff --git a/health/src/main/java/com/zj365/health/weight/HealthSurveyView.kt b/health/src/main/java/com/zj365/health/weight/HealthSurveyView.kt index 67da023..a9e4378 100644 --- a/health/src/main/java/com/zj365/health/weight/HealthSurveyView.kt +++ b/health/src/main/java/com/zj365/health/weight/HealthSurveyView.kt @@ -78,7 +78,14 @@ class HealthSurveyView(context: Context, attrs: AttributeSet?) : ViewGroup(conte private fun initMenuItem(itemView: View, index: Int) { val tv = itemView.findViewById(R.id.tv_survey) + val img = itemView.findViewById(R.id.img_status) tv.text = mSurveyText[index].name + if (mSurveyText[index].status == 1){ + img.visibility = View.GONE + }else{ + img.visibility = View.VISIBLE + } + when(index){ 0,2,4,6 ->{ tv.setTextColor(Color.parseColor(colors[0])) diff --git a/health/src/main/res/layout/act_health_record_main.xml b/health/src/main/res/layout/act_health_record_main.xml index 12b421b..dbb33b2 100644 --- a/health/src/main/res/layout/act_health_record_main.xml +++ b/health/src/main/res/layout/act_health_record_main.xml @@ -215,6 +215,21 @@ app:layout_constraintTop_toTopOf="parent" tools:ignore="UseCompatTextViewDrawableXml" /> + + - - + android:layout_height="wrap_content"> + + + + + \ No newline at end of file diff --git a/network/src/main/java/com/xty/network/model/HealthArchiveBean.kt b/network/src/main/java/com/xty/network/model/HealthArchiveBean.kt index da98985..c1d7059 100644 --- a/network/src/main/java/com/xty/network/model/HealthArchiveBean.kt +++ b/network/src/main/java/com/xty/network/model/HealthArchiveBean.kt @@ -20,5 +20,10 @@ data class HealthArchiveBean( var score:Int, var list:ArrayList) - data class SurveysInfoBean(var id:Long,var type:Int,var surveysId:Long,var name:String,var status:Int) + data class SurveysInfoBean(var id:Long, + var type:Int, + var surveysId:Long, + var name:String, + var status:Int //0,未回答,1,已回答 + ) }