Skip to content

Commit

Permalink
fixed problems
Browse files Browse the repository at this point in the history
  • Loading branch information
will2312 committed Mar 28, 2021
1 parent 87264ef commit 6b88870
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,47 +44,56 @@ public class DryWeatherScreening extends AppCompatActivity{
boolean needMaintenance = false;
boolean screenOK = false;

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);
List<BaseFormElement> formItems = new ArrayList<>();

FormHeader title = (FormHeader) new FormHeader().setTitle("Dry Weather Screening");
formItems.add(title);

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

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

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

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

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

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

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

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

formItems.add(flow);
formItems.add(odor);
formItems.add(color);
formItems.add(polutants);
formItems.add(obstruction);
formItems.add(maintenance);
formItems.add(screen);


formBuilder.addFormElements(formItems);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.sf.stormwaterutilityandroid;
package com.sf.stormwaterutilityandroid.WaterWay;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;

import com.sf.stormwaterutilityandroid.R;

import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -37,17 +39,14 @@ public class ChemicalTesting extends AppCompatActivity{
double other1Val = 0.0;
double other2Val = 0.0;

FormElementTextEmail element11;
@Override
//I assume onCreate is important so I will leave it unchanged


protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_sample_fordm);
recyclerView = findViewById(R.id.recyclerView2);
recyclerView = findViewById(R.id.recyclerView2);
setupForm();
}

private void setupForm() {
formBuilder = new FormBuilder(this, recyclerView);

Expand All @@ -56,7 +55,6 @@ private void setupForm() {
//Outfall --> Question: How do you do a subheading?

FormElementTextSingleLine temperature = new FormElementTextSingleLine().setTitle("Temperature (C) Change");
//FormHeader temp = FormHeader.createInstance("Temperature (C) Change");
FormElementTextNumber tempData = FormElementTextNumber.createInstance(); //what data type is this?
tempVal = Double.parseDouble(tempData.getValue());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,35 +44,54 @@ public class General extends AppCompatActivity{
String channelBottomWidth = "";
String receivingWater = "";

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_sample_fordm);
recyclerView = findViewById(R.id.recyclerView2);
setupForm();
}

private void setupForm() {
List<BaseFormElement> formItems = new ArrayList<>();

FormHeader title = (FormHeader) new FormHeader().setTitle("Report");
formItems.add(title);

FormElementTextSingleLine name = FormElementTextSingleLine.createInstance().setTitle("Name of Inspector").setValue("");
nameOfInspector = name.getValue();
formItems.add(name);

FormElementTextSingleLine site = FormElementTextSingleLine.createInstance().setTitle("Name of site").setValue("");
nameOfSite = site.getValue();
formItems.add(site);

FormElementPickerDate date = FormElementPickerDate.createInstance().setTitle("Date Row").setDateFormat("XX-XX-XXXX").setValue("");
dateRow = date.getValue();
formItems.add(date);

FormElementTextSingleLine outfallValue = FormElementTextSingleLine.createInstance().setTitle("Outfall").setValue("0");
outfall = Double.parseDouble(outfallValue.getValue());
formItems.add(outfallValue);

FormElementTextSingleLine longitudeValue = FormElementTextSingleLine.createInstance().setTitle("Longitude").setValue("0");
longitude = Double.parseDouble(longitudeValue.getValue());
formItems.add(longitudeValue);

FormElementTextSingleLine latitudeValue = FormElementTextSingleLine.createInstance().setTitle("Latitude").setValue("0");
latitude = Double.parseDouble(latitudeValue.getValue());
formItems.add(latitudeValue);

FormElementTextSingleLine invertElevationValue = FormElementTextSingleLine.createInstance().setTitle("Invert Elevation").setValue("0");
invertElevation = Double.parseDouble(invertElevationValue.getValue());
formItems.add(invertElevationValue);

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

List<String> pipeSizeOptions = new ArrayList<String>();
pipeSizeOptions.add("4\"");
Expand All @@ -88,6 +107,7 @@ private void setupForm() {
pipeSizeOptions.add("36\"");
FormElementPickerMulti pipeSizeValue = FormElementPickerMulti.createInstance().setTitle("Pipe Size").setOptions(pipeSizeOptions);
pipeSize = pipeSizeValue.getValue();
formItems.add(pipeSizeValue);

List<String> channelWidthOptions = new ArrayList<String>();
channelWidthOptions.add("2\"");
Expand All @@ -103,6 +123,7 @@ private void setupForm() {
FormElementPickerMulti channelBottomWidthValue = FormElementPickerMulti.createInstance().setTitle("Channel Bottom Width")
.setOptions(channelWidthOptions);
channelBottomWidth = channelBottomWidthValue.getValue();
formItems.add(channelBottomWidthValue);

List<String> receivingWaterOptions = new ArrayList<String>();
receivingWaterOptions.add("Turkey Creek");
Expand All @@ -117,6 +138,7 @@ private void setupForm() {

FormElementPickerMulti receiving = FormElementPickerMulti.createInstance().setTitle("Receiving Water").setOptions(receivingWaterOptions);
receivingWater = receiving.getValue();
formItems.add(receiving);
}

public String getName() {
Expand Down

0 comments on commit 6b88870

Please sign in to comment.