Skip to content

Commit

Permalink
MI | Updating child register views #6
Browse files Browse the repository at this point in the history
Signed-off-by: mib-iqbal <[email protected]>
  • Loading branch information
mib-iqbal committed Nov 10, 2017
1 parent e754686 commit f67a12e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public void startRegistration() {

ft.addToBackStack(null);
LocationSelectorDialogFragment
.newInstance((GiziSmartRegisterActivity) getActivity(), new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_gizi")
.newInstance((GiziSmartRegisterActivity) getActivity(), new EditDialogOptionModel(), context().anmLocationController().get(), "registrasi_ibu")
.show(ft, locationDialogTAG);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.smartregister.commonregistry.AllCommonsRepository;
import org.smartregister.commonregistry.CommonPersonObject;
import org.smartregister.commonregistry.CommonPersonObjectClient;
import org.smartregister.commonregistry.CommonRepository;
import org.smartregister.cursoradapter.SmartRegisterCLientsProviderForCursorAdapter;
import org.smartregister.domain.Alert;
import org.smartregister.gizi.R;
import org.smartregister.repository.DetailsRepository;
import org.smartregister.service.AlertService;
import org.smartregister.util.DateUtil;
import org.smartregister.util.OpenSRPImageLoader;
Expand All @@ -40,6 +42,7 @@
import java.util.concurrent.TimeUnit;

import util.GiziConstants;
import util.formula.Support;

import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static org.smartregister.util.Utils.fillValue;
Expand Down Expand Up @@ -73,16 +76,27 @@ public ChildSmartClientsProvider(Context context, View.OnClickListener onClickLi
public void getView(Cursor cursor, SmartRegisterClient client, final View convertView) {
CommonPersonObjectClient pc = (CommonPersonObjectClient) client;

/* viewHolder.name = (TextView)convertView.findViewById(R.id.txt_child_name);
viewHolder.fatherName = (TextView) convertView.findViewById(R.id.ParentName);
viewHolder.subVillage = (TextView) convertView.findViewById(R.id.txt_child_subVillage);*/

//fillValue((TextView) convertView.findViewById(R.id.child_zeir_id), getValue(pc.getColumnmaps(), GiziConstants.KEY.ZEIR_ID, false));
DetailsRepository detailsRepository = org.smartregister.Context.getInstance().detailsRepository();
detailsRepository.updateDetails(pc);

String firstName = getValue(pc.getColumnmaps(), "namaBayi", true);

fillValue((TextView) convertView.findViewById(R.id.txt_child_name), firstName);

// get parent
AllCommonsRepository childRepository = org.smartregister.Context.getInstance().allCommonsRepositoryobjects("ec_anak");
CommonPersonObject childobject = childRepository.findByCaseID(pc.entityId());
Log.d("IDssssssssssssss",pc.entityId());
AllCommonsRepository kirep = org.smartregister.Context.getInstance().allCommonsRepositoryobjects("ec_kartu_ibu");
final CommonPersonObject kiparent = kirep.findByCaseID(getValue(pc.getColumnmaps(), "relational_id", true));
Log.d("22222222222222",getValue(pc.getColumnmaps(), "relational_id", true));
if(kiparent != null) {
detailsRepository.updateDetails(kiparent);
String namaayah = getValue(kiparent.getColumnmaps(), "namaSuami", true);
String namaibu = getValue(kiparent.getColumnmaps(), "namalengkap", true);
fillValue((TextView) convertView.findViewById(R.id.ParentName), namaibu+","+namaayah);

}

/*String lastName = getValue(pc.getColumnmaps(), GiziConstants.KEY.LAST_NAME, true);
String childName = getName(firstName, lastName);
Expand Down
24 changes: 12 additions & 12 deletions opensrp-gizi/src/main/res/layout/smart_register_gizi_client.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
Expand All @@ -48,7 +48,7 @@
android:textColor="#000000"
android:textSize="14sp" />

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
Expand All @@ -64,7 +64,7 @@

</LinearLayout>

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
Expand All @@ -74,7 +74,7 @@
android:textColor="@color/light_blue"
android:textSize="14sp" />

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
Expand All @@ -83,7 +83,7 @@
android:id="@+id/txt_child_subVillage"
android:textSize="12sp" />

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium Text"
Expand All @@ -94,7 +94,7 @@
android:textStyle="bold"
android:textColor="#000000" />

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
Expand Down Expand Up @@ -128,7 +128,7 @@
android:layout_marginBottom="1dp"
android:layout_weight="1">

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
Expand All @@ -137,7 +137,7 @@
android:id="@+id/txt_child_visit_date"
android:textSize="14sp" />

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
Expand All @@ -146,7 +146,7 @@
android:id="@+id/txt_child_height"
android:textSize="14sp" />

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
Expand Down Expand Up @@ -189,7 +189,7 @@
android:layout_marginBottom="1dp"
android:layout_weight="1.75">

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="UnderWeight"
Expand All @@ -198,15 +198,15 @@
android:layout_marginLeft="5dp"
android:textSize="16sp"/>

<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" :"
style="@style/CustomFontTextViewStyle.ListView.Normal.MultipleLines"
android:id="@+id/txt_child_stunting"
android:layout_marginLeft="5dp"
android:textSize="16sp"/>
<org.ei.opensrp.view.customControls.CustomFontTextView
<org.smartregister.view.customcontrols.CustomFontTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Wasting"
Expand Down

0 comments on commit f67a12e

Please sign in to comment.