New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically Update Menu Manager Cells #1282
Dynamically Update Menu Manager Cells #1282
Conversation
…smarter using less RPC commands, built basic structure in manager to run the loops
…ubcells as a factor in the hash
…e where function was returning an NSArray instead of NSMutableArray
…ut code bit of whitespace cleanup
…es and started to make tests
… update add commands to only add cells at index
…ed but we keep some cells
…/add commands for every sub cell
…d new keeps for subcells to keep the indexs matching
Rename some files added more unit tests fixed syntax Moved enums to a public file changed function names to align more with the standards
removed setter updated unit tests removed fit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please retest against Sync 3 and Generic HMI before resubmitting.
- Delete all but one submenu
- Delete all but one command
- Rearrange submenus and commands
- Add one submenu
- Add one command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few more small items!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry! Also a few more items, and be sure to check the previous items for any that weren't resolved.
SmartDeviceLink/SDLMenuManager.m
Outdated
e.g. If the new menu array is [A, B, C, D] but only [C, D] are new we need to pass [A, B , C , D] so C and D can be added to index 2 and 3 respectively. | ||
@return list of SDLRPCRequest addCommands | ||
*/ | ||
- (NSArray<SDLRPCRequest *> *)sdl_mainMenuCommandsForCells:(NSArray<SDLMenuCell *> *)cells withArtwork:(BOOL)shouldHaveArtwork usingIndexOf:(NSArray<SDLMenuCell *> *)menu { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change usingIndexOf: to
usingIndexesFrom:
? Is that more accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more
Fixes #1144
This PR is [ready] for review.
Risk
This PR makes [minor] API changes.
Testing Plan
Unit tests have been created to test dynamic and non dynamic menu manger updates.
Summary
This PR makes the menu manager more efficient when creating a new menu. The menu manger will now compare the old and new menu to find cells to keep. This will reduce the number of Add and delete RPCs. A flag has been added to either use Dynamic menu manger or not. 'dynamicMenuUpdatesMode` this flag can be set using the screen manger.
CLA