feature/apk_versioning_mechanism #7
@ -2,7 +2,6 @@ package com.safemobile.dispatch;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
@ -14,9 +13,14 @@ import com.google.android.gms.maps.CameraUpdateFactory;
|
||||
import com.google.android.gms.maps.GoogleMap;
|
||||
import com.google.android.gms.maps.OnMapReadyCallback;
|
||||
import com.google.android.gms.maps.SupportMapFragment;
|
||||
import com.google.android.gms.maps.model.BitmapDescriptor;
|
||||
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.MarkerOptions;
|
||||
import com.google.android.gms.maps.model.Polyline;
|
||||
import com.google.android.gms.maps.model.PolylineOptions;
|
||||
import com.safemobile.lib.AppParams;
|
||||
import com.safemobile.lib.HistPos;
|
||||
import com.safemobile.lib.SM;
|
||||
import com.safemobile.lib.Vehicle;
|
||||
|
||||
@ -52,7 +56,6 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
|
||||
Locale locale = new Locale(AppParams.LANGUAGETMP);
|
||||
Locale.setDefault(locale);
|
||||
|
||||
// googleMap = parentTab.liveActivity.getMap();
|
||||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||
.findFragmentById(R.id.map);
|
||||
mapFragment.getMapAsync(this);
|
||||
@ -84,10 +87,25 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
|
||||
// return false;
|
||||
// });
|
||||
|
||||
parentTab.demoPositionsList();
|
||||
setDate();
|
||||
}
|
||||
|
||||
// parentTab.HistPosList
|
||||
private void displayHistory(ArrayList<HistPos> demoPositions) {
|
||||
LatLng latLng = new LatLng(demoPositions.get(0).lat, demoPositions.get(0).lng);
|
||||
PolylineOptions polylineOptions = new PolylineOptions();
|
||||
BitmapDescriptor markerIcon = BitmapDescriptorFactory.fromResource(R.drawable.bus);
|
||||
|
||||
for (HistPos pos : demoPositions) {
|
||||
latLng = new LatLng(pos.lat, pos.lng);
|
||||
polylineOptions.add(latLng);
|
||||
|
||||
googleMap.addMarker(new MarkerOptions()
|
||||
.position(latLng)
|
||||
.icon(markerIcon));
|
||||
}
|
||||
|
||||
Polyline polyline1 = googleMap.addPolyline(polylineOptions);
|
||||
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 14));
|
||||
}
|
||||
|
||||
private void setDate() {
|
||||
@ -173,11 +191,8 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
|
||||
public void onMapReady(@NonNull GoogleMap googleMap) {
|
||||
this.googleMap = googleMap;
|
||||
|
||||
// Add a marker in Sydney and move the camera
|
||||
LatLng sydney = new LatLng(-34, 151);
|
||||
this.googleMap.addMarker(new MarkerOptions()
|
||||
.position(sydney)
|
||||
.title("Marker in Sydney"));
|
||||
this.googleMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
|
||||
// replace this with parentTab.HistPosList
|
||||
parentTab.demoPositionsList();
|
||||
displayHistory(parentTab.demoPositions);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user