Skip to content

Commit

Permalink
Fixed the valeus to booleans instead of doubles or integers
Browse files Browse the repository at this point in the history
  • Loading branch information
will2312 committed Mar 27, 2021
1 parent 4bd7003 commit 38316bf
Showing 1 changed file with 56 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ public class DryWeatherScreening extends AppCompatActivity{
String maintenanceVal = "";
String screenVal = "";

FormElementTextEmail element11;
boolean flowPres = false;
boolean odorPres = false;
boolean colorPres = false;
boolean polutantsPres = false;
boolean obstructionPres = false;
boolean needMaintenance = false;
boolean screenOK = false;


//I assume onCreate is important so I will leave it unchanged
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -50,24 +58,31 @@ private void setupForm() {

FormElementTextSingleLine flow = FormElementTextSingleLine.createInstance().setTitle("Presence of Flow").setValue("No");
flowVal = flow.getValue();
flowPres = convertToBoolean(flowVal);

FormElementTextSingleLine odor = FormElementTextSingleLine.createInstance().setTitle("Unusual Odor").setValue("No");
odorVal = odor.getValue();
odorPres = convertToBoolean(odorVal);

FormElementTextSingleLine color = FormElementTextSingleLine.createInstance().setTitle("Unusual Color").setValue("No");
colorVal = color.getValue();
colorPres = convertToBoolean(colorVal);

FormElementTextSingleLine polutants = FormElementTextSingleLine.createInstance().setTitle("Polutants Nearby");
FormElementTextSingleLine polutants = FormElementTextSingleLine.createInstance().setTitle("Polutants Nearby").setValue("No");
polutantsVal = polutants.getValue();
polutantsPres = convertToBoolean(polutantsVal)

FormElementTextSingleLine obstruction = FormElementTextSingleLine.createInstance().setTitle("Obstruction");
FormElementTextSingleLine obstruction = FormElementTextSingleLine.createInstance().setTitle("Obstruction").setValue("No");
obstructionVal = obstruction.getValue();
obstructionPres = convertToBoolean(obstructionVal);

FormElementTextSingleLine maintenance = FormElementTextSingleLine.createInstance().setTitle("Needs Maintenance");
FormElementTextSingleLine maintenance = FormElementTextSingleLine.createInstance().setTitle("Needs Maintenance").setValue("No");
maintenanceVal = maintenance.getValue();
needMaintenance = convertToBoolean(maintenanceVal);

FormElementTextSingleLine screen = FormElementTextSingleLine.createInstance().setTitle("Screen OK");
FormElementTextSingleLine screen = FormElementTextSingleLine.createInstance().setTitle("Screen OK").setValue("No");
screenVal = screen.getValue();
screenOK = convertToBoolean(screenVal);

List<BaseFormElement> formItems = new ArrayList<>();

Expand All @@ -81,4 +96,40 @@ private void setupForm() {

formBuilder.addFormElements(formItems);
}

public boolean getFlow() {
return flowPres;
}

public boolean getOdor() {
return odorPres;
}

public boolean getColor() {
return colorPres;
}

public boolean getPolutants() {
return polutantsPres;
}

public boolean getObstruction() {
return obstructionPres;
}

public boolean getMaintenance() {
return needMaintenance;
}

public boolean getScreen() {
return screenOK;
}

public boolean convertToBoolean(String s) {
if (s.compareTo("Yes") == 0) {
return true;
} else {
return false;
}
}
}

0 comments on commit 38316bf

Please sign in to comment.