Selaa lähdekoodia

1.优化接口获取完数据后才展示占位图页面

王鹏鹏 2 vuotta sitten
vanhempi
commit
58b3923e4e

+ 1 - 0
.idea/misc.xml

@@ -82,6 +82,7 @@
         <entry key="..\:/workspace/hcp-pad/personalcenter/src/main/res/layout/activity_help.xml" value="0.16455696202531644" />
         <entry key="..\:/workspace/hcp-pad/personalcenter/src/main/res/layout/activity_personal_center.xml" value="0.8800000000000001" />
         <entry key="..\:/workspace/hcp-pad/personalcenter/src/main/res/layout/activity_setting.xml" value="0.136" />
+        <entry key="..\:/workspace/hcp-pad/personalcenter/src/main/res/layout/item_comprehensive_evaluation.xml" value="0.1" />
         <entry key="..\:/workspace/hcp-pad/personalcenter/src/main/res/layout/item_diagnosis.xml" value="0.1" />
         <entry key="..\:/workspace/hcp-pad/personalcenter/src/main/res/layout/layout_help_item.xml" value="0.1" />
         <entry key="..\:/workspace/hcp-pad/personalcenter/src/main/res/layout/layout_setting_item.xml" value="1.0" />

+ 4 - 0
workbenches/src/main/java/com/yingyang/workbenches/freetraining/FreeTrainActivity.kt

@@ -47,6 +47,10 @@ class FreeTrainActivity : BaseMVVMActivity<ActivityFreeTrainBinding, FreeTrainVi
                 binding.tvTitle.text = bean.dictLabel
                 type = bean.dictValue
                 freeTrainListAdapter.setType(type)
+                binding {
+                    rvTrain.show(true)
+                    emptyLayout.show(false)
+                }
                 loadData()
             }
             //自由训练游戏列表

+ 4 - 0
workbenches/src/main/java/com/yingyang/workbenches/leisurebrain/LeisureBrainActivity.kt

@@ -51,6 +51,10 @@ class LeisureBrainActivity :
             leisureBrainTrainTypeAdapter.onLeisureBrainTypeClickListener = { bean ->
                 tvTitle.text = bean.dictLabel
                 videoType = bean.dictValue
+                binding {
+                    rvLeisureBrain.show(true)
+                    emptyLayout.show(false)
+                }
                 getLeisureBrainList()
             }
 

+ 5 - 0
workbenches/src/main/java/com/yingyang/workbenches/traincontent/TrainContentFragment.kt

@@ -7,6 +7,7 @@ import com.yingyang.workbenches.entity.TrainContentBean
 import com.yingyang.workbenches.entity.TreatmentBean
 import com.yingyang.workbenches.widget.OnSpinnerItemSelectedListener
 import com.yingyang.workbenches.widget.SpinnerTextFormatter
+import com.yingyangfly.baselib.ext.show
 import com.yingyangfly.baselib.ext.toast
 import com.yingyangfly.baselib.mvvm.BaseMVVMFragment
 import com.yingyangfly.baselib.router.RouterUrlCommon
@@ -40,6 +41,10 @@ class TrainContentFragment :
         binding.treatmentSpinner.onSpinnerItemSelectedListener =
             OnSpinnerItemSelectedListener { parent, view, position, id ->
                 val bean = binding.treatmentSpinner.selectedItem as TreatmentBean
+                binding {
+                    rvTrainingContent.show(true)
+                    emptyLayout.show(false)
+                }
                 findMyTask(bean.id)
             }
     }

+ 14 - 0
workbenches/src/main/res/layout/fragment_train_content.xml

@@ -121,6 +121,20 @@
             app:layout_constraintRight_toRightOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/contentTitleLayout" />
 
+        <LinearLayout
+            android:id="@+id/emptyLayout"
+            style="@style/empty_linear_layout_style"
+            android:layout_height="0dp"
+            android:visibility="gone"
+            app:layout_constraintTop_toBottomOf="@+id/contentTitleLayout"
+            tools:ignore="MissingConstraints">
+
+            <androidx.appcompat.widget.AppCompatImageView style="@style/empty_image_view_style" />
+
+            <androidx.appcompat.widget.AppCompatTextView style="@style/empty_text_view_style" />
+
+        </LinearLayout>
+
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </layout>