Skip to content

Commit

Permalink
WD| Setup on Kohort ANC Detail activity #4
Browse files Browse the repository at this point in the history
  • Loading branch information
baksosapi committed Nov 16, 2017
1 parent 7c1041b commit 700f72f
Show file tree
Hide file tree
Showing 18 changed files with 4,218 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,26 +175,6 @@ public void onClick(View v) {
// viewHolder.no_ibu.setText(kiparent.getDetails().get("noBayi") != null ? kiparent.getDetails().get("noBayi") : "");
}

/*fatherName.setText(": " + (Support.getDetails(controller,"namaAyah") != null ? transformToddmmyyyy(Support.getDetails(controller,"namaAyah");
motherName.setText(": " + (Support.getDetails(controller,"namaIbu") != null
? Support.getDetails(controller,"namaIbu")
: Support.getDetails(controller,"nama_orang_tua")!=null
? Support.getDetails(controller,"nama_orang_tua")
: "-"
)
);*/
/* village.setText(": " + (Support.getDetails(controller,"desa") != null
? Support.getDetails(controller,"desa")
: "-"))));*/

/* subVillage.setText(": " + (Support.getDetails(controller,"dusun") != null
? Support.getDetails(controller,"dusun")
: Support.getDetails(controller,"village") != null
? Support.getDetails(controller,"village")
: "-")
);
*/

dateOfBirth.setText(": " + (transformToddmmyyyy(Support.getColumnmaps(controller,"tanggalLahirAnak").substring(0,10))));
birthWeight.setText(": " + (!Support.getDetails(controller, "beratLahir").equals("-")
? Double.toString(Integer.parseInt(controller.getDetails()
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.opensrp.api.util.TreeNode;
import org.smartregister.Context;
import org.smartregister.bidan_cloudant.R;
import org.smartregister.bidan_cloudant.activity.BidanDetailActivity;
import org.smartregister.bidan_cloudant.activity.KANCDetailActivity;
import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity;
import org.smartregister.bidan_cloudant.activity.LoginActivity;
import org.smartregister.bidan_cloudant.libs.FlurryFacade;
Expand Down Expand Up @@ -323,8 +323,8 @@ public void onClick(View view) {
switch (view.getId()) {
case R.id.profile_info_layout:
FlurryFacade.logEvent("click_detail_picture_vaksinator");
BidanDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),BidanDetailActivity.class);
KANCDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),KANCDetailActivity.class);
startActivity(intent);
getActivity().finish();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.opensrp.api.util.TreeNode;
import org.smartregister.Context;
import org.smartregister.bidan_cloudant.R;
import org.smartregister.bidan_cloudant.activity.BidanDetailActivity;
import org.smartregister.bidan_cloudant.activity.KChildDetailActivity;
import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity;
import org.smartregister.bidan_cloudant.activity.LoginActivity;
import org.smartregister.bidan_cloudant.libs.FlurryFacade;
Expand Down Expand Up @@ -323,8 +323,8 @@ public void onClick(View view) {
switch (view.getId()) {
case R.id.profile_info_layout:
FlurryFacade.logEvent("click_detail_picture_vaksinator");
BidanDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),BidanDetailActivity.class);
KChildDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),KChildDetailActivity.class);
startActivity(intent);
getActivity().finish();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.opensrp.api.util.TreeNode;
import org.smartregister.Context;
import org.smartregister.bidan_cloudant.R;
import org.smartregister.bidan_cloudant.activity.BidanDetailActivity;
import org.smartregister.bidan_cloudant.activity.KFPDetailActivity;
import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity;
import org.smartregister.bidan_cloudant.activity.LoginActivity;
import org.smartregister.bidan_cloudant.libs.FlurryFacade;
Expand Down Expand Up @@ -323,8 +323,8 @@ public void onClick(View view) {
switch (view.getId()) {
case R.id.profile_info_layout:
FlurryFacade.logEvent("click_detail_picture_vaksinator");
BidanDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),BidanDetailActivity.class);
KFPDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),KFPDetailActivity.class);
startActivity(intent);
getActivity().finish();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.opensrp.api.util.TreeNode;
import org.smartregister.Context;
import org.smartregister.bidan_cloudant.R;
import org.smartregister.bidan_cloudant.activity.BidanDetailActivity;
import org.smartregister.bidan_cloudant.activity.KMotherDetailActivity;
import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity;
import org.smartregister.bidan_cloudant.activity.LoginActivity;
import org.smartregister.bidan_cloudant.libs.FlurryFacade;
Expand Down Expand Up @@ -281,8 +281,8 @@ public void onClick(View view) {
switch (view.getId()) {
case R.id.profile_info_layout:
FlurryFacade.logEvent("click_detail_picture_vaksinator");
BidanDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),BidanDetailActivity.class);
KMotherDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),KMotherDetailActivity.class);
startActivity(intent);
getActivity().finish();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import org.opensrp.api.util.TreeNode;
import org.smartregister.Context;
import org.smartregister.bidan_cloudant.R;
import org.smartregister.bidan_cloudant.activity.BidanDetailActivity;
import org.smartregister.bidan_cloudant.activity.KPNCDetailActivity;
import org.smartregister.bidan_cloudant.activity.KChildSmartRegisterActivity;
import org.smartregister.bidan_cloudant.activity.LoginActivity;
import org.smartregister.bidan_cloudant.libs.FlurryFacade;
Expand Down Expand Up @@ -323,8 +323,8 @@ public void onClick(View view) {
switch (view.getId()) {
case R.id.profile_info_layout:
FlurryFacade.logEvent("click_detail_picture_vaksinator");
BidanDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),BidanDetailActivity.class);
KPNCDetailActivity.controller = (CommonPersonObjectClient)view.getTag();
Intent intent = new Intent(getActivity(),KPNCDetailActivity.class);
startActivity(intent);
getActivity().finish();
break;
Expand Down
27 changes: 27 additions & 0 deletions bidan-cloudant/src/main/java/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
import android.os.Build;
import android.os.Build.VERSION_CODES;

