From 97b7e2d9a7959bcf82ea006acb2514e88fb2470b Mon Sep 17 00:00:00 2001 From: CiufudeanDani Date: Fri, 8 Apr 2022 14:48:07 +0300 Subject: [PATCH] fix unit selection --- .../java/com/safemobile/safedispatch/LiveActivity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java b/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java index c5498ff..a13db99 100644 --- a/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java +++ b/safeDispatch/src/main/java/com/safemobile/safedispatch/LiveActivity.java @@ -687,7 +687,7 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall // change check image for selected value VehiclesGridViewAdapter.ViewHolder viewLive = (VehiclesGridViewAdapter.ViewHolder) view.getTag(); - if (Boolean.TRUE.equals(displayedVehicles.get(position))) + if (displayedVehicles.get(position)) viewLive.imgViewChecked.setImageResource(R.drawable.checked); else viewLive.imgViewChecked.setImageResource(R.drawable.unchecked); @@ -695,16 +695,16 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall // check if all values are identical boolean identical = true; for (Boolean displ : displayedVehicles) - if (!Objects.equals(displ, displayedVehicles.get(0))) { + if (displ != displayedVehicles.get(0)) { identical = false; break; } // change image when all values are identical - if (identical && Boolean.TRUE.equals(displayedVehicles.get(0))) { + if (identical && displayedVehicles.get(0)) { imageViewCheckAll.setSelected(true); imageViewCheckAll.setBackgroundResource(R.drawable.check_all); - } else if (identical && Boolean.TRUE.equals(!displayedVehicles.get(0))) { + } else { imageViewCheckAll.setSelected(false); imageViewCheckAll.setBackgroundResource(R.drawable.uncheck_all); }