Skip to content

Commit

Permalink
working on report page
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelford24 authored and Samuelford24 committed Apr 15, 2021
1 parent cd52021 commit 4043c44
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void onBindViewHolder(ReportAdapter.MyHolder holder, final int position)
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), WaterwayReportDetail.class);
intent.putExtra("report",data);
v.getContext().startActivity(int);
v.getContext().startActivity(intent);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,98 +48,7 @@

public class WaterWayFormFragment extends Fragment {
//Gen Form Variable Initialization
String nameOfInspector = "";
String nameOfSite = "";
String dateRow = "";

String outfall = "";
String longitude = "";
String latitude = "";
String invertElevation = "";

String type = "";
String pipeSize = "";
String channelBottomWidth = "";
String receivingWater = "";

//DWS Form Variable Initialization
String flowVal = "";
String odorVal = "";
String colorVal = "";
String polutantsVal = "";
String obstructionVal = "";
String maintenanceVal = "";
String screenVal = "";
boolean flowPres = false;
boolean odorPres = false;
boolean colorPres = false;
boolean polutantsPres = false;
boolean obstructionPres = false;
boolean needMaintenance = false;
//CT Form Variable Initialization
double tempVal = 0;
double turbidityVal = 0;
double phVal = 0;
double nitrateVal = 0;
double phosphateVal = 0;
double oxygenVal = 0;
double coliVal = 0;
String other1Val = "";
String other2Val = "";

//HQ Form Variable Initialization
String sub = "";
String smoth = "";
String silt = "";
String rootString = "";
String overVeg = "";
String ox = "";
String down = "";
String shallow = "";
String wat = "";
String deep = "";
String log = "";
String bould = "";
String under = "";
String sin = "";
String nat = "";
String rip = "";
String land = "";
String bank = "";
String stream = "";
String deepest = "";
String velocity = "";
String riffleDepthVar = "";
String riffleSubstrateVar = "";
boolean screenOK = false;
double subVal = 0.0;
double smothVal = 0.0;
double siltVal = 0.0;
double rootVal = 0.0;
double overVegVal = 0.0;
double oxVal = 0.0;
double downVal = 0.0;
double shallowVal = 0.0;
double watVal = 0.0;
double deepVal = 0.0;
double logVal = 0.0;
double bouldVal = 0.0;
double underVal = 0.0;
double sinVal = 0.0;
double natVal = 0.0;
double ripVal = 0.0;
double landVal = 0.0;
double bankVal = 0.0;
double streamVal = 0.0;
double deepestVal = 0.0;
double velocityVal = 0.0;
double riffleDepthVal = 0.0;
double riffleSubstrateVal = 0.0;
//Tolerant Form
double intolerantVal = 0.0;
double modTolerantVal = 0.0;
double fairTolerantVal = 0.0;
double veryTolerantVal = 0.0;

RecyclerView rvGen, rvDWS, rvHQ, rvBM,rvCT;
FormBuilder fbGEn,fbDWS,fbBM,fbHQ,fbCT;
SegmentedButton gen,dws,ct,bm,hq;
Expand Down Expand Up @@ -198,6 +107,7 @@ public void onClick(View v) {
Map<String, String> WaterWayStringFields = new HashMap<String, String>();

//Water Quality Index Data
WaterWayDoubleFields.put("CT_E_coli",formItemsCT.get());
WaterWayDoubleFields.put("CT_temperature_change",tempVal );
WaterWayDoubleFields.put("CT_turbidity", turbidityVal);
WaterWayDoubleFields.put("CT_pH", phVal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import android.os.Bundle;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.EventListener;
Expand All @@ -22,6 +24,7 @@
public class WaterwayReportDetail extends AppCompatActivity {
WaterWayReport wp;
ArrayList<String> s = new ArrayList<>();
ListView listView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -111,14 +114,55 @@ protected void onCreate(Bundle savedInstanceState) {
s.add(labels[17] + wp.getBoolFields().get("DWS_polutants"));
s.add(labels[18] + wp.getBoolFields().get("DWS_obstruction"));
s.add(labels[19] + wp.getBoolFields().get("DWS_needs_maintenance"));
s.add(labels[20] + wp.getBoolFields().get("DWS_needs_maintenance"));
s.add(labels[21] + wp.getBoolFields().get("DWS_needs_maintenance"));
s.add(labels[22] + wp.getBoolFields().get("DWS_needs_maintenance"));
s.add(labels[23] + wp.getBoolFields().get("DWS_needs_maintenance"));
s.add(labels[24] + wp.getBoolFields().get("DWS_needs_maintenance"));
s.add(labels[25] + wp.getBoolFields().get("DWS_needs_maintenance"));
s.add(labels[20] + wp.getBoolFields().get("DWS_screened_OK"));
s.add(labels[21] + wp.getBoolFields().get("FC_routine_evaluation"));
s.add(labels[22] + wp.getBoolFields().get( "FC_complaint_investigation"));
s.add(labels[23] + wp.getBoolFields().get("FC_illicit_discharge_detected"));
s.add(labels[24] + wp.getBoolFields().get("FC_no_illicit_discharge_detected"));
s.add(labels[25] + wp.getBoolFields().get("FC_further_action_needed"));
s.add(labels[26] + wp.getDoubleFields().get("CT_temperature_change"));
s.add(labels[27] + wp.getDoubleFields().get("CT_turbidity"));
s.add(labels[28] + wp.getDoubleFields().get("CT_pH"));
s.add(labels[29] + wp.getDoubleFields().get("CT_nitrate"));
s.add(labels[30] + wp.getDoubleFields().get("CT_total_phosphate"));
s.add(labels[31] + wp.getDoubleFields().get("CT_dissolved_oxygen"));
s.add(labels[32] + wp.getDoubleFields().get("CT_E_coli"));
s.add(labels[33] + wp.getDoubleFields().get("FC_further_action_needed"));
s.add(labels[34]+wp.getStringFields().get("CT_other_1"));
s.add(labels[35]+wp.getStringFields().get("CT_other_2"));
s.add(labels[36]+ wp.getDoubleFields().get("BM_intolerant"));
s.add(labels[37] + wp.getStringFields().get("BM_moderately_tolerant"));
s.add(labels[38] + wp.getStringFields().get("BM_fairly_tolerant"));
s.add(labels[39] + wp.getStringFields().get("BM_very_tolerant"));
s.add(labels[40] + wp.getStringFields().get("QHEI_substrate_size"));
s.add(labels[41] + wp.getStringFields().get("QHEI_smothering"));
s.add(labels[42] + wp.getStringFields().get("QHEI_silting"));
s.add(labels[43] + wp.getStringFields().get("QHEI_rootwads"));
s.add(labels[44] + wp.getStringFields().get("QHEI_overhanging_veg"));
s.add(labels[45] + wp.getStringFields().get("QHEI_oxbowsblack_waters"));
s.add(labels[46] + wp.getStringFields().get("QHEI_downed_treeslogs"));
s.add(labels[47] + wp.getStringFields().get("QHEI_shallows"));
s.add(labels[48] + wp.getStringFields().get("QHEI_water_plants"));
s.add(labels[49] + wp.getStringFields().get("QHEI_deep_pools"));
s.add(labels[50] + wp.getStringFields().get("QHEI_logswoody_debris"));
s.add(labels[51] + wp.getStringFields().get("QHEI_boulders"));
s.add(labels[52] + wp.getStringFields().get("QHEI_undercut_banks"));
s.add(labels[53] + wp.getStringFields().get("QHEI_sinuosity"));
s.add(labels[54] + wp.getStringFields().get("QHEI_riparian_width"));
s.add(labels[55] + wp.getStringFields().get("QHEI_land_use"));
s.add(labels[56] + wp.getStringFields().get("QHEI_bank_erosion"));
s.add(labels[57] + wp.getStringFields().get("QHEI_stream_shading"));
s.add(labels[58] + wp.getStringFields().get("QHEI_deepest_pool"));
s.add(labels[59] + wp.getStringFields().get("QHEI_velocity"));
s.add(labels[60] + wp.getStringFields().get("QHEI_rifflerun_depth"));
s.add(labels[61] + wp.getStringFields().get("QHEI_rifflerun_substrate"));
s.add(labels[62] + wp.getStringFields().get("CS_comments"));
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, android.R.id.text1, s);


// Assign adapter to ListView
listView.setAdapter(adapter);

}
}
8 changes: 8 additions & 0 deletions app/src/main/res/layout/activity_waterway_report_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@
android:layout_height="match_parent"
tools:context=".WaterwayReportDetail">

<ListView
android:id="@+id/listView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 4043c44

Please sign in to comment.