Compare commits

..

15 Commits

Author SHA1 Message Date
32201af76c remove barcode from conversation 2022-04-08 20:32:29 +03:00
b6fc8851a7 the blue bar with an arrow from the left has no functionality. it should hide the grid 2022-04-08 20:23:36 +03:00
f4db909dcb when selecting a unit from the grid it should be centered with the info bubble opened 2022-04-08 18:40:20 +03:00
dcceb360e9 the unit should be centered when moving with the info bubble opened 2022-04-08 17:53:22 +03:00
1d2182799f the info bubble shows wrong date and time 2022-04-08 16:53:59 +03:00
c210ccf117 disable map controls 2022-04-08 16:39:53 +03:00
f6cb72368d Merge pull request 'fix unit selection' (#25) from SD-221 into develop
Reviewed-on: #25
2022-04-08 11:50:39 +00:00
97b7e2d9a7 fix unit selection 2022-04-08 14:48:07 +03:00
33d00c27d7 Merge pull request 'display satelite map' (#24) from SD-220 into develop
Reviewed-on: #24
2022-04-08 10:54:18 +00:00
cc78f29f26 display satelite map 2022-04-08 13:52:16 +03:00
e7c3672b93 Merge pull request 'update info bubble box info' (#23) from SD-219 into develop
Reviewed-on: #23
2022-04-07 10:32:52 +00:00
feb7bd654c update info bubble box info 2022-04-07 13:31:23 +03:00
539170109d Merge pull request 'when receiving a new alarm && current tab is alarms, refresh alarm list' (#22) from SD-224 into develop
Reviewed-on: #22
2022-04-07 10:16:35 +00:00
0bdd161d69 when receiving a new alarm && current tab is alarms, refresh alarm list 2022-04-07 13:14:58 +03:00
680dd0f803 Merge pull request 'fix login button display when internet connection is available' (#21) from SD-217 into develop
Reviewed-on: #21
2022-04-06 07:05:25 +00:00
9 changed files with 68 additions and 88 deletions

View File

@ -255,13 +255,12 @@ public abstract class AbstractSDParentActivity extends TabActivity {
return res; return res;
} }
public boolean getAlarms(long userID) public boolean getAlarms(long userID) {
{ if (tcp == null)
if(tcp == null)
return false; return false;
boolean res = tcp.Write("0.0", "#27#" + userID + "#"); boolean res = tcp.Write("0.0", "#27#" + userID + "#");
if(res) if (res)
SM.Debug("Message [GetAlarms] sent to app server"); SM.Debug("Message [GetAlarms] sent to app server");
else else
SM.Debug("Could not send message [GetAlarms]!!"); SM.Debug("Could not send message [GetAlarms]!!");

View File

@ -1,15 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!-- <?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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -74,17 +63,17 @@
android:id="@+id/tvTimeAgo" android:id="@+id/tvTimeAgo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@+id/time"
android:layout_alignTop="@+id/time" android:layout_alignTop="@+id/time"
android:layout_alignBottom="@+id/time"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_toEndOf="@+id/time" android:layout_toEndOf="@+id/time"
android:layout_toRightOf="@+id/time" android:layout_toRightOf="@+id/time"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center_vertical" android:gravity="center_vertical"
android:maxLines="1" android:maxLines="1"
tools:text="a year ago [01:05:01]"
android:textColor="#ff000000" android:textColor="#ff000000"
android:textSize="10sp" /> android:textSize="10sp"
tools:text="a year ago [01:05:01]" />
<ImageView <ImageView
android:id="@+id/speed" android:id="@+id/speed"

View File

@ -42,7 +42,6 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
public GoogleMapsInfoBubble(LayoutInflater layoutInflater, Context context) { public GoogleMapsInfoBubble(LayoutInflater layoutInflater, Context context) {
isLiveTab = false; isLiveTab = false;
this.context = context; this.context = context;
// this.superVehHash = vehicles;
mWindow = layoutInflater.inflate(R.layout.map_marker_info_bubble, null); mWindow = layoutInflater.inflate(R.layout.map_marker_info_bubble, null);
} }
@ -73,7 +72,7 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
} }
} else { } else {
try { try {
position = Integer.getInteger(marker.getTitle()); position = Integer.parseInt(marker.getTitle());
} catch (Exception e) { } catch (Exception e) {
Log.v(TAG, "Unable to parse Google Maps Info Bubble title on History"); Log.v(TAG, "Unable to parse Google Maps Info Bubble title on History");
} }
@ -94,14 +93,14 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
String speed, address, gpsLocation, name = ""; String speed, address, gpsLocation, name = "";
if (isLiveTab) { if (isLiveTab) {
SuperVehicle vehicle = superVehHash.get(key); SuperVehicle vehicle = superVehHash.get(key);
positionTime = new Date(vehicle.timeGMT); positionTime = new Date((new Date()).getTime() - vehicle.timeGMT);
address = vehicle.Address != null ? vehicle.Address : ""; address = vehicle.Address != null ? vehicle.Address : "";
name = vehicle.name; name = vehicle.name;
speed = String.format(context.getResources().getString(R.string.speedMph), vehicle.speed); speed = String.format(context.getResources().getString(R.string.speedMph), vehicle.speed);
gpsLocation = "[" + String.format("%.4f", vehicle.lat) + "," + String.format("%.4f",vehicle.lng) + "]"; gpsLocation = "[" + String.format("%.4f", vehicle.lat) + "," + String.format("%.4f",vehicle.lng) + "]";
} else { } else {
HistPos histPos = histPosList.get(position); HistPos histPos = histPosList.get(position);
positionTime = new Date(histPos.timeGMT); positionTime = new Date((new Date()).getTime() - histPos.timeGMT);
address = histPos.Address != null ? histPos.Address : ""; 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), histPos.speed);
gpsLocation = "[" + String.format("%.4f", histPos.lat) + "," + String.format("%.4f",histPos.lng) + "]"; gpsLocation = "[" + String.format("%.4f", histPos.lat) + "," + String.format("%.4f",histPos.lng) + "]";

View File

@ -11,9 +11,11 @@ import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.util.Log; import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; 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;
@ -52,6 +54,7 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
private final ArrayList<Vehicle> allVehicle = new ArrayList<>(); private final ArrayList<Vehicle> allVehicle = new ArrayList<>();
private final ArrayList<String> allVehicleNames = new ArrayList<>(); private final ArrayList<String> allVehicleNames = new ArrayList<>();
private final SimpleDateFormat sdf = new SimpleDateFormat("MMMM dd yyyy"); private final SimpleDateFormat sdf = new SimpleDateFormat("MMMM dd yyyy");
private boolean showVehicles = true;
@Override @Override
@ -100,6 +103,32 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
} }
}); });
ImageView mapType = findViewById(R.id.changeMapTypeHeader);
mapType.setOnClickListener(view -> {
if (googleMap.getMapType() != GoogleMap.MAP_TYPE_SATELLITE) {
mapType.setImageResource(R.drawable.map);
googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
} else {
mapType.setImageResource(R.drawable.satellite);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
}
});
LinearLayout slideLayout = findViewById(R.id.slidelayout);
LinearLayout linearLayoutVehicles = findViewById(R.id.layoutBig);
ImageView slideLayoutImageView = findViewById(R.id.slideLayoutImage);
slideLayout.setOnClickListener(v -> {
if (showVehicles) {
linearLayoutVehicles.setVisibility(View.GONE);
slideLayoutImageView.setImageResource(R.drawable.arrow_right);
showVehicles = false;
} else {
linearLayoutVehicles.setVisibility(View.VISIBLE);
slideLayoutImageView.setImageResource(R.drawable.arrow_left);
showVehicles = true;
}
});
setDate(); setDate();
} }
@ -247,6 +276,7 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall
infoBubble = new GoogleMapsInfoBubble(getLayoutInflater(), this); infoBubble = new GoogleMapsInfoBubble(getLayoutInflater(), this);
this.googleMap.setInfoWindowAdapter(infoBubble); this.googleMap.setInfoWindowAdapter(infoBubble);
this.googleMap.getUiSettings().setMapToolbarEnabled(false);
parentTab.demoPositionsList(); parentTab.demoPositionsList();
displayButton.performClick(); displayButton.performClick();

