This commit is contained in:
CiufudeanDani 2022-03-18 15:40:15 +02:00
parent 6b6543ca3f
commit 4420af337d
2 changed files with 303 additions and 623 deletions

View File

@ -21,6 +21,7 @@ import com.google.android.gms.maps.model.Polyline;
import com.google.android.gms.maps.model.PolylineOptions; import com.google.android.gms.maps.model.PolylineOptions;
import com.safemobile.lib.AppParams; import com.safemobile.lib.AppParams;
import com.safemobile.lib.HistPos; import com.safemobile.lib.HistPos;
import com.safemobile.lib.OperationCodes;
import com.safemobile.lib.SM; import com.safemobile.lib.SM;
import com.safemobile.lib.Vehicle; import com.safemobile.lib.Vehicle;
@ -38,6 +39,7 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
private Spinner spinnerVehicle; private Spinner spinnerVehicle;
private ImageView changeMapType, checkTraffic, slideLayoutImage; private ImageView changeMapType, checkTraffic, slideLayoutImage;
private LinearLayout layoutTraffic, slidelayout, layoutVehicles; private LinearLayout layoutTraffic, slidelayout, layoutVehicles;
private Date startDate, endDate;
private ArrayList<Vehicle> allVehicle = new ArrayList<>(); private ArrayList<Vehicle> allVehicle = new ArrayList<>();
private ArrayList<String> allVehicleNames = new ArrayList<>(); private ArrayList<String> allVehicleNames = new ArrayList<>();
@ -88,6 +90,9 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
// }); // });
setDate(); setDate();
parentTab.executeNetworkStuff(new String[] {OperationCodes.GetHistoryPositions + "", allVehicle.get(spinnerVehicle.getSelectedItemPosition()).sc_id + "",
(startDate.getTime()/ 1000L) + "", (endDate.getTime()/ 1000L) + ""});
} }
private void displayHistory(ArrayList<HistPos> demoPositions) { private void displayHistory(ArrayList<HistPos> demoPositions) {
@ -110,9 +115,9 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
private void setDate() { private void setDate() {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
Date endDate = calendar.getTime(); endDate = calendar.getTime();
calendar.add(Calendar.DATE, -1); calendar.add(Calendar.DATE, -1);
Date startDate = calendar.getTime(); startDate = calendar.getTime();
LinearLayout layoutStartPicker = findViewById(R.id.layoutStartPicker); LinearLayout layoutStartPicker = findViewById(R.id.layoutStartPicker);
TextView textViewDate = findViewById(R.id.textViewStartDate); TextView textViewDate = findViewById(R.id.textViewStartDate);