Skip to content

Commit

Permalink
finished reports, fixed nav problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelford24 authored and Samuelford24 committed Apr 15, 2021
1 parent e201506 commit f11cb12
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.sf.stormwaterutilityandroid.WaterWay.WaterWay;
import com.sf.stormwaterutilityandroid.WaterWay.WaterWayReport;

import java.io.Serializable;
import java.util.List;

public class ReportAdapter extends RecyclerView.Adapter<ReportAdapter.MyHolder>{
Expand Down Expand Up @@ -40,7 +41,7 @@ public void onBindViewHolder(ReportAdapter.MyHolder holder, final int position)
@Override
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), WaterwayReportDetail.class);
intent.putExtra("report",data);
intent.putExtra("report",new WaterWayReport(data.getH_date(),data.getH_inspector_name(),data.getH_site_name(),data.getTimeStamp(),data.getBoolFields(),data.getDoubleFields(),data.getStringFields()));
v.getContext().startActivity(intent);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@


public class WaterWayFormFragment extends Fragment {

//Gen Form Variable Initialization
String nameOfInspector = "";
String nameOfSite = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ public class WaterWayNav extends AppCompatActivity {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.navigation_home:
case R.id.waterWayHome:
System.out.println("Print");
// mTextMessage.setText(R.string.title_home);
fm.beginTransaction().hide(active).show(fragment1).commit();

active = fragment1;
fm.popBackStack();
return true;
case R.id.waterWayReports:
System.out.println("Print");
// mTextMessage.setText(R.string.title_dashboard);
fm.beginTransaction().hide(active).show(fragment2).commit();
active = fragment2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ public WaterWayReport(String h_date, String h_inspector_name, String h_site_name
this.doubleFields = doubleFields;
this.stringFields = stringFields;
}
public WaterWayReport(String h_date, String h_inspector_name, String h_site_name, Date sortTimeStamp, Map<String, Boolean> boolFields, Map<String, Double> doubleFields, Map<String, String> stringFields) {
H_date = h_date;
H_inspector_name = h_inspector_name;
H_site_name = h_site_name;
timeStamp = sortTimeStamp;

this.boolFields = boolFields;
this.doubleFields = doubleFields;
this.stringFields = stringFields;
}

public Date getTimeStamp() {
return timeStamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@


public class WaterWayReportFragment extends Fragment {
public WaterWayReportFragment() {
}

private EditText searchBar;//TODO: Make a search bar later?
private RecyclerView recyclerView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_waterway_report_detail);
wp = (WaterWayReport) getIntent().getSerializableExtra("report");
listView.
listView = findViewById(R.id.listView);
String[] labels =
{"Chemical (WQI): ",
"Biological (PTI): ",
Expand Down

0 comments on commit f11cb12

Please sign in to comment.