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 28, 2021
1 parent a86c3cb commit 5b4020b
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import android.view.View;
import android.widget.LinearLayout;

import com.vijay.jsonwizard.domain.Form;

import org.smartregister.chw.BuildConfig;
import org.smartregister.chw.R;
import org.smartregister.chw.application.ChwApplication;
Expand Down Expand Up @@ -174,4 +176,10 @@ public void setDueTodayServices() {
textViewDueToday.setVisibility(View.GONE);
}

@Override
public Form getForm() {
Form currentFormConfig = super.getForm();
currentFormConfig.setGreyOutSaveWhenFormInvalid(ChwApplication.getApplicationFlavor().greyOutFormActionsIfInvalid());
return currentFormConfig;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.vijay.jsonwizard.domain.Form;

import org.json.JSONObject;
import org.smartregister.chw.BuildConfig;
import org.smartregister.chw.R;
Expand Down Expand Up @@ -287,6 +289,13 @@ public void setLastVisitRowView(String days) {

}

@Override
public Form getForm() {
Form currentFormConfig = super.getForm();
currentFormConfig.setGreyOutSaveWhenFormInvalid(ChwApplication.getApplicationFlavor().greyOutFormActionsIfInvalid());
return currentFormConfig;
}

@Override
public void setFamilyHasNothingElseDue() {
layoutFamilyHasRow.setVisibility(View.VISIBLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public Form getFormConfig() {
currentConfig.setHideNextIcon(true);
currentConfig.setHidePreviousIcon(true);
}
currentConfig.setGreyOutSaveWhenFormInvalid(ChwApplication.getApplicationFlavor().greyOutFormActionsIfInvalid());
return currentConfig;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
import androidx.annotation.Nullable;
import androidx.viewpager.widget.ViewPager;

import com.vijay.jsonwizard.domain.Form;

import org.json.JSONObject;
import org.smartregister.chw.R;
import org.smartregister.chw.application.ChwApplication;
import org.smartregister.chw.core.activity.CoreFamilyOtherMemberProfileActivity;
import org.smartregister.chw.core.activity.CoreFamilyProfileActivity;
import org.smartregister.chw.core.form_data.NativeFormsDataBinder;
Expand Down Expand Up @@ -204,4 +207,11 @@ protected void startHfMalariaFollowupForm() {
protected void setIndependentClient(boolean isIndependentClient) {
super.isIndependent = isIndependentClient;
}

@Override
public Form getForm() {
Form currentFormConfig = super.getForm();
currentFormConfig.setGreyOutSaveWhenFormInvalid(ChwApplication.getApplicationFlavor().greyOutFormActionsIfInvalid());
return currentFormConfig;
}
}
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,25 @@ 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(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 5b4020b

Please sign in to comment.