diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..c6e7f40 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +StormWaterUtilityAndroid \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5d437cc..1f7f4e7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -20,6 +20,7 @@ + diff --git a/app/src/main/java/com/sf/stormwaterutilityandroid/InspectionForm.java b/app/src/main/java/com/sf/stormwaterutilityandroid/InspectionForm.java new file mode 100644 index 0000000..d39429e --- /dev/null +++ b/app/src/main/java/com/sf/stormwaterutilityandroid/InspectionForm.java @@ -0,0 +1,128 @@ +package com.sf.stormwaterutilityandroid; + +import android.os.Bundle; +import android.widget.Button; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.recyclerview.widget.RecyclerView; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import me.riddhimanadib.formmaster.FormBuilder; +import me.riddhimanadib.formmaster.model.BaseFormElement; +import me.riddhimanadib.formmaster.model.FormElementPickerDate; +import me.riddhimanadib.formmaster.model.FormElementPickerMulti; +import me.riddhimanadib.formmaster.model.FormElementPickerSingle; +import me.riddhimanadib.formmaster.model.FormElementSwitch; +import me.riddhimanadib.formmaster.model.FormElementTextEmail; +import me.riddhimanadib.formmaster.model.FormElementTextMultiLine; +import me.riddhimanadib.formmaster.model.FormElementTextPhone; +import me.riddhimanadib.formmaster.model.FormElementTextSingleLine; +import me.riddhimanadib.formmaster.model.FormHeader; + +public class InspectionForm extends AppCompatActivity { + private FormBuilder formBuilder; + private RecyclerView recyclerView; + + @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); + + + + FormElementTextSingleLine projectTextField = FormElementTextSingleLine.createInstance().setTitle("Project/Contact:").setHint("Enter text here"); + FormElementTextSingleLine addressTextField = FormElementTextSingleLine.createInstance().setTitle("Address/Lot#(s):").setHint("Enter text here"); + FormElementTextSingleLine inspectorTextField = FormElementTextSingleLine.createInstance().setTitle("Inspector:").setHint("Enter name here"); + FormElementPickerDate dataInspectedDatePicker = FormElementPickerDate.createInstance().setTitle("Date Inspected:").setDateFormat("MMM dd, yyyy"); + + + List typeOptions = new ArrayList<>(Arrays.asList( + "Routine Evaluation", + "Re-Inspection", + "Complaint Investigation", + "Entire Development", + "Individual Building Lot(s)" + )); + FormElementPickerSingle inspectionTypePickerSingle = FormElementPickerSingle.createInstance().setTitle("Inspection type:").setOptions(typeOptions).setPickerTitle("Pick inspection type"); + + FormElementSwitch projectRepPresentSwitch = FormElementSwitch.createInstance().setTitle("Project Representative Present?").setSwitchTexts("Yes", "No"); + + FormHeader stakeholdersHeader = FormHeader.createInstance("THE FOLLOWING INDIVIDUALS BECAME AWARE OF ANY ISSUES THOUGH DISCUSSION AND REVIEW OF FINDINGS ON THE DAY OF INSPECTION:"); + FormElementTextSingleLine projectManagerTextField = FormElementTextSingleLine.createInstance().setTitle("Project Manager:").setHint("Enter name here"); + FormElementTextSingleLine siteManagerTextField = FormElementTextSingleLine.createInstance().setTitle("Site Manager:").setHint("Enter name here"); + FormElementTextSingleLine projectOwnerTextField = FormElementTextSingleLine.createInstance().setTitle("Project Owner").setHint("Enter name here"); + + + FormHeader correctiveActionsHeader = FormHeader.createInstance("CORRECTIVE ACTIONS REQUIRED\n***REDER TO APPROVED STORM WATER POLLUTION PREVENTION PLAN (SWP3) FOR SPECIFICATIONS AND DETAILS ON ITEMS BELOW***"); + List correctiveActionsOptions= new ArrayList<>(Arrays.asList( + "Post a laminated copy of completed 327IAC15-5 \"Rule 5\" NOI with permit number at a location visible to the public", + "Remove accumulated sediment from streets sidewalks and gutters (do not flush with water)", + "Install/maintain stable temporary construction entrances(s)", "Entire Development", + "Individual Building Lot(s)", + "Address silt fence issues which includes one or more of the following: Repair, install properly, Replace, Add (areas prone to sheet-flow erosion)", + "Install erosions and sediment control for individual building lot(s) as specified in the approved SWP3", + "Install check dam(s) according to specifications", + "Utilize appropriate construction sequence as specified in the approved SWP3", + "Remove sediment from one or more of the following: sediment traps, behind check dams, around storm drain inlets or/and other", + "Inform Contractors, subcontractors, material vendors, and others or erosion and sediment control requirements", + "Provide copy and self-monitoring inspection records to MS Coordinator within 48 hours", + "Acquire copy of Storm Water Pollution Prevention Plan and retain on project site for reference" + )); + FormElementPickerMulti correctiveActionsPickerMulti = FormElementPickerMulti.createInstance().setTitle("Corrective Actions").setOptions(correctiveActionsOptions).setPickerTitle("Pick corrective action"); + + FormElementTextMultiLine otherCorrectiveAction1TextField = FormElementTextMultiLine.createInstance().setTitle("Other 1:").setHint("Enter text here"); + FormElementTextMultiLine otherCorrectiveAction2TextField = FormElementTextMultiLine.createInstance().setTitle("Other 2:").setHint("Enter text here"); + FormElementTextMultiLine otherCorrectiveAction3TextField = FormElementTextMultiLine.createInstance().setTitle("Other 3:").setHint("Enter text here"); + + + FormHeader enforcementActionHeader = FormHeader.createInstance("ENFORCEMENT ACTIONS"); + List enforcementActionOptions = new ArrayList<>(Arrays.asList( + "Notice of Violation Issued", + "Stop Work Order Issued", + "Fine(s) Issued", + "Other" + )); + FormElementPickerSingle enforcementActionPickerSingle = FormElementPickerSingle.createInstance().setTitle("Inspection type:").setOptions(enforcementActionOptions).setPickerTitle("Pick inspection type"); + + FormElementTextMultiLine evidenceTextField = FormElementTextMultiLine.createInstance().setTitle("Evidence of off-site sediment/pollutants.\nHere is a description of type and location:").setHint("Enter text here"); + + List formItems = new ArrayList<>(); + + formItems.add(projectTextField); + formItems.add(addressTextField); + formItems.add(inspectorTextField); + formItems.add(dataInspectedDatePicker); + + formItems.add(inspectionTypePickerSingle); + formItems.add(projectRepPresentSwitch); + + formItems.add(stakeholdersHeader); + formItems.add(projectManagerTextField); + formItems.add(siteManagerTextField); + formItems.add(projectOwnerTextField); + + formItems.add(correctiveActionsHeader); + formItems.add(correctiveActionsPickerMulti); + formItems.add(otherCorrectiveAction1TextField); + formItems.add(otherCorrectiveAction2TextField); + formItems.add(otherCorrectiveAction3TextField); + + formItems.add(enforcementActionHeader); + formItems.add(enforcementActionPickerSingle); + + formItems.add(evidenceTextField); + + formBuilder.addFormElements(formItems); + + } +} diff --git a/app/src/main/java/com/sf/stormwaterutilityandroid/home/HomeFragment.java b/app/src/main/java/com/sf/stormwaterutilityandroid/home/HomeFragment.java index 7809a22..75b11d9 100644 --- a/app/src/main/java/com/sf/stormwaterutilityandroid/home/HomeFragment.java +++ b/app/src/main/java/com/sf/stormwaterutilityandroid/home/HomeFragment.java @@ -10,6 +10,7 @@ import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; +import com.sf.stormwaterutilityandroid.InspectionForm; import com.sf.stormwaterutilityandroid.R; import com.sf.stormwaterutilityandroid.SampleFordm; @@ -31,6 +32,15 @@ public void onClick(View view) { } }); + b1 = root.findViewById(R.id.button2); + b1.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(new Intent(getContext(), InspectionForm.class)); + } + }); + + //CHeck To5a.03 project for dealing saved instance state /* if (savedInstanceState != null) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 85a4fdb..381a669 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -46,4 +46,6 @@ Registered Successfully! An email has been sent to verify your email; this must be done before logging in. Sign in + + \ No newline at end of file