Compare commits

...

2 Commits

Author SHA1 Message Date
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

View File

@ -687,7 +687,7 @@ 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);
@ -695,16 +695,16 @@ public class LiveActivity extends AbstractLiveActivity implements OnMapReadyCall
// check if all values are identical // check if all values are identical
boolean identical = true; boolean identical = true;
for (Boolean displ : displayedVehicles) for (Boolean displ : displayedVehicles)
if (!Objects.equals(displ, displayedVehicles.get(0))) { if (displ != displayedVehicles.get(0)) {
identical = false; identical = 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 (identical && displayedVehicles.get(0)) {
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);
} }