Browse Source

<费用医嘱加载bug>

weizhengliang 4 years ago
parent
commit
05a51ad48b

+ 1 - 1
app/src/main/java/com/wdkl/callingbed2/adapter/CostAdapter.java

@@ -51,7 +51,7 @@ public class CostAdapter extends RecyclerView.Adapter<CostAdapter.ViewHolder> {
                 viewHolder.llTitle.setBackgroundResource(R.color.cost_list_title);
             }else{
                 if((position-1)%2==0){
-                    viewHolder.llTitle.setBackgroundResource(R.color.cost_item);
+                    viewHolder.llTitle.setBackgroundResource(R.color.white);
                 }else{
                     viewHolder.llTitle.setBackgroundResource(R.color.cost_item);
                 }

+ 3 - 3
app/src/main/java/com/wdkl/callingbed2/entity/DoctorDataEntity.java

@@ -46,14 +46,14 @@ public class DoctorDataEntity {
 
 
     public class DoctorChargeArray {
-        private String DoctorCharge;
+        private String doctorChartge;
 
         public void setDoctorCharge(String DoctorCharge) {
-            this.DoctorCharge = DoctorCharge;
+            this.doctorChartge = DoctorCharge;
         }
 
         public String getDoctorCharge() {
-            return DoctorCharge == null ? "暂无" : DoctorCharge;
+            return doctorChartge == null ? "暂无" : doctorChartge;
         }
 
     }

+ 2 - 2
app/src/main/java/com/wdkl/callingbed2/ui/CallingBedActivity.java

@@ -817,6 +817,7 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
         //对于rv 的初始化
         costArrayList = new ArrayList<>();
         costAdapter = new CostAdapter(costArrayList);
+        rvCost.setAdapter(costAdapter);
         rvCost.setLayoutManager(new FullyLinearLayoutManager(this));
         rvCost.setOnTouchListener(new View.OnTouchListener() {
             @Override
@@ -856,6 +857,7 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
 
         doctorChargeArrayList = new ArrayList<>();
         doctorAdapter = new DoctorAdapter(doctorChargeArrayList);
+        rvDoctor.setAdapter(doctorAdapter);
         rvDoctor.setLayoutManager(new FullyLinearLayoutManager(this));
         rvDoctor.setOnTouchListener(new View.OnTouchListener() {
             @Override
@@ -1499,7 +1501,6 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
                 doctorChargeArrayList = doctorDataEntity.getDoctorChargeArray();
             }
             doctorAdapter.upDateList(doctorChargeArrayList);
-            rvDoctor.setAdapter(doctorAdapter);
 
             tvDoctorPageName.setText("姓名: " + doctorDataEntity.getName());
             tvDoctorPageInpatientNum.setText("住院号: " + doctorDataEntity.getInpatientNum());
@@ -1515,7 +1516,6 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
                 costArrayList = costDataEntity.getCostArray();
             }
             costAdapter.upDateList(costArrayList);
-            rvCost.setAdapter(costAdapter);
 
             tvCostPageName.setText("姓名: " + costDataEntity.getName());
             tvCostPageInpatientNum.setText("住院号: " + costDataEntity.getInpatientNum());

+ 1 - 1
app/src/main/java/com/wdkl/callingbed2/ui/InitActivity.java

@@ -165,7 +165,7 @@ public class InitActivity extends BaseActivity implements SerialPortUtil.ISerial
      */
     private void getMacAddress() {
         if (NetUtil.isethernetConnected(cm)) {
-            macAddress = NetUtil.getMacAddress();
+            macAddress = "4C:01:00:00:00:07"; //NetUtil.getMacAddress();
             if (null != macAddress) {
                 SharedPreferences sharedPreferences = getSharedPreferences(Constants.MSG_SP, Context.MODE_PRIVATE); //私有数据
                 SharedPreferences.Editor editor = sharedPreferences.edit();

+ 15 - 11
app/src/main/java/com/wdkl/callingbed2/util/FullyLinearLayoutManager.java

@@ -76,21 +76,25 @@ public class FullyLinearLayoutManager extends LinearLayoutManager {
     private void measureScrapChild(RecyclerView.Recycler recycler, int position, int widthSpec,
                                    int heightSpec, int[] measuredDimension) {
         try {
-            View view = recycler.getViewForPosition(position);//fix 动态添加时报IndexOutOfBoundsException
+            if (position > 0) {
+                if (heightSpec <= 0) {
+                    View view = recycler.getViewForPosition(position);//fix 动态添加时报IndexOutOfBoundsException
 
-            if (view != null) {
-                RecyclerView.LayoutParams p = (RecyclerView.LayoutParams) view.getLayoutParams();
+                    if (view != null) {
+                        RecyclerView.LayoutParams p = (RecyclerView.LayoutParams) view.getLayoutParams();
 
-                int childWidthSpec = ViewGroup.getChildMeasureSpec(widthSpec,
-                        getPaddingLeft() + getPaddingRight(), p.width);
+                        int childWidthSpec = ViewGroup.getChildMeasureSpec(widthSpec,
+                                getPaddingLeft() + getPaddingRight(), p.width);
 
-                int childHeightSpec = ViewGroup.getChildMeasureSpec(heightSpec,
-                        getPaddingTop() + getPaddingBottom(), p.height);
+                        int childHeightSpec = ViewGroup.getChildMeasureSpec(heightSpec,
+                                getPaddingTop() + getPaddingBottom(), p.height);
 
-                view.measure(childWidthSpec, childHeightSpec);
-                measuredDimension[0] = view.getMeasuredWidth() + p.leftMargin + p.rightMargin;
-                measuredDimension[1] = view.getMeasuredHeight() + p.bottomMargin + p.topMargin;
-                recycler.recycleView(view);
+                        view.measure(childWidthSpec, childHeightSpec);
+                        measuredDimension[0] = view.getMeasuredWidth() + p.leftMargin + p.rightMargin;
+                        measuredDimension[1] = view.getMeasuredHeight() + p.bottomMargin + p.topMargin;
+                        recycler.recycleView(view);
+                    }
+                }
             }
         } catch (Exception e) {
             e.printStackTrace();