diff --git a/gradle.properties b/gradle.properties index cb36455c..d6978c18 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=0.1.17-SNAPSHOT +VERSION_NAME=0.1.18-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client CHW Anc Library diff --git a/opensrp-chw-anc/build.gradle b/opensrp-chw-anc/build.gradle index c86b1d92..e11f06d1 100644 --- a/opensrp-chw-anc/build.gradle +++ b/opensrp-chw-anc/build.gradle @@ -87,7 +87,7 @@ allprojects { } dependencies { - implementation('org.smartregister:opensrp-client-core:1.7.16-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-core:1.7.22-SNAPSHOT@aar') { transitive = true exclude group: 'com.github.bmelnychuk', module: 'atv' exclude group: 'com.google.guava', module: 'guava' diff --git a/opensrp-chw-anc/gradle.properties b/opensrp-chw-anc/gradle.properties index b95a243c..9fdefd6c 100644 --- a/opensrp-chw-anc/gradle.properties +++ b/opensrp-chw-anc/gradle.properties @@ -1,5 +1,5 @@ POM_SETTING_NAME=OpenSRP Client Chw Anc POM_SETTING_ARTIFACT_ID=opensrp-client-chw-anc POM_SETTING_PACKAGING=aar -VERSION_NAME=0.1.27-SNAPSHOT +VERSION_NAME=0.1.28-SNAPSHOT VERSION_CODE=1 \ No newline at end of file diff --git a/opensrp-chw-anc/src/main/java/org/smartregister/chw/anc/activity/BaseAncMemberProfileActivity.java b/opensrp-chw-anc/src/main/java/org/smartregister/chw/anc/activity/BaseAncMemberProfileActivity.java index abef1ef0..ae06f3dc 100644 --- a/opensrp-chw-anc/src/main/java/org/smartregister/chw/anc/activity/BaseAncMemberProfileActivity.java +++ b/opensrp-chw-anc/src/main/java/org/smartregister/chw/anc/activity/BaseAncMemberProfileActivity.java @@ -268,7 +268,7 @@ public void openFamilyDueServices() { @Override public void setProfileImage(String baseEntityId, String entityType) { - imageRenderHelper.refreshProfileImage(baseEntityId, imageView, NCUtils.getMemberProfileImageResourceIDentifier(entityType)); + imageRenderHelper.refreshProfileImage(baseEntityId, imageView, NCUtils.getAncMemberProfileImageResourceIdentifier()); } @Override diff --git a/opensrp-chw-anc/src/main/java/org/smartregister/chw/anc/util/NCUtils.java b/opensrp-chw-anc/src/main/java/org/smartregister/chw/anc/util/NCUtils.java index 0fd374a9..5c44b1b0 100644 --- a/opensrp-chw-anc/src/main/java/org/smartregister/chw/anc/util/NCUtils.java +++ b/opensrp-chw-anc/src/main/java/org/smartregister/chw/anc/util/NCUtils.java @@ -447,6 +447,14 @@ public static int getMemberProfileImageResourceIDentifier(String entityType) { return R.mipmap.ic_member; } + public static int getAncMemberProfileImageResourceIdentifier() { + return R.drawable.anc_woman; + } + + public static int getPncMemberProfileImageResourceIdentifier() { + return R.drawable.pnc_woman; + } + public static String gestationAgeString(String lmp, Context context, boolean full) { DateTimeFormatter formatter = DateTimeFormat.forPattern("dd-MM-yyyy"); int ga = Days.daysBetween(formatter.parseDateTime(lmp), new DateTime()).getDays() / 7; diff --git a/opensrp-chw-anc/src/main/res/drawable-xxhdpi/anc_woman.png b/opensrp-chw-anc/src/main/res/drawable-xxhdpi/anc_woman.png new file mode 100644 index 00000000..176bebe4 Binary files /dev/null and b/opensrp-chw-anc/src/main/res/drawable-xxhdpi/anc_woman.png differ diff --git a/opensrp-chw-anc/src/main/res/drawable/pnc_woman.png b/opensrp-chw-anc/src/main/res/drawable/pnc_woman.png new file mode 100644 index 00000000..de6e7206 Binary files /dev/null and b/opensrp-chw-anc/src/main/res/drawable/pnc_woman.png differ diff --git a/opensrp-chw-anc/src/test/java/org/smartregister/chw/anc/util/NCUtilsTest.java b/opensrp-chw-anc/src/test/java/org/smartregister/chw/anc/util/NCUtilsTest.java index fc0202f9..a2ee71cc 100644 --- a/opensrp-chw-anc/src/test/java/org/smartregister/chw/anc/util/NCUtilsTest.java +++ b/opensrp-chw-anc/src/test/java/org/smartregister/chw/anc/util/NCUtilsTest.java @@ -10,6 +10,7 @@ import org.smartregister.chw.anc.BaseUnitTest; import org.smartregister.chw.anc.domain.Visit; import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.opensrp_chw_anc.R; import org.smartregister.domain.db.Event; import org.smartregister.domain.db.Obs; @@ -104,4 +105,23 @@ public void testEventToVisit() throws JSONException { Assert.assertEquals(visit.getVisitDetails().size(), 2); } + @Test + public void getAncMemberProfileImageReturnsCorrectResourceIdentifier() { + int ancImageResourceIdentifier = R.drawable.anc_woman; + Assert.assertEquals(ancImageResourceIdentifier, NCUtils.getAncMemberProfileImageResourceIdentifier()); + } + + @Test + public void getPncemberProfileImageReturnsCorrectResourceIdentifier() { + int pncImageResourceIdentifier = R.drawable.pnc_woman; + Assert.assertEquals(pncImageResourceIdentifier, NCUtils.getPncMemberProfileImageResourceIdentifier()); + } + + @Test + public void getMemberProfileImageReturnsCorrectResourceIDentifier() { + int memberImageResourceIdentifier = R.mipmap.ic_member; + String entityType = ""; + Assert.assertEquals(memberImageResourceIdentifier, NCUtils.getMemberProfileImageResourceIDentifier(entityType)); + } + } diff --git a/opensrp-chw-pnc/build.gradle b/opensrp-chw-pnc/build.gradle index 0497cb00..cc58a8f1 100644 --- a/opensrp-chw-pnc/build.gradle +++ b/opensrp-chw-pnc/build.gradle @@ -87,7 +87,7 @@ allprojects { } dependencies { - implementation('org.smartregister:opensrp-client-core:1.7.16-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-core:1.7.22-SNAPSHOT@aar') { transitive = true exclude group: 'com.github.bmelnychuk', module: 'atv' exclude group: 'com.google.guava', module: 'guava' @@ -116,7 +116,7 @@ dependencies { exclude group: 'com.android.support', module: 'appcompat-v7' } - implementation('org.smartregister:opensrp-client-chw-anc:0.1.27-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-chw-anc:0.1.28-SNAPSHOT@aar') { transitive = true exclude group: 'org.smartregister', module: 'opensrp-client-core' exclude group: 'com.android.support', module: 'appcompat-v7' diff --git a/opensrp-chw-pnc/gradle.properties b/opensrp-chw-pnc/gradle.properties index 55d31617..35e3fbd9 100644 --- a/opensrp-chw-pnc/gradle.properties +++ b/opensrp-chw-pnc/gradle.properties @@ -1,5 +1,5 @@ POM_SETTING_NAME=OpenSRP Client Chw Pnc POM_SETTING_ARTIFACT_ID=opensrp-client-chw-pnc POM_SETTING_PACKAGING=aar -VERSION_NAME=0.0.18-SNAPSHOT +VERSION_NAME=0.0.19-SNAPSHOT VERSION_CODE=1 \ No newline at end of file diff --git a/opensrp-chw-pnc/src/main/java/org/smartregister/chw/pnc/activity/BasePncMemberProfileActivity.java b/opensrp-chw-pnc/src/main/java/org/smartregister/chw/pnc/activity/BasePncMemberProfileActivity.java index 4e41c167..bbea6c6e 100644 --- a/opensrp-chw-pnc/src/main/java/org/smartregister/chw/pnc/activity/BasePncMemberProfileActivity.java +++ b/opensrp-chw-pnc/src/main/java/org/smartregister/chw/pnc/activity/BasePncMemberProfileActivity.java @@ -60,7 +60,7 @@ public void setMemberGA(String memberGA) { public void setProfileImage(String baseEntityId, String entityType) { String pncDay = basePncMemberProfileInteractor.getPncDay(MEMBER_OBJECT.getBaseEntityId()); if(Integer.parseInt(pncDay) >= 29){ - imageRenderHelper.refreshProfileImage(baseEntityId, imageView, NCUtils.getMemberProfileImageResourceIDentifier(entityType)); + imageRenderHelper.refreshProfileImage(baseEntityId, imageView, NCUtils.getPncMemberProfileImageResourceIdentifier()); } else { imageRenderHelper.refreshProfileImage(baseEntityId, imageView, R.drawable.pnc_less_twenty_nine_days); diff --git a/opensrp-chw-pnc/src/main/res/drawable/pnc_woman.png b/opensrp-chw-pnc/src/main/res/drawable/pnc_woman.png new file mode 100644 index 00000000..de6e7206 Binary files /dev/null and b/opensrp-chw-pnc/src/main/res/drawable/pnc_woman.png differ diff --git a/sample/build.gradle b/sample/build.gradle index e211be87..1b45e55d 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -79,7 +79,7 @@ android { } dependencies { - implementation('org.smartregister:opensrp-client-core:1.7.16-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-core:1.7.22-SNAPSHOT@aar') { transitive = true exclude group: 'com.github.bmelnychuk', module: 'atv' exclude group: 'com.google.guava', module: 'guava'