View File

@ -32,6 +32,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
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;
@ -88,7 +89,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
private boolean isAck = false; private boolean isAck = false;
private boolean showVehicle = true; private boolean showVehicle = true;
private int contextMenuPosition; private int contextMenuPosition;
private int vehStatus; private int vehStatus, lastItemClicked;
private int position; // vehStatus = vehicle status received from apps private int position; // vehStatus = vehicle status received from apps
/* Live Vehicle GridView */ /* Live Vehicle GridView */
@ -145,11 +146,11 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
// image View for changing map type satellite or map // image View for changing map type satellite or map
ImageView changeMapTypeImageView = findViewById(R.id.changeMapType); ImageView changeMapTypeImageView = findViewById(R.id.changeMapType);
changeMapTypeImageView.setOnClickListener(v -> { changeMapTypeImageView.setOnClickListener(v -> {
if (googleMap.getMapType() == GoogleMap.MAP_TYPE_SATELLITE) { if (googleMap.getMapType() != GoogleMap.MAP_TYPE_SATELLITE) {
changeMapTypeImageView.setImageResource(R.drawable.satellite); changeMapTypeImageView.setImageResource(R.drawable.map);
googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE); googleMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
} else { } else {
changeMapTypeImageView.setImageResource(R.drawable.map); changeMapTypeImageView.setImageResource(R.drawable.satellite);
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
} }
}); });
@ -254,7 +255,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
} }
// refresh UI // refresh UI
displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT);
}); });
displayButton = findViewById(R.id.buttonDisplay); displayButton = findViewById(R.id.buttonDisplay);
@ -285,11 +286,11 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
} }
// refresh UI // refresh UI
displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT);
}); });
// display Vehicles // display Vehicles
displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT);
// register to receive broadcasts // register to receive broadcasts
registerBroadcastIntents(); registerBroadcastIntents();
@ -309,6 +310,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
this.googleMap = googleMap; this.googleMap = googleMap;
GoogleMapsInfoBubble infoBubble = new GoogleMapsInfoBubble(getLayoutInflater(), this, getParentTab().getSuperVehHash()); GoogleMapsInfoBubble infoBubble = new GoogleMapsInfoBubble(getLayoutInflater(), this, getParentTab().getSuperVehHash());
this.googleMap.setInfoWindowAdapter(infoBubble); this.googleMap.setInfoWindowAdapter(infoBubble);
this.googleMap.getUiSettings().setMapToolbarEnabled(false);
} }
@ -371,7 +373,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
// clear previous vehicles // clear previous vehicles
SM.Debug("onResume"); SM.Debug("onResume");
displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT);
} }
final Runnable cancelLoadingDialogRUN = LiveActivity.this::cancelLoadingDialog; final Runnable cancelLoadingDialogRUN = LiveActivity.this::cancelLoadingDialog;
@ -440,7 +442,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
}); });
} }
public void displayVehicle(boolean withZoom, double latZoom, double lngZoom) { public void displayVehicle(double latZoom, double lngZoom) {
if (googleMap != null) { if (googleMap != null) {
String openWindow = ""; String openWindow = "";
for (Marker marker : markers) { for (Marker marker : markers) {
@ -462,18 +464,17 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
markerOptions.icon(markerIcon); markerOptions.icon(markerIcon);
Marker marker = this.googleMap.addMarker(markerOptions); Marker marker = this.googleMap.addMarker(markerOptions);
if (openWindow.equals(marker.getTitle())) if (openWindow.equals(marker.getTitle()) || i == lastItemClicked) {
marker.showInfoWindow(); marker.showInfoWindow();
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 14));
}
markers.add(marker); markers.add(marker);
} }
} }
} }
} }
} lastItemClicked = 0;
public void showOpenedBalloon(boolean demo) {
//TODO: add show balloon
} }
private BitmapDescriptor getProperBitmap(int largeIcon, String text) { private BitmapDescriptor getProperBitmap(int largeIcon, String text) {
@ -650,7 +651,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
} }
// Create runnable for posting // Create runnable for posting
final Runnable updateMapResults = () -> displayVehicle(false, LAT_OUTLIMIT, LNG_OUTLIMIT); final Runnable updateMapResults = () -> displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT);
// Create runnable for posting // Create runnable for posting
final Runnable updatePollResults = () -> { final Runnable updatePollResults = () -> {
@ -660,7 +661,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
adapter.changeDisplayed(position, true); adapter.changeDisplayed(position, true);
} }
displayVehicle(true, latPoll, lngPoll); }; displayVehicle(latPoll, lngPoll); };
// Create runnable for posting // Create runnable for posting
final Runnable updateOptionsRUN = this::updateOptionsUI; final Runnable updateOptionsRUN = this::updateOptionsUI;
@ -678,8 +679,9 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
* @param view View in which will do the modifications * @param view View in which will do the modifications
*/ */
private void itemClick(int position, View view) { private void itemClick(int position, View view) {
lastItemClicked = position;
// change displayed state // change displayed state
displayedVehicles.set(position, !Boolean.TRUE.equals(displayedVehicles.get(position))); displayedVehicles.set(position, !displayedVehicles.get(position));
// change in the adapter // change in the adapter
adapter.changeDisplayed(position, displayedVehicles.get(position)); adapter.changeDisplayed(position, displayedVehicles.get(position));
@ -687,30 +689,30 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
// change check image for selected value // change check image for selected value
VehiclesGridViewAdapter.ViewHolder viewLive = (VehiclesGridViewAdapter.ViewHolder) view.getTag(); VehiclesGridViewAdapter.ViewHolder viewLive = (VehiclesGridViewAdapter.ViewHolder) view.getTag();
if (Boolean.TRUE.equals(displayedVehicles.get(position))) if (displayedVehicles.get(position))
viewLive.imgViewChecked.setImageResource(R.drawable.checked); viewLive.imgViewChecked.setImageResource(R.drawable.checked);
else else
viewLive.imgViewChecked.setImageResource(R.drawable.unchecked); viewLive.imgViewChecked.setImageResource(R.drawable.unchecked);
// check if all values are identical // check if all values are identical
boolean identical = true; boolean allDisplayed = true;
for (Boolean displ : displayedVehicles) for (Boolean displayed : displayedVehicles)
if (!Objects.equals(displ, displayedVehicles.get(0))) { if (!displayed) {
identical = false; allDisplayed = false;
break; break;
} }
// change image when all values are identical // change image when all values are identical
if (identical && Boolean.TRUE.equals(displayedVehicles.get(0))) { if (allDisplayed) {
imageViewCheckAll.setSelected(true); imageViewCheckAll.setSelected(true);
imageViewCheckAll.setBackgroundResource(R.drawable.check_all); imageViewCheckAll.setBackgroundResource(R.drawable.check_all);
} else if (identical && Boolean.TRUE.equals(!displayedVehicles.get(0))) { } else {
imageViewCheckAll.setSelected(false); imageViewCheckAll.setSelected(false);
imageViewCheckAll.setBackgroundResource(R.drawable.uncheck_all); imageViewCheckAll.setBackgroundResource(R.drawable.uncheck_all);
} }
// display vehicle // display vehicle
displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT);
} }
/** /**

View File

@ -124,16 +124,6 @@ public class MessagesActivity extends Activity {
textViewSelectedContact = findViewById(R.id.textViewSelectedContact); textViewSelectedContact = findViewById(R.id.textViewSelectedContact);
imageViewSelectedContact = findViewById(R.id.imageViewSelectedContact); imageViewSelectedContact = findViewById(R.id.imageViewSelectedContact);
ImageView imageBarcode = findViewById(R.id.imageBarcode);
imageBarcode.setOnClickListener(v -> {
try {
Intent intent = new Intent("com.google.zxing.client.android.SCAN");
startActivityForResult(intent, 0);
} catch (Exception e) {
showErrorDialog(getResources().getString(R.string.barcodeError));
}
});
// change tab header fontFace // change tab header fontFace
TextView textView1 = findViewById(R.id.textView1); TextView textView1 = findViewById(R.id.textView1);
textView1.setTypeface(Typeface.createFromAsset(getAssets(), "Sketch_Block.ttf")); textView1.setTypeface(Typeface.createFromAsset(getAssets(), "Sketch_Block.ttf"));

View File

@ -1741,10 +1741,8 @@ public class TabLayoutActivity extends AbstractSDParentActivity {
} }
//list for SMS //list for SMS
if (AppParams.crtTab == AppParams.Tabs.alarms) { if (AppParams.crtTab == AppParams.Tabs.alarms)
SM.Debug("currentActivity instanceof AlarmActivity - newSMS | " + tempArr[0] + " | " + tempArr[1]);
getAlarms(AppParams.USERID); getAlarms(AppParams.USERID);
}
} }
@Override @Override

View File

@ -214,20 +214,6 @@
android:autofillHints=""> android:autofillHints="">
</EditText> </EditText>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<ImageView
android:id="@+id/imageBarcode"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:src="@drawable/barcode"
android:paddingTop="2dp"
android:layout_margin="3dp" />
</LinearLayout>
<Button <Button
android:id="@+id/imageButtonSend" android:id="@+id/imageButtonSend"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -213,19 +213,6 @@
android:autofillHints=""> android:autofillHints="">
</EditText> </EditText>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_weight="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingTop="4dp">
<ImageView
android:id="@+id/imageBarcode"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:src="@drawable/barcode"
android:layout_margin="3dp" />
</LinearLayout>
<Button <Button
android:id="@+id/imageButtonSend" android:id="@+id/imageButtonSend"
android:layout_width="wrap_content" android:layout_width="wrap_content"