Skip to content

Commit

Permalink
feature/Basic inspection form UI
Browse files Browse the repository at this point in the history
  • Loading branch information
IbrahimSaeedPurdue authored and IbrahimSaeedPurdue committed Feb 11, 2021
1 parent 5499e3a commit 365613b
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 0 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
</activity>
<activity android:name=".Reset_password"/>
<activity android:name=".SampleFordm"/>
<activity android:name=".InspectionForm"/>
<activity android:name=".Login"/>
<activity android:name=".SignUp"/>
</application>
Expand Down
128 changes: 128 additions & 0 deletions app/src/main/java/com/sf/stormwaterutilityandroid/InspectionForm.java
Original file line number Diff line number Diff line change
@@ -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<String> 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<String> 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<String> 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<BaseFormElement> 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);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@
<string name="registration_success">Registered Successfully! An email has been sent to verify your email; this must be done before logging in.</string>
<string name="title_activity_admin_fragment">Sign in</string>

<!-- Inspection form strings-->

</resources>

0 comments on commit 365613b

Please sign in to comment.