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