Compare commits

..

3 Commits

Author SHA1 Message Date
4ba0ceb627 Merge pull request 'convert to mph' (#34) from convert_to_mph into develop
Reviewed-on: #34
Reviewed-by: Cristi Ene <cristi.ene@safemobile.com>
2024-03-14 11:07:48 +00:00
4b09464638 convert to mph 2024-02-28 18:06:13 +02:00
a9732e5a52 Merge pull request 'SD_256_incorect_timestamp_in_buble_live_tab' (#33) from SD_256_incorect_timestamp_in_buble_live_tab into develop
Reviewed-on: #33
Reviewed-by: Cristi Ene <cristi.ene@safemobile.com>
2023-05-26 15:05:59 +00:00
4 changed files with 15 additions and 3 deletions

3
.gitignore vendored
View File

@ -184,3 +184,6 @@ $RECYCLE.BIN/
/.idea/misc.xml
/.idea
/.idea/modules.xml
/safeDispatch/debug
/safeDispatch/release

Binary file not shown.

View File

@ -101,7 +101,7 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
timeGMT = vehicle.timeGMT;
address = vehicle.Address != null ? vehicle.Address : "";
name = vehicle.name;
speed = String.format(context.getResources().getString(R.string.speedMph), vehicle.speed);
speed = String.format(context.getResources().getString(R.string.speedMph), (int)(0.621371192 * vehicle.speed));
gpsLocation = "[" + String.format("%.4f", vehicle.lat) + "," + String.format("%.4f",vehicle.lng) + "]";
} else {
HistPos histPos = histPosList.get(position);
@ -109,7 +109,7 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
//positionTime = new Date((new Date()).getTime() - histPos.timeGMT);
timeGMT = histPos.timeGMT;
address = histPos.Address != null ? histPos.Address : "";
speed = String.format(context.getResources().getString(R.string.speedMph), histPos.speed);
speed = String.format(context.getResources().getString(R.string.speedMph), (int)(0.621371192 * histPos.speed));
gpsLocation = "[" + String.format("%.4f", histPos.lat) + "," + String.format("%.4f",histPos.lng) + "]";
}

View File

@ -2354,7 +2354,16 @@ public class TabLayoutActivity extends AbstractSDParentActivity {
// cancel old notification
mNotificationManager.cancel(icon);
PendingIntent pendingIntent = PendingIntent.getActivity(context, NOTIFICATION_ACTIVITY_RESULT, intent, PendingIntent.FLAG_CANCEL_CURRENT);
PendingIntent pendingIntent;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
pendingIntent = PendingIntent.getActivity(context, NOTIFICATION_ACTIVITY_RESULT, intent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_MUTABLE);
}else {
pendingIntent = PendingIntent.getActivity(context, NOTIFICATION_ACTIVITY_RESULT, intent, PendingIntent.FLAG_CANCEL_CURRENT);
}
createNotificationChannel(icon, contentTitle, contentText, pendingIntent);
}