when selecting a unit from the grid it should be centered with the info bubble opened
This commit is contained in:
parent
dcceb360e9
commit
f4db909dcb
@ -89,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 */
|
||||||
@ -255,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);
|
||||||
@ -286,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();
|
||||||
@ -373,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;
|
||||||
@ -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) {
|
if (googleMap != null) {
|
||||||
String openWindow = "";
|
String openWindow = "";
|
||||||
for (Marker marker : markers) {
|
for (Marker marker : markers) {
|
||||||
@ -464,7 +464,7 @@ 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));
|
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(newLocation, 14));
|
||||||
}
|
}
|
||||||
@ -474,10 +474,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
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) {
|
||||||
@ -654,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 = () -> {
|
||||||
@ -664,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;
|
||||||
@ -682,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));
|
||||||
@ -697,15 +695,15 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
|
|||||||
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 (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 && displayedVehicles.get(0)) {
|
if (allDisplayed) {
|
||||||
imageViewCheckAll.setSelected(true);
|
imageViewCheckAll.setSelected(true);
|
||||||
imageViewCheckAll.setBackgroundResource(R.drawable.check_all);
|
imageViewCheckAll.setBackgroundResource(R.drawable.check_all);
|
||||||
} else {
|
} else {
|
||||||
@ -714,7 +712,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
|
|||||||
}
|
}
|
||||||
|
|
||||||
// display vehicle
|
// display vehicle
|
||||||
displayVehicle(true, LAT_OUTLIMIT, LNG_OUTLIMIT);
|
displayVehicle(LAT_OUTLIMIT, LNG_OUTLIMIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user