Browse Source

优化空显示

weizhengliang 3 years ago
parent
commit
3512d59b94

+ 1 - 1
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/adapter/BabyItemAdapter.kt

@@ -19,7 +19,7 @@ class BabyItemAdapter(private var data: ArrayList<FrameBedRelativeVO>) : Recycle
 
     override fun onBindViewHolder(p0: BabyViewHolder, p1: Int) {
         try {
-            val pos = p1 % data.size
+            val pos = p1
 
             if (data[pos].relativeMemberName != null) {
                 p0.babyName.text = data[pos].relativeMemberName

+ 20 - 1
callingdoor/src/main/java/com/wdkl/app/ncs/callingdoor/fragment/YzMainFragment.kt

@@ -125,16 +125,35 @@ class YzMainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>
                 babyItems.clear()
                 babyItems.addAll(bedVO.frameBedRelativeVos)
                 babyAdapter.updateData(babyItems)
-                baby_list_view.itemAnimator = DefaultItemAnimator()
+            } else {
+                //女孩
+                Constant.babyGirl = true
+                //红色主题
+                rl_date_view.setBackgroundResource(R.drawable.shape_bottom_bg_red)
+                yz_main_view.setBackgroundResource(R.mipmap.main_bg_girl)
+                tv_in_date.setTextColor(Constant.colorGirl)
+                tv_out_date.setTextColor(Constant.colorGirl)
+                tv_mother_name.setTextColor(Constant.colorGirl)
+                tv_desc.setBackgroundResource(R.drawable.shape_desc_bg_red)
+                img_nurse_icon.setImageResource(R.mipmap.ic_nurse_2)
+                tv_nurse_name.setTextColor(Constant.colorGirl)
+
+                babyItems.clear()
+                babyAdapter.updateData(babyItems)
             }
 
             if (bedVO.customerInDate != null) {
                 val inDate = TimeHandle.getDateTime(bedVO.customerInDate*1000, "yyyy年MM月dd日")
                 tv_in_date.setText("入住时间: " + inDate)
+            } else {
+                tv_in_date.setText("入住时间:")
             }
+
             if (bedVO.customerOutDate != null) {
                 val outDate = TimeHandle.getDateTime(bedVO.customerOutDate*1000, "yyyy年MM月dd日")
                 tv_out_date.setText("出所时间: " + outDate)
+            } else {
+                tv_out_date.setText("出所时间:")
             }
 
             tv_mother_name.text = bedVO.customerName