From e0fc00f9ce402fc422b7ed8a1ebb95fa8e823708 Mon Sep 17 00:00:00 2001 From: Rizki Sunaryo Date: Wed, 13 Feb 2019 00:02:45 +0700 Subject: [PATCH] fix (ibu): intermittent delivery status of Ibu Previously, the code was always to setText. Now, I change the code to save the string to a variable first. Then it will setText at the end. https://github.com/OpenSRP/opensrp-client-sid/issues/32 --- .../bidan/provider/KIClientsProvider.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/opensrp-bidan/src/main/java/org/smartregister/bidan/provider/KIClientsProvider.java b/opensrp-bidan/src/main/java/org/smartregister/bidan/provider/KIClientsProvider.java index bd6d328..4cc9c09 100644 --- a/opensrp-bidan/src/main/java/org/smartregister/bidan/provider/KIClientsProvider.java +++ b/opensrp-bidan/src/main/java/org/smartregister/bidan/provider/KIClientsProvider.java @@ -113,7 +113,8 @@ public void getView(SmartRegisterClient smartRegisterClient, View convertView) { TextView children_age_right = (TextView) convertView.findViewById(R.id.txt_children_age_right); TextView children_age_bottom = (TextView) convertView.findViewById(R.id.txt_children_age_bottom); - edd_due.setText(""); +// edd_due.setText(""); + String eddDueStr = ""; anc_status_layout.setText(""); date_status.setText(""); visit_status.setText(""); @@ -140,10 +141,12 @@ public void getView(SmartRegisterClient smartRegisterClient, View convertView) { _dueEdd = mContext.getString(R.string.edd_passed); } - edd_due.setText(_dueEdd); +// edd_due.setText(_dueEdd); + eddDueStr = _dueEdd; } else { - edd_due.setText(""); +// edd_due.setText(""); + eddDueStr = ""; } if (ibuparent != null) { @@ -173,16 +176,19 @@ public void getView(SmartRegisterClient smartRegisterClient, View convertView) { /* checkMonth("delivered",edd_due);*/ edd_due.setTextColor(mContext.getResources().getColor(R.color.alert_complete_green)); String deliver = mContext.getString(R.string.delivered); - edd_due.setText(deliver); +// edd_due.setText(deliver); + eddDueStr = deliver; checkLastVisit(pc.getDetails().get("PNCDate"), mContext.getString(R.string.pnc_ke) + " " + pc.getDetails().get("hariKeKF"), mContext.getString(R.string.service_pnc), anc_status_layout, date_status, visit_status); }else{ ((TextView) convertView.findViewById(R.id.txt_edd)).setText(""); - edd_due.setText(""); +// edd_due.setText(""); + eddDueStr = ""; } }else{ ((TextView) convertView.findViewById(R.id.txt_edd)).setText(""); - edd_due.setText(""); +// edd_due.setText(""); + eddDueStr = ""; } } @@ -193,6 +199,7 @@ public void getView(SmartRegisterClient smartRegisterClient, View convertView) { mContext.getString(R.string.fp_methods) + ": " + pc.getDetails().get("jenisKontrasepsi"), mContext.getString(R.string.service_fp), anc_status_layout, date_status, visit_status); } + edd_due.setText(eddDueStr); //anak for (int i = 0; i < allchild.size(); i++) {