the info bubble shows wrong date and time

This commit is contained in:
CiufudeanDani 2022-04-08 16:53:59 +03:00
parent c210ccf117
commit 1d2182799f
2 changed files with 6 additions and 17 deletions

View File

@ -1,15 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright (C) 2012 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -74,17 +63,17 @@
android:id="@+id/tvTimeAgo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/time"
android:layout_alignTop="@+id/time"
android:layout_alignBottom="@+id/time"
android:layout_gravity="center_horizontal"
android:layout_toEndOf="@+id/time"
android:layout_toRightOf="@+id/time"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
tools:text="a year ago [01:05:01]"
android:textColor="#ff000000"
android:textSize="10sp" />
android:textSize="10sp"
tools:text="a year ago [01:05:01]" />
<ImageView
android:id="@+id/speed"

View File

@ -93,14 +93,14 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
String speed, address, gpsLocation, name = "";
if (isLiveTab) {
SuperVehicle vehicle = superVehHash.get(key);
positionTime = new Date(vehicle.timeGMT);
positionTime = new Date((new Date()).getTime() - 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);
positionTime = new Date((new Date()).getTime() - 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) + "]";