Skip to content

Commit

Permalink
added data fetching to the form functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
will2312 committed Mar 22, 2021
1 parent b2e1d14 commit f19c6c6
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ public class DryWeatherScreening extends AppCompatActivity{

private FormBuilder formBuilder;
private RecyclerView recyclerView;

String flowVal = "";
String odorVal = "";
String colorVal = "";
String polutantsVal = "";
String obstructionVal = "";
String maintenanceVal = "";
String screenVal = "";

FormElementTextEmail element11;
//I assume onCreate is important so I will leave it unchanged
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -42,24 +51,31 @@ private void setupForm() {
//Outfall --> Question: How do you do a subheading?
FormElementTextSingleLine flow = new FormElementTextSingleLine().setTitle("Presence of Flow");
FormElementTextNumber flowData = FormElementTextNumber.createInstance(); //what data type is this?
flowVal = flowData.getValue();

FormElementTextSingleLine odor = new FormElementTextSingleLine().setTitle("Unusual Odor");
FormElementTextNumber odorData = FormElementTextNumber.createInstance();
odorVal = odorData.getValue();

FormElementTextSingleLine color = new FormElementTextSingleLine().setTitle("Unusual Color");
FormElementTextNumber colorData = FormElementTextNumber.createInstance();
colorVal = colorData.getValue();

FormElementTextSingleLine polutants = new FormElementTextSingleLine().setTitle("Polutants Nearby");
FormElementTextNumber polutantsData = FormElementTextNumber.createInstance();
polutantsVal = polutantsData.getValue();

FormElementTextSingleLine obstruction = new FormElementTextSingleLine().setTitle("Obstruction");
FormElementTextNumber obstructionData = FormElementTextNumber.createInstance();
obstructionVal = obstructionData.getValue();

FormElementTextSingleLine maintenance = new FormElementTextSingleLine().setTitle("Needs Maintenance");
FormElementTextNumber maintenanceData = FormElementTextNumber.createInstance();
maintenanceVal = maintenanceData.getValue();

FormElementTextSingleLine screen = new FormElementTextSingleLine().setTitle("Screen OK");
FormElementTextNumber screenData = FormElementTextNumber.createInstance();
screenVal = screenData.getValue();

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,22 @@
public class ChemicalTesting extends AppCompatActivity{
private FormBuilder formBuilder;
private RecyclerView recyclerView;

double tempVal = 0.0;
double turbidityVal = 0.0;
double phVal = 0.0;
double nitrateVal = 0.0;
double phosphateVal = 0.0;
double oxygenVal = 0.0;
double coliVal = 0.0;
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);
Expand All @@ -45,30 +58,39 @@ private void setupForm() {
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());

FormElementTextSingleLine tubidity = new FormElementTextSingleLine().setTitle("Tubidity (NTU)");
FormElementTextNumber tubidityData = FormElementTextNumber.createInstance();
turbidityVal = Double.parseDouble(tubidityData.getValue());

FormElementTextSingleLine pH = new FormElementTextSingleLine().setTitle("pH");
FormElementTextNumber pHData = FormElementTextNumber.createInstance();
phVal = Double.parseDouble(pHData.getValue());

FormElementTextSingleLine nitrate = new FormElementTextSingleLine().setTitle("Nitrate (mg/L)");
FormElementTextNumber nitrateData = FormElementTextNumber.createInstance();
nitrateVal = Double.parseDouble(nitrateData.getValue());

FormElementTextSingleLine phosphate = new FormElementTextSingleLine().setTitle("Total Phosphate (mg/L)");
FormElementTextNumber phosphateData = FormElementTextNumber.createInstance();
phosphateVal = Double.parseDouble(nitrateData.getValue());

FormElementTextSingleLine oxygen = new FormElementTextSingleLine().setTitle("Dissolved Oxygen (mg/L)");
FormElementTextNumber oxygenData = FormElementTextNumber.createInstance();
oxygenVal = Double.parseDouble(oxygenData.getValue());

FormElementTextSingleLine coli = new FormElementTextSingleLine().setTitle("E Coli (col/100mL)");
FormElementTextNumber coliData = FormElementTextNumber.createInstance();
coliVal = Double.parseDouble(coliData.getValue());

FormElementTextSingleLine other1 = new FormElementTextSingleLine().setTitle("Other 1");
FormElementTextNumber other1Data = FormElementTextNumber.createInstance();
other1Val = Double.parseDouble(other1Data.getValue());

FormElementTextSingleLine other2 = new FormElementTextSingleLine().setTitle("Other 2");
FormElementTextNumber other2Data = FormElementTextNumber.createInstance();
other2Val = Double.parseDouble(other2.getValue());

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

Expand Down

0 comments on commit f19c6c6

Please sign in to comment.