Compare commits

...

18 Commits

Author SHA1 Message Date
2855e9bde6 new credential generated 2022-03-23 13:33:54 +02:00
ee8bfe56b4 Merge pull request 'feature/icon_and_background' (#8) from feature/icon_and_background into develop
Reviewed-on: #8
2022-03-23 09:23:35 +00:00
d519a2be14 change app name 2022-03-23 11:12:20 +02:00
1b3912c682 change background image 2022-03-23 11:12:00 +02:00
ba9383248c chage icon 2022-03-23 10:56:09 +02:00
07127cea18 Merge pull request 'feature/apk_versioning_mechanism' (#7) from feature/apk_versioning_mechanism into develop
Reviewed-on: #7
2022-03-22 13:19:47 +00:00
6a235d1d3f merge with develop 2022-03-22 15:18:25 +02:00
bac12825c9 edit apk name 2022-03-22 15:10:29 +02:00
bbed107c42 get versionCode & name from tag 2022-03-22 12:11:08 +02:00
bca16caf94 new marker icon 2022-03-21 13:01:04 +02:00
0b887deb99 remove marker icon 2022-03-21 12:19:23 +02:00
c85dc279dc clean history activity 2022-03-21 11:58:34 +02:00
db360c4d45 speed limit 2022-03-21 11:50:52 +02:00
89f8cbfcae WIP 2022-03-18 23:12:20 +02:00
4420af337d cleanups 2022-03-18 15:40:15 +02:00
6b6543ca3f display test positions 2022-03-18 15:22:35 +02:00
f554356af1 small cleanups 2022-03-18 15:03:34 +02:00
0fabbc73be comment line in order to move vehicle 2022-03-17 15:13:25 +02:00
44 changed files with 611 additions and 787 deletions

0
gradlew vendored Normal file → Executable file
View File

View File

@ -19,6 +19,13 @@ android {
buildFeatures { buildFeatures {
viewBinding false viewBinding false
} }
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
//abortOnError false
}
} }
dependencies { dependencies {

View File

@ -6,7 +6,7 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@drawable/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:theme="@style/AppTheme" > android:theme="@style/AppTheme" >
</application> </application>

View File

@ -198,12 +198,11 @@ public abstract class AbstractSDParentActivity extends TabActivity {
return res; return res;
} }
public boolean getHistoryPositions(int sc_id, long timeGMTStart, long timeGMTStop) public boolean getHistoryPositions(int sc_id, long timeGMTStart, long timeGMTStop) {
{
if(tcp == null) if(tcp == null)
return false; return false;
String histSeqID = "1."+Integer.toString((int) (System.currentTimeMillis() / 1000L)); String histSeqID = "1."+ (int) (System.currentTimeMillis() / 1000L);
boolean res = tcp.Write(histSeqID,"#26#"+sc_id+"#"+timeGMTStart+"#"+timeGMTStop+"#"); boolean res = tcp.Write(histSeqID,"#26#"+sc_id+"#"+timeGMTStart+"#"+timeGMTStop+"#");
if(res) if(res)
SM.Debug("Message [getHistoryPositions] sent to app server"); SM.Debug("Message [getHistoryPositions] sent to app server");
@ -213,8 +212,7 @@ public abstract class AbstractSDParentActivity extends TabActivity {
return res; return res;
} }
public boolean getRadiosList() public boolean getRadiosList() {
{
if(tcp == null) if(tcp == null)
return false; return false;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,5 +1,24 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' apply plugin: 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
apply plugin: "com.gladed.androidgitversion"
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath "gradle.plugin.com.gladed.gradle.androidgitversion:gradle-android-git-version:0.4.3"
}
}
androidGitVersion {
codeFormat 'MNNBBBB'
format '%tag%%.count%'
hideBranches = ['develop']
}
android { android {
compileSdkVersion 31 compileSdkVersion 31
@ -9,6 +28,9 @@ android {
applicationId "com.safemobile.dispatch" applicationId "com.safemobile.dispatch"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 31 targetSdkVersion 31
versionName androidGitVersion.name()
versionCode androidGitVersion.code()
archivesBaseName = "SafeDispatchMobile_v.$versionName"
} }
buildTypes { buildTypes {
@ -20,6 +42,13 @@ android {
buildFeatures { buildFeatures {
viewBinding false viewBinding false
} }
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
//abortOnError false
}
} }
dependencies { dependencies {
implementation project(':libSafeMobile') implementation project(':libSafeMobile')

View File

@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.safemobile.dispatch",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 8000033,
"versionName": "8.0.33",
"outputFile": "SafeDispatchMobile_v.8.0.33-release.apk"
}
],
"elementType": "File"
}

View File

@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" package="com.safemobile.dispatch">
package="com.safemobile.dispatch"
android:versionCode="9"
android:versionName="1.0.9">
<!-- require OpenGL ES version 2 for Google Maps --> <!-- require OpenGL ES version 2 for Google Maps -->
<uses-feature <uses-feature
@ -28,7 +25,7 @@
<application <application
android:configChanges="orientation" android:configChanges="orientation"
android:icon="@drawable/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:screenOrientation="landscape" android:screenOrientation="landscape"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -12,10 +12,12 @@ import androidx.annotation.NonNull;
import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.Marker;
import com.safemobile.lib.HistPos;
import com.safemobile.lib.SuperVehicle; import com.safemobile.lib.SuperVehicle;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.Locale; import java.util.Locale;
@ -25,8 +27,10 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
private final String TAG = GoogleMapsInfoBubble.class.getName(); private final String TAG = GoogleMapsInfoBubble.class.getName();
private final View mWindow; private final View mWindow;
private final Hashtable<Long, SuperVehicle> superVehHash; private Hashtable<Long, SuperVehicle> superVehHash;
private final Context context; private final Context context;
private ArrayList<HistPos> histPosList;
private boolean isLiveTab = true;
public GoogleMapsInfoBubble(LayoutInflater layoutInflater, Context context, Hashtable<Long, SuperVehicle> vehicles) { public GoogleMapsInfoBubble(LayoutInflater layoutInflater, Context context, Hashtable<Long, SuperVehicle> vehicles) {
@ -35,6 +39,17 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
mWindow = layoutInflater.inflate(R.layout.map_marker_info_bubble, null); mWindow = layoutInflater.inflate(R.layout.map_marker_info_bubble, null);
} }
public GoogleMapsInfoBubble(LayoutInflater layoutInflater, Context context) {
isLiveTab = false;
this.context = context;
// this.superVehHash = vehicles;
mWindow = layoutInflater.inflate(R.layout.map_marker_info_bubble, null);
}
public void setHistoryPositions(ArrayList<HistPos> positions) {
this.histPosList = positions;
}
@Override @Override
public View getInfoWindow(@NonNull Marker marker) { public View getInfoWindow(@NonNull Marker marker) {
render(marker, mWindow); render(marker, mWindow);
@ -49,13 +64,21 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
private void render(Marker marker, View view) { private void render(Marker marker, View view) {
long key = 0; long key = 0;
int position = 0;
try { if (isLiveTab) {
key = Long.parseLong(marker.getTitle()); try {
} catch (Exception ex) { key = Long.parseLong(marker.getTitle());
Log.v(TAG, "Unable to parse Google Maps Info Bubble title"); } catch (Exception ex) {
Log.v(TAG, "Unable to parse Google Maps Info Bubble title");
}
} else {
try {
position = Integer.getInteger(marker.getTitle());
} catch (Exception e) {
Log.v(TAG, "Unable to parse Google Maps Info Bubble title on History");
}
} }
SuperVehicle vehicle = superVehHash.get(key);
RelativeLayout rlMapInfoBubbleInfo = view.findViewById(R.id.rlMapInfoBubbleInfo); RelativeLayout rlMapInfoBubbleInfo = view.findViewById(R.id.rlMapInfoBubbleInfo);
TextView tvUnitName = view.findViewById(R.id.tvUnitName); TextView tvUnitName = view.findViewById(R.id.tvUnitName);
@ -67,27 +90,39 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
rlMapInfoBubbleInfo.setVisibility(View.VISIBLE); rlMapInfoBubbleInfo.setVisibility(View.VISIBLE);
boolean isMilitaryTime = false; boolean isMilitaryTime = false;
Date positionTime = new Date(vehicle.timeGMT); Date positionTime;
String speed, address, gpsLocation, name = "";
if (isLiveTab) {
SuperVehicle vehicle = superVehHash.get(key);
positionTime = new Date(vehicle.timeGMT);
address = vehicle.Address != null ? vehicle.Address : "";
name = vehicle.name;
speed = String.format(context.getResources().getString(R.string.speedMph), vehicle.speed);
gpsLocation = "[" + String.format("%.4f", vehicle.lat) + "," + String.format("%.4f",vehicle.lng) + "]";
} else {
HistPos histPos = histPosList.get(position);
positionTime = new Date(histPos.timeGMT);
address = histPos.Address != null ? histPos.Address : "";
speed = String.format(context.getResources().getString(R.string.speedMph), histPos.speed);
gpsLocation = "[" + String.format("%.4f", histPos.lat) + "," + String.format("%.4f",histPos.lng) + "]";
}
String timeFormat = isMilitaryTime String timeFormat = isMilitaryTime
? "HH:mm:ss dd.MMM.yyyy" ? "HH:mm:ss dd.MMM.yyyy"
: "hh:mm:ss a dd.MMM.yyy"; : "hh:mm:ss a dd.MMM.yyy";
DateFormat format = new SimpleDateFormat(timeFormat, Locale.ENGLISH); DateFormat format = new SimpleDateFormat(timeFormat, Locale.ENGLISH);
tvTimeAgo.setText(format.format(positionTime)); tvTimeAgo.setText(format.format(positionTime));
tvSpeed.setText(String.format(context.getResources().getString(R.string.speedMph), vehicle.speed));
String address = vehicle.Address != null ? vehicle.Address : "";
tvStreetView.setText(address); tvStreetView.setText(address);
streetView.setVisibility(address.length() > 0 ? View.VISIBLE : View.GONE); streetView.setVisibility(address.length() > 0 ? View.VISIBLE : View.GONE);
tvStreetView.setVisibility(address.length() > 0 ? View.VISIBLE : View.GONE); tvStreetView.setVisibility(address.length() > 0 ? View.VISIBLE : View.GONE);
tvUnitName.setText(vehicle.name); if (!isLiveTab)
tvGPSLocation.setText("[" + String.format("%.4f", vehicle.lat) tvUnitName.setVisibility(View.GONE);
+ "," + String.format("%.4f",vehicle.lng) + "]"); else
tvUnitName.setText(name);
tvSpeed.setText(speed);
tvGPSLocation.setText(gpsLocation);
} }
} }

View File

@ -1,17 +1,33 @@
package com.safemobile.dispatch; package com.safemobile.dispatch;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
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.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.MarkerOptions;
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.OperationCodes;
import com.safemobile.lib.SM; import com.safemobile.lib.SM;
import com.safemobile.lib.Vehicle; import com.safemobile.lib.Vehicle;
@ -21,19 +37,21 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
public class HistoryActivity extends AppCompatActivity { public class HistoryActivity extends AppCompatActivity implements OnMapReadyCallback {
public Bundle savedInstanceState; public Bundle savedInstanceState;
private TabLayoutActivity parentTab; private TabLayoutActivity parentTab;
private GoogleMap googleMap; private GoogleMap googleMap;
private Spinner spinnerVehicle; private Spinner spinnerVehicle;
private ImageView changeMapType, checkTraffic, slideLayoutImage; private Button displayButton;
private LinearLayout layoutTraffic, slidelayout, layoutVehicles; private Date startDate, endDate;
private final Handler myHandler = new Handler();
private GoogleMapsInfoBubble infoBubble;
private final ArrayList<Vehicle> allVehicle = new ArrayList<>();
private final ArrayList<String> allVehicleNames = new ArrayList<>();
private final SimpleDateFormat sdf = new SimpleDateFormat("MMMM dd yyyy");
private ArrayList<Vehicle> allVehicle = new ArrayList<>();
private ArrayList<String> allVehicleNames = new ArrayList<>();
private ArrayAdapter<String> adapter;
private boolean showVehicle = true;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -47,14 +65,15 @@ public class HistoryActivity extends AppCompatActivity {
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);
if (mapFragment != null)
mapFragment.getMapAsync(this);
spinnerVehicle = findViewById(R.id.spinnerVehicle); spinnerVehicle = findViewById(R.id.spinnerVehicle);
getVehicles(); getVehicles();
adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, allVehicleNames); ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, allVehicleNames);
adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line); adapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
spinnerVehicle.setAdapter(adapter); spinnerVehicle.setAdapter(adapter);
spinnerVehicle.setSelection(0); spinnerVehicle.setSelection(0);
@ -62,49 +81,87 @@ public class HistoryActivity extends AppCompatActivity {
changeMapType(); changeMapType();
changeTraffic(); changeTraffic();
slidelayout = findViewById(R.id.slidelayout); displayButton = findViewById(R.id.buttonDisplay);
slideLayoutImage = findViewById(R.id.slideLayoutImage); displayButton.setOnClickListener(view -> {
layoutVehicles = findViewById(R.id.layoutBig); googleMap.clear();
// slidelayout.setOnTouchListener((v, event) -> { if (!AppParams.DEMO) {
// if (showVehicle) { parentTab.dropAllData =false;
// layoutVehicles.setVisibility(View.GONE); parentTab.firstHistData = true;
// slideLayoutImage.setImageResource(R.drawable.arrow_right); parentTab.HistMsgList.clear();
// showVehicle = false; parentTab.HistPosList.clear();
// } else {
// layoutVehicles.setVisibility(View.VISIBLE); // request history
// slideLayoutImage.setImageResource(R.drawable.arrow_left); parentTab.executeNetworkStuff(new String[] {OperationCodes.GetHistoryPositions + "", allVehicle.get(spinnerVehicle.getSelectedItemPosition()).sc_id + "",
// showVehicle = true; (startDate.getTime()/ 1000L) + "", (endDate.getTime()/ 1000L) + ""});
// } } else {
// return false; parentTab.demoPositionsList();
// }); displayHistory(parentTab.demoPositions);
}
});
setDate(); setDate();
} }
private void displayHistory(ArrayList<HistPos> positions) {
LatLng latLng = null;
PolylineOptions polylineOptions = new PolylineOptions();
BitmapDescriptor markerIcon = BitmapDescriptorFactory.fromResource(R.drawable.history_pin);
for (int i = 0; i < positions.size(); i++) {
HistPos pos = positions.get(i);
if (pos.speed > 0) {
latLng = new LatLng(pos.lat, pos.lng);
polylineOptions.add(latLng);
googleMap.addMarker(new MarkerOptions()
.position(latLng)
.icon(markerIcon)
.title(String.valueOf(i)));
}
}
googleMap.addPolyline(polylineOptions);
if (latLng != null)
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 14));
}
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); TextView textViewStartDate = findViewById(R.id.textViewStartDate);
TextView textViewDate = findViewById(R.id.textViewStartDate); TextView textViewEndDate = findViewById(R.id.textViewEndDate);
textViewDate.setText(new SimpleDateFormat("HH:mm, dd.MM.yyyy").format(startDate)); textViewStartDate.setText(sdf.format(startDate));
// layoutStartPicker.setOnTouchListener((v, event) -> { textViewEndDate.setText(sdf.format(endDate));
// showDialog(layoutStartPicker);
// return false;
// });
// layoutEndPicker.setOnTouchListener(new OnTouchListener() { textViewStartDate.setOnClickListener(view -> openDialog(textViewStartDate, true));
// @Override textViewEndDate.setOnClickListener(view -> openDialog(textViewEndDate, false));
// public boolean onTouch(View v, MotionEvent event) { }
// showDialog(layoutEndPicker);
// return false;
// }
// });
private void openDialog(TextView textView, Boolean isStartDate) {
Date date = startDate;
if (!isStartDate)
date = endDate;
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
DatePickerDialog.OnDateSetListener setListener = (datePicker, y, m, d) -> {
calendar.set(y, m, d);
String dateString = sdf.format(calendar.getTime());
textView.setText(dateString);
if (isStartDate)
startDate = calendar.getTime();
else
endDate = calendar.getTime();
};
Dialog dialog = new DatePickerDialog(this, android.R.style.Theme_Holo_Light_Dialog_MinWidth, setListener,
calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.show();
} }
private void changeTraffic() { private void changeTraffic() {
@ -121,14 +178,13 @@ public class HistoryActivity extends AppCompatActivity {
} }
private void changeMapType() { private void changeMapType() {
changeMapType = findViewById(R.id.changeMapType); ImageView changeMapType = findViewById(R.id.changeMapType);
ImageView changeMapTypeImageView = findViewById(R.id.changeMapType);
changeMapType.setOnClickListener(view -> { changeMapType.setOnClickListener(view -> {
if (googleMap.getMapType() == GoogleMap.MAP_TYPE_SATELLITE) { if (googleMap.getMapType() == GoogleMap.MAP_TYPE_SATELLITE) {
changeMapTypeImageView.setImageResource(R.drawable.satellite); changeMapType.setImageResource(R.drawable.satellite);
googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
} else { } else {
changeMapTypeImageView.setImageResource(R.drawable.map); changeMapType.setImageResource(R.drawable.map);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
} }
}); });
@ -136,15 +192,27 @@ public class HistoryActivity extends AppCompatActivity {
public void getVehicles() { public void getVehicles() {
try { try {
allVehicle.clear();
allVehicleNames.clear();
for (Vehicle vehicle : parentTab.getAllVehicle()) { for (Vehicle vehicle : parentTab.getAllVehicle()) {
allVehicleNames.add(vehicle.name); allVehicleNames.add(vehicle.name);
allVehicle.add(vehicle); allVehicle.add(vehicle);
} }
} catch (Exception ex) { } } catch (Exception ignored) { }
} }
final Runnable UpdateMapResults = new Runnable() {
public void run() {
Log.v("updateMap", parentTab.HistPosList.toString());
SM.Debug("Do the Display");
infoBubble.setHistoryPositions(parentTab.HistPosList);
displayHistory(parentTab.HistPosList);
}
};
public void UpdateMap() { public void UpdateMap() {
myHandler.post(UpdateMapResults);
SM.Debug("Do the updateMAP post"); SM.Debug("Do the updateMAP post");
} }
@ -159,4 +227,15 @@ public class HistoryActivity extends AppCompatActivity {
public void UpdateNrPos(int size) { public void UpdateNrPos(int size) {
SM.Debug("Do Cancelwindow"); SM.Debug("Do Cancelwindow");
} }
@Override
public void onMapReady(@NonNull GoogleMap googleMap) {
this.googleMap = googleMap;
infoBubble = new GoogleMapsInfoBubble(getLayoutInflater(), this);
this.googleMap.setInfoWindowAdapter(infoBubble);
parentTab.demoPositionsList();
displayButton.performClick();
}
} }

View File

@ -673,10 +673,10 @@ public class RadioActivity extends Activity {
dialog.setCancelable(true); dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true); dialog.setCanceledOnTouchOutside(true);
TextView text = (TextView) dialog.findViewById(R.id.text); TextView text = dialog.findViewById(R.id.text);
ImageView image = (ImageView) dialog.findViewById(R.id.image); ImageView image = dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.ic_launcher); image.setImageResource(R.mipmap.ic_launcher);
text.setText(errorMsg); text.setText(errorMsg);
dialog.show(); dialog.show();
} }

