From c210ccf117f5267bcd5542da3edc0f7e4a2b45fd Mon Sep 17 00:00:00 2001 From: CiufudeanDani Date: Fri, 8 Apr 2022 16:39:53 +0300 Subject: [PATCH 1/6] disable map controls --- .../main/java/com/safemobile/safedispatch/HistoryActivity.java | 1 + .../src/main/java/com/safemobile/safedispatch/LiveActivity.java | 1 + 2 files changed, 2 insertions(+) diff --git a/safeDispatch/src/main/java/com/safemobile/safedispatch/HistoryActivity.java b/safeDispatch/src/main/java/com/safemobile/safedispatch/HistoryActivity.java index e0e6735..25c4b2b 100644 --- a/safeDispatch/src/main/java/com/safemobile/safedispatch/HistoryActivity.java +++ b/safeDispatch/src/main/java/com/safemobile/safedispatch/HistoryActivity.java @@ -258,6 +258,7 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall infoBubble = new GoogleMapsInfoBubble(getLayoutInflater(), this); this.googleMap.setInfoWindowAdapter(infoBubble); + this.googleMap.getUiSettings().setMapToolbarEnabled(false); parentTab.demoPositionsList(); displayButton.performClick(); diff --git a/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java b/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java index a13db99..f93dfa7 100644 --- a/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java +++ b/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java @@ -309,6 +309,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall this.googleMap = googleMap; GoogleMapsInfoBubble infoBubble = new GoogleMapsInfoBubble(getLayoutInflater(), this, getParentTab().getSuperVehHash()); this.googleMap.setInfoWindowAdapter(infoBubble); + this.googleMap.getUiSettings().setMapToolbarEnabled(false); } From 1d2182799f0107894d9c30071859976f2ac57225 Mon Sep 17 00:00:00 2001 From: CiufudeanDani Date: Fri, 8 Apr 2022 16:53:59 +0300 Subject: [PATCH 2/6] the info bubble shows wrong date and time --- .../res/layout/map_marker_info_bubble.xml | 19 ++++--------------- .../safedispatch/GoogleMapsInfoBubble.java | 4 ++-- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/libSafeMobile/src/main/res/layout/map_marker_info_bubble.xml b/libSafeMobile/src/main/res/layout/map_marker_info_bubble.xml index 08ce499..66846e0 100644 --- a/libSafeMobile/src/main/res/layout/map_marker_info_bubble.xml +++ b/libSafeMobile/src/main/res/layout/map_marker_info_bubble.xml @@ -1,15 +1,4 @@ - + + android:textSize="10sp" + tools:text="a year ago [01:05:01]" /> Date: Fri, 8 Apr 2022 17:53:22 +0300 Subject: [PATCH 3/6] the unit should be centered when moving with the info bubble opened --- .../main/java/com/safemobile/safedispatch/LiveActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java b/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java index f93dfa7..7a9da99 100644 --- a/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java +++ b/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java @@ -32,6 +32,7 @@ import android.widget.Toast; import androidx.annotation.NonNull; +import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; @@ -463,8 +464,10 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall markerOptions.icon(markerIcon); Marker marker = this.googleMap.addMarker(markerOptions); - if (openWindow.equals(marker.getTitle())) + if (openWindow.equals(marker.getTitle())) { marker.showInfoWindow(); + googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 14)); + } markers.add(marker); } From f4db909dcbbf9b3d767b5f96f26418b1e0a19ab3 Mon Sep 17 00:00:00 2001 From: CiufudeanDani Date: Fri, 8 Apr 2022 18:40:20 +0300 Subject: [PATCH 4/6] when selecting a unit from the grid it should be centered with the info bubble opened --- .../safemobile/safedispatch/LiveActivity.java | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java b/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java index 7a9da99..0daa7c7 100644 --- a/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java +++ b/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java @@ -89,7 +89,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall private boolean isAck = false; private boolean showVehicle = true; private int contextMenuPosition; - private int vehStatus; + private int vehStatus, lastItemClicked; private int position; // vehStatus = vehicle status received from apps /* Live Vehicle GridView */ @@ -255,7 +255,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall } // refresh UI - displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); + displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT); }); displayButton = findViewById(R.id.buttonDisplay); @@ -286,11 +286,11 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall } // refresh UI - displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); + displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT); }); // display Vehicles - displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); + displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT); // register to receive broadcasts registerBroadcastIntents(); @@ -373,7 +373,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall // clear previous vehicles SM.Debug("onResume"); - displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); + displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT); } final Runnable cancelLoadingDialogRUN = LiveActivity.this::cancelLoadingDialog; @@ -442,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) { String openWindow = ""; for (Marker marker : markers) { @@ -464,7 +464,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall markerOptions.icon(markerIcon); Marker marker = this.googleMap.addMarker(markerOptions); - if (openWindow.equals(marker.getTitle())) { + if (openWindow.equals(marker.getTitle()) || i == lastItemClicked) { marker.showInfoWindow(); googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 14)); } @@ -474,10 +474,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall } } } - } - - public void showOpenedBalloon(boolean demo) { - //TODO: add show balloon + lastItemClicked = 0; } private BitmapDescriptor getProperBitmap(int largeIcon, String text) { @@ -654,7 +651,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall } // 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 final Runnable updatePollResults = () -> { @@ -664,7 +661,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall adapter.changeDisplayed(position, true); } - displayVehicle(true, latPoll, lngPoll); }; + displayVehicle(latPoll, lngPoll); }; // Create runnable for posting final Runnable updateOptionsRUN = this::updateOptionsUI; @@ -682,8 +679,9 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall * @param view View in which will do the modifications */ private void itemClick(int position, View view) { + lastItemClicked = position; // change displayed state - displayedVehicles.set(position, !Boolean.TRUE.equals(displayedVehicles.get(position))); + displayedVehicles.set(position, !displayedVehicles.get(position)); // change in the adapter adapter.changeDisplayed(position, displayedVehicles.get(position)); @@ -697,15 +695,15 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall viewLive.imgViewChecked.setImageResource(R.drawable.unchecked); // check if all values are identical - boolean identical = true; - for (Boolean displ : displayedVehicles) - if (displ != displayedVehicles.get(0)) { - identical = false; + boolean allDisplayed = true; + for (Boolean displayed : displayedVehicles) + if (!displayed) { + allDisplayed = false; break; } // change image when all values are identical - if (identical && displayedVehicles.get(0)) { + if (allDisplayed) { imageViewCheckAll.setSelected(true); imageViewCheckAll.setBackgroundResource(R.drawable.check_all); } else { @@ -714,7 +712,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall } // display vehicle - displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT); + displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT); } /** From b6fc8851a732cd3d4aa5a2f8a80d36e9773f0a98 Mon Sep 17 00:00:00 2001 From: CiufudeanDani Date: Fri, 8 Apr 2022 20:23:36 +0300 Subject: [PATCH 5/6] the blue bar with an arrow from the left has no functionality. it should hide the grid --- .../safedispatch/HistoryActivity.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/safeDispatch/src/main/java/com/safemobile/safedispatch/HistoryActivity.java b/safeDispatch/src/main/java/com/safemobile/safedispatch/HistoryActivity.java index 25c4b2b..e3b786a 100644 --- a/safeDispatch/src/main/java/com/safemobile/safedispatch/HistoryActivity.java +++ b/safeDispatch/src/main/java/com/safemobile/safedispatch/HistoryActivity.java @@ -11,9 +11,11 @@ import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.os.Handler; import android.util.Log; +import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.TextView; @@ -52,6 +54,7 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall private final ArrayList allVehicle = new ArrayList<>(); private final ArrayList allVehicleNames = new ArrayList<>(); private final SimpleDateFormat sdf = new SimpleDateFormat("MMMM dd yyyy"); + private boolean showVehicles = true; @Override @@ -111,6 +114,21 @@ public class HistoryActivity extends AppCompatActivity implements OnMapReadyCall } }); + 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(); } From 32201af76c734497e7c8492c9b53119196c1cc81 Mon Sep 17 00:00:00 2001 From: CiufudeanDani Date: Fri, 8 Apr 2022 20:32:29 +0300 Subject: [PATCH 6/6] remove barcode from conversation --- .../safemobile/safedispatch/MessagesActivity.java | 10 ---------- safeDispatch/src/main/res/layout-large/tabtext.xml | 14 -------------- safeDispatch/src/main/res/layout/tabtext.xml | 13 ------------- 3 files changed, 37 deletions(-) diff --git a/safeDispatch/src/main/java/com/safemobile/safedispatch/MessagesActivity.java b/safeDispatch/src/main/java/com/safemobile/safedispatch/MessagesActivity.java index 577a653..61c4852 100644 --- a/safeDispatch/src/main/java/com/safemobile/safedispatch/MessagesActivity.java +++ b/safeDispatch/src/main/java/com/safemobile/safedispatch/MessagesActivity.java @@ -124,16 +124,6 @@ public class MessagesActivity extends Activity { textViewSelectedContact = findViewById(R.id.textViewSelectedContact); 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 TextView textView1 = findViewById(R.id.textView1); textView1.setTypeface(Typeface.createFromAsset(getAssets(), "Sketch_Block.ttf")); diff --git a/safeDispatch/src/main/res/layout-large/tabtext.xml b/safeDispatch/src/main/res/layout-large/tabtext.xml index 258195e..956ae1a 100644 --- a/safeDispatch/src/main/res/layout-large/tabtext.xml +++ b/safeDispatch/src/main/res/layout-large/tabtext.xml @@ -214,20 +214,6 @@ android:autofillHints=""> - - -