From eb6bc504b1fa8ec73b64661262417ab38f05288f Mon Sep 17 00:00:00 2001 From: LZRS <12814349+LZRS@users.noreply.github.com> Date: Wed, 27 Oct 2021 18:40:09 +0300 Subject: [PATCH] LMH1-73: grey out save for family member forms --- .../chw/activity/FamilyProfileActivity.java | 27 +++++++++++++++++++ .../chw/activity/FamilyRegisterActivity.java | 2 -- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyProfileActivity.java b/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyProfileActivity.java index 628bbcc938..7b4c08e3d7 100644 --- a/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyProfileActivity.java +++ b/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyProfileActivity.java @@ -12,7 +12,11 @@ import androidx.fragment.app.Fragment; import androidx.viewpager.widget.ViewPager; +import com.vijay.jsonwizard.domain.Form; + import org.joda.time.DateTime; +import org.json.JSONObject; +import org.smartregister.chw.R; import org.smartregister.chw.anc.activity.BaseAncMemberProfileActivity; import org.smartregister.chw.anc.domain.MemberObject; import org.smartregister.chw.application.ChwApplication; @@ -254,4 +258,27 @@ public void goToChildProfileActivity(CommonPersonObjectClient patient, Bundle bu intent.putExtra(org.smartregister.chw.anc.util.Constants.ANC_MEMBER_OBJECTS.MEMBER_PROFILE_OBJECT, memberObject); startActivity(intent); } + + @Override + public Form getFormConfig() { + Form currentConfig = new Form(); + if (ChwApplication.getApplicationFlavor().hideFamilyRegisterPreviousNextIcons()){ + currentConfig.setHidePreviousIcon(true); + currentConfig.setHideNextIcon(true); + } + if (ChwApplication.getApplicationFlavor().showFamilyRegisterNextInToolbar()){ + currentConfig.setHideNextButton(true); + currentConfig.setNextLabel(getString(R.string.next)); + currentConfig.setShowNextInToolbarWhenWizard(true); + + currentConfig.setGreyOutSaveWhenFormInvalid(true); + } + currentConfig.setGreyOutSaveWhenFormInvalid(ChwApplication.getApplicationFlavor().greyOutFormActionsIfInvalid()); + return currentConfig; + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + super.startFormActivity(jsonForm); + } } diff --git a/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyRegisterActivity.java b/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyRegisterActivity.java index bc1d1a334d..c5e346a40b 100644 --- a/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyRegisterActivity.java +++ b/opensrp-chw/src/main/java/org/smartregister/chw/activity/FamilyRegisterActivity.java @@ -79,8 +79,6 @@ public Form getFormConfig() { currentConfig.setHideNextButton(true); currentConfig.setNextLabel(getString(R.string.next)); currentConfig.setShowNextInToolbarWhenWizard(true); - - currentConfig.setGreyOutSaveWhenFormInvalid(true); } currentConfig.setGreyOutSaveWhenFormInvalid(ChwApplication.getApplicationFlavor().greyOutFormActionsIfInvalid()); return currentConfig;