View File

@ -184,10 +184,10 @@ public class RecordingsActivity extends Activity {
dialog.setCancelable(true); dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true); dialog.setCanceledOnTouchOutside(true);
TextView text = (TextView) dialog.findViewById(R.id.text); TextView text = dialog.findViewById(R.id.text);
ImageView image = (ImageView) dialog.findViewById(R.id.image); ImageView image = dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.ic_launcher); image.setImageResource(R.mipmap.ic_launcher);
text.setText(errorMsg); text.setText(errorMsg);
dialog.show(); dialog.show();
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -11,7 +11,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:src="@drawable/ic_launcher" android:src="@mipmap/ic_launcher"
/> />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -24,7 +24,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:src="@drawable/ic_launcher" android:src="@mipmap/ic_launcher"
android:contentDescription="image for dialog" android:contentDescription="image for dialog"
/> />
<LinearLayout <LinearLayout

View File

@ -7,7 +7,7 @@
android:id="@+id/icon" android:id="@+id/icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" android:src="@mipmap/ic_launcher"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:paddingRight="5dp" android:paddingRight="5dp"
android:paddingTop="5dp" android:paddingTop="5dp"

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_width="fill_parent"
android:id="@+id/tab1Layout" android:orientation="horizontal" android:layout_height="fill_parent"
android:id="@+id/tab1Layout"
android:orientation="horizontal"
style="?bg"> style="?bg">
<RelativeLayout <RelativeLayout
@ -162,10 +164,11 @@
android:text="@string/startDate" android:text="@string/startDate"
android:textSize="22dp" android:textSize="22dp"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:layout_marginTop="15sp"
android:textColor="#000000" android:textColor="#000000"
android:gravity="left" android:gravity="left"
android:id="@+id/labelStartDate" android:id="@+id/labelStartDate"
android:visibility="gone"/> />
<LinearLayout <LinearLayout
android:id="@+id/layoutStartPicker" android:id="@+id/layoutStartPicker"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -202,7 +205,7 @@
android:textColor="#000000" android:textColor="#000000"
android:gravity="left" android:gravity="left"
android:id="@+id/labelEndDate" android:id="@+id/labelEndDate"
android:visibility="gone"/> />
<LinearLayout <LinearLayout
android:id="@+id/layoutEndPicker" android:id="@+id/layoutEndPicker"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -284,14 +287,15 @@
</LinearLayout> </LinearLayout>
<fragment <fragment
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:id="@+id/map" android:id="@+id/map"
android:layout_toRightOf="@id/slidelayout" android:layout_toRightOf="@id/slidelayout"
android:layout_weight="1" android:layout_weight="1"
tools:context=".HistoryActivity"
android:name="com.google.android.gms.maps.SupportMapFragment" /> android:name="com.google.android.gms.maps.SupportMapFragment" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:id="@+id/changeMapType" android:id="@+id/changeMapType"

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">SafeMobile Dispatch</string> <string name="app_name">SafeDispatch Mobile</string>
<string name="app_name_demo">SafeMobile Dispatch Demo</string> <string name="app_name_demo">SafeDispatch Mobile Demo</string>
<string name="app_name_radiopod">RadioPod</string> <string name="app_name_radiopod">RadioPod</string>
<string name="app_name_radiopad">RadioPad</string> <string name="app_name_radiopad">RadioPad</string>
<string name="app_name_radiopodd">RadioPod</string> <string name="app_name_radiopodd">RadioPod</string>