import org.apache.commons.lang3.text.WordUtils;

import static org.apache.commons.lang3.StringUtils.capitalize;
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.replace;
import static org.apache.commons.lang3.StringUtils.upperCase;


/**
* Class containing some static utility methods.
Expand Down Expand Up @@ -51,4 +58,24 @@ public static boolean hasJellyBean() {
return Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
}

// public static String humanize(String value) {
// return capitalize(replace(getValue(value), "_", " "));
// }
//
// public static String replaceAndHumanize(String value, String oldCharacter, String newCharacter) {
// return humanize(replace(getValue(value), oldCharacter, newCharacter));
// }
//
// public static String replaceAndHumanizeWithInitCapText(String value, String oldCharacter, String newCharacter) {
// return humanize(WordUtils.capitalize(replace(getValue(value), oldCharacter, newCharacter)));
// }
//
// public static String humanizeAndDoUPPERCASE(String value) {
// return upperCase(humanize(getValue(value)));
// }
//
// public static String getValue(String value) {
// return isBlank(value)? "" : value;
// }

}
126 changes: 126 additions & 0 deletions bidan-cloudant/src/main/res/layout/anc_detail_activity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/client_list_header_dark_grey">

<include layout="@layout/motherdetail_nav_bar"/>

<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/smart_register_client_divider_height"
android:src="@color/smart_register_client_divider_color"
android:id="@+id/imageView5" />

<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="32dp"
android:weightSum="4"
android:orientation="horizontal">

<org.ei.opensrp.view.customControls.CustomFontTextView
android:layout_weight="1.05"
android:layout_width="0dp"

android:layout_height="match_parent"
android:text="@string/basic_information"
android:id="@+id/child_detail_information"
style="@style/CustomFontTextViewStyle.ListView.Medium"
android:layout_gravity="center_vertical"

android:textColor="@color/alert_urgent_red"
android:layout_marginLeft="5dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:textStyle="bold"
android:textSize="16sp" />



<org.ei.opensrp.view.customControls.CustomFontTextView
android:layout_weight="0.87"
android:layout_width="0dp"
android:layout_height="match_parent"
android:text="@string/risk"
android:id="@+id/detail_today"
style="@style/CustomFontTextViewStyle.ListView.Medium"
android:layout_gravity="center_vertical"
android:textColor="@color/light_blue"
android:layout_marginLeft="5dp"
android:layout_marginTop="2dp"
android:textStyle="bold"
android:textSize="16sp" />
<org.ei.opensrp.view.customControls.CustomFontTextView
android:layout_weight="0.98"
android:layout_width="0dp"
android:layout_height="match_parent"
android:text="Birth Plan"
android:id="@+id/detail_l"
style="@style/CustomFontTextViewStyle.ListView.Medium"
android:layout_gravity="center_vertical"
android:textColor="@color/pnc_circle_green"
android:layout_marginLeft="5dp"
android:layout_marginTop="2dp"
android:textStyle="bold"
android:textSize="16sp" />

</LinearLayout>

<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/smart_register_client_divider_height"
android:src="@color/smart_register_client_divider_color"
android:id="@+id/imageView4" />

<include
layout="@layout/ki_detail_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/smart_register_client_divider_height"
android:src="@color/smart_register_client_divider_color"
android:id="@+id/imageView3" />

<LinearLayout
android:id="@+id/clients_header_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/list_header_height"
android:layout_marginLeft="@dimen/list_view_margin_left_and_right"
android:layout_marginRight="@dimen/list_view_margin_left_and_right"
android:orientation="horizontal">

<org.ei.opensrp.view.customControls.CustomFontTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/elco_details_summary"
android:id="@+id/mother_summary"
style="@style/CustomFontTextViewStyle.ListView.Medium"
android:layout_gravity="center_vertical"
android:textColor="@color/text_black"
android:textStyle="bold"
android:textSize="20sp" />

</LinearLayout>

<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/smart_register_client_divider_height"
android:src="@color/smart_register_client_divider_color"/>

<include android:id="@+id/id1"
layout="@layout/anc_detail_data_layout"
/>
<include
android:id="@+id/id2"
layout="@layout/risk_detail_data_layout"
android:visibility="gone"/>
<include
android:id="@+id/id3"
layout="@layout/birthplan_detail_data_layout"
android:visibility="gone"/>
</LinearLayout>
Loading

0 comments on commit 700f72f

Please sign in to comment.