Skip to content

Commit

Permalink
Merge pull request #314 from OpenSRP/288-replace-person-avatars-for-a…
Browse files Browse the repository at this point in the history
…nc-pnc

Replace person avatars for ANC and PNC women
  • Loading branch information
allan-on authored Sep 23, 2019
2 parents 16dd039 + 93b8727 commit 365fe9e
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion opensrp-chw-anc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion opensrp-chw-anc/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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));
}

}
4 changes: 2 additions & 2 deletions opensrp-chw-pnc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion opensrp-chw-pnc/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 365fe9e

Please sign in to comment.