View File

@ -82,7 +82,7 @@
<style name="mainBackground_sd"> <style name="mainBackground_sd">
<item name="android:orientation">vertical</item> <item name="android:orientation">vertical</item>
<item name="android:background">@drawable/safedispatch</item> <item name="android:background">@drawable/safedispatch_logo</item>
<item name="android:scaleType">centerInside</item> <item name="android:scaleType">centerInside</item>
</style> </style>
@ -138,7 +138,7 @@
</style> </style>
<style name="bg_sd"> <style name="bg_sd">
<item name="android:background">@drawable/safedispatch</item> <item name="android:background">@drawable/safedispatch_logo</item>
</style> </style>
<style name="header_sd"> <style name="header_sd">
@ -155,7 +155,7 @@
<style name="mainBackground_hy"> <style name="mainBackground_hy">
<item name="android:orientation">vertical</item> <item name="android:orientation">vertical</item>
<item name="android:background">@drawable/safedispatch</item> <item name="android:background">@drawable/safedispatch_logo</item>
<item name="android:scaleType">centerInside</item> <item name="android:scaleType">centerInside</item>
</style> </style>
@ -211,7 +211,7 @@
</style> </style>
<style name="bg_hy"> <style name="bg_hy">
<item name="android:background">@drawable/safedispatch</item> <item name="android:background">@drawable/safedispatch_logo</item>
</style> </style>
<style name="header_hy"> <style name="header_hy">
@ -228,7 +228,7 @@
<style name="mainBackground_vi"> <style name="mainBackground_vi">
<item name="android:orientation">vertical</item> <item name="android:orientation">vertical</item>
<item name="android:background">@drawable/safedispatch</item> <item name="android:background">@drawable/safedispatch_logo</item>
<item name="android:scaleType">centerInside</item> <item name="android:scaleType">centerInside</item>
</style> </style>
@ -285,7 +285,7 @@
</style> </style>
<style name="bg_vi"> <style name="bg_vi">
<item name="android:background">@drawable/safedispatch</item> <item name="android:background">@drawable/safedispatch_logo</item>
</style> </style>
<style name="header_vi"> <style name="header_vi">