Skip to content

Commit 9237659

Browse files
Simplify cellsWithRemovedPropertiesFromCells()
1 parent 28a8bfe commit 9237659

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuReplaceOperation.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import static com.smartdevicelink.managers.screen.menu.MenuReplaceUtilities.transferCellIDsFromCells;
5050
import static com.smartdevicelink.managers.screen.menu.MenuReplaceUtilities.transferCellListenersFromCells;
5151
import static com.smartdevicelink.managers.screen.menu.MenuReplaceUtilities.windowCapabilitySupportsPrimaryImage;
52+
import static com.smartdevicelink.managers.screen.menu.MenuReplaceUtilities.windowCapabilitySupportsSecondaryImage;
5253

5354
import com.livio.taskmaster.Task;
5455
import com.smartdevicelink.managers.CompletionListener;
@@ -466,11 +467,14 @@ List<MenuCell> cellsWithRemovedPropertiesFromCells(List<MenuCell> cells, WindowC
466467
// Strip away fields that cannot be used to determine uniqueness visually including fields not supported by the HMI
467468
cell.setVoiceCommands(null);
468469

469-
// If we're >= 5.0 && < 7.0, but don't have command icon image, no icon. If we're < 5.0 || >= 7.0 and don't have submenu icon, no icon.
470470
if (!windowCapabilitySupportsPrimaryImage(internalInterface.get(), windowCapability, cell)) {
471471
cell.setIcon(null);
472472
}
473473

474+
if (!windowCapabilitySupportsSecondaryImage(windowCapability, cell)) {
475+
cell.setSecondaryArtwork(null);
476+
}
477+
474478
// Check for subMenu fields supported
475479
if (cell.isSubMenuCell()) {
476480
if (!hasTextFieldOfName(windowCapability, TextFieldName.menuSubMenuSecondaryText)) {
@@ -479,9 +483,6 @@ List<MenuCell> cellsWithRemovedPropertiesFromCells(List<MenuCell> cells, WindowC
479483
if (!hasTextFieldOfName(windowCapability, TextFieldName.menuSubMenuTertiaryText)) {
480484
cell.setTertiaryText(null);
481485
}
482-
if (!hasImageFieldOfName(windowCapability, ImageFieldName.menuSubMenuSecondaryImage)) {
483-
cell.setSecondaryArtwork(null);
484-
}
485486
cell.setSubCells(cellsWithRemovedPropertiesFromCells(cell.getSubCells(), windowCapability));
486487
} else {
487488
if (!hasTextFieldOfName(windowCapability, TextFieldName.menuCommandSecondaryText)) {
@@ -490,9 +491,6 @@ List<MenuCell> cellsWithRemovedPropertiesFromCells(List<MenuCell> cells, WindowC
490491
if (!hasTextFieldOfName(windowCapability, TextFieldName.menuCommandTertiaryText)) {
491492
cell.setTertiaryText(null);
492493
}
493-
if (!hasImageFieldOfName(windowCapability, ImageFieldName.menuCommandSecondaryImage)) {
494-
cell.setSecondaryArtwork(null);
495-
}
496494
}
497495
}
498496
return removePropertiesClone;

0 commit comments

Comments
 (0)