Skip to content

Commit

Permalink
Switched most text fields to pickers
Browse files Browse the repository at this point in the history
  • Loading branch information
will2312 committed Mar 28, 2021
1 parent 60ec652 commit ca14a7a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,30 @@ private void setupForm() {
formBuilder = new FormBuilder(this, recyclerView);
FormHeader title = (FormHeader) new FormHeader().setTitle("Dry Weather Screening");

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

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

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

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

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ public class General {

String comments = "";

/*protected void onCreate(Bundle savedInstanceState) {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_fordm);
recyclerView = findViewById(R.id.recyclerView2);
setupForm();
}*/
}

private void setupForm() {
formBuilder = new FormBuilder(this, recyclerView);
Expand Down Expand Up @@ -81,27 +82,64 @@ private void setupForm() {
FormElementTextSingleLine invertElevationValue = FormElementTextSingleLine.createInstance().setTitle("Invert Elevation").setValue("0");
invertElevation = Double.parseDouble(invertElevationValue.getValue());

FormElementTextSingleLine typeValue = FormElementTextSingleLine.createInstance().setTitle("Type").setValue("");
List<String> pipeTypeOptions = new ArrayList<String>();
pipeTypeOptions.add("Enclosed Pipe");
pipeTypeOptions.add("Open Channel");
FormElementPickerSingle typeValue = FormElementPickerSingle.createInstance().setTitle("Type").setOptions(pipeTypeOptions);
type = typeValue.getValue();

FormElementTextSingleLine pipeSizeValue = FormElementTextSingleLine.createInstance().setTitle("Pipe Size").setValue("");
List<String> pipeSizeOptions = new ArrayList<String>();
pipeSizeOptions.add("4\"");
pipeSizeOptions.add("6\"");
pipeSizeOptions.add("8\"");
pipeSizeOptions.add("10\"");
pipeSizeOptions.add("12\"");
pipeSizeOptions.add("14\"");
pipeSizeOptions.add("16\"");
pipeSizeOptions.add("18\"");
pipeSizeOptions.add("20\"");
pipeSizeOptions.add("24\"");
pipeSizeOptions.add("36\"");
FormElementPickerSingle pipeSizeValue = FormElementPickerSingle.createInstance().setTitle("Pipe Size").setOptions(pipeSizeOptions);
pipeSize = pipeSizeValue.getValue();

FormElementTextSingleLine channelBottomWidthValue = FormElementTextSingleLine.createInstance().setTitle("Channel Bottom Width")
.setValue("");
List<String> channelWidthOptions = new ArrayList<String;
channelWidthOptions.add("2\"");
channelWidthOptions.add("4\"");
channelWidthOptions.add("6\"");
channelWidthOptions.add("8\"");
channelWidthOptions.add("10\"");
channelWidthOptions.add("12\"");
channelWidthOptions.add("14\"");
channelWidthOptions.add("16\"");
channelWidthOptions.add("18\"");
channelWidthOptions.add("20\"");
FormElementPickerSingle channelBottomWidthValue = FormElementPickerSingle.createInstance().setTitle("Channel Bottom Width")
.setOptions(channelWidthOptions);
channelBottomWidth = channelBottomWidthValue.getValue();

FormElementTextSingleLine receiving = FormElementTextSingleLine.createInstance().setTitle("Receiving Water").setValue("");
List<String> receivingWaterOptions = new ArrayList<String>();
receivingWaterOptions.add("Turkey Creek");
receivingWaterOptions.add("Deep River");
receivingWaterOptions.add("Un-Named Tributary");
receivingWaterOptions.add("Spring Run Ditch");
receivingWaterOptions.add("Hart Ditch");
receivingWaterOptions.add("Coffee Creek");
receivingWaterOptions.add("Niles Ditch");
receivingWaterOptions.add("Beaver Dam Ditch");
receivingWaterOptions.add("Kaiser Ditch");

FormElementPickerSingle receiving = FormElementPickerSingle.createInstance().setTitle("Receiving Water").setOptions(receivingWaterOptions);
receivingWater = receiving.getValue();

/*
FormElementTextSingleLine routine = FormElementTextSingleLine.createInstance().setTitle("Routine Evaluation").setValue("");
routineEvaluation = routine.getValue();
FormElementTextSingleLine complaint = FormElementTextSingleLine.createInstance().setTitle("Complaint Investigation").setValue("");
complaintInvestigation = complaint.getValue();
FormElementTextSingleLine commentsValue = FormElementTextSingleLine.createInstance().setTitle("Comments").setValue("");
comments = commentsValue.getValue();
comments = commentsValue.getValue();*/
}

public String getName() {
Expand Down Expand Up @@ -148,7 +186,7 @@ public String getReceivingWater() {
return receivingWater;
}

public String getRoutineEvaluation() {
/*public String getRoutineEvaluation() {
return routineEvaluation;
}
Expand All @@ -158,5 +196,5 @@ public String getComplaintInvestigation() {
public String getComments() {
return comments;
}
}*/
}

0 comments on commit ca14a7a

Please sign in to comment.