Skip to content

Commit

Permalink
LMH1-73: grey out save for family member forms
Browse files Browse the repository at this point in the history
  • Loading branch information
LZRS committed Oct 27, 2021
1 parent a86c3cb commit eb6bc50
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eb6bc50

Please sign in to comment.