Skip to content
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

Implement SDL 0231 Main Menu Tiles #1117

Merged
merged 17 commits into from
Jul 23, 2019

Conversation

BrettyWhite
Copy link
Contributor

@BrettyWhite BrettyWhite commented Jul 18, 2019

Fixes #1076

This PR is ready for review.

Risk

This PR makes minor API changes.

Testing Plan

Unit tests added and smoke tested against core PR

Summary

Implement proposal as defined

CLA

@BrettyWhite BrettyWhite changed the title Implement SDL 0231 Main Menu Tiles WIP Implement SDL 0231 Main Menu Tiles Jul 18, 2019
@codecov-io
Copy link

codecov-io commented Jul 18, 2019

Codecov Report

Merging #1117 into develop will increase coverage by 0.08%.
The diff coverage is 85.29%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1117      +/-   ##
=============================================
+ Coverage      46.79%   46.87%   +0.08%     
- Complexity      4024     4070      +46     
=============================================
  Files            455      457       +2     
  Lines          22186    22428     +242     
  Branches        2515     2553      +38     
=============================================
+ Hits           10381    10513     +132     
- Misses         11196    11298     +102     
- Partials         609      617       +8
Impacted Files Coverage Δ Complexity Δ
...om/smartdevicelink/proxy/rpc/enums/MenuLayout.java 100% <100%> (ø) 2 <2> (?)
...smartdevicelink/proxy/rpc/DisplayCapabilities.java 75.51% <100%> (+1.59%) 22 <2> (+2) ⬆️
...celink/managers/screen/menu/MenuConfiguration.java 100% <100%> (ø) 6 <6> (?)
...smartdevicelink/proxy/rpc/SetGlobalProperties.java 100% <100%> (ø) 18 <2> (+2) ⬆️
...n/java/com/smartdevicelink/proxy/SdlProxyBase.java 8.39% <100%> (ø) 27 <1> (ø) ⬇️
...smartdevicelink/managers/screen/menu/MenuCell.java 80.51% <100%> (-7.72%) 29 <3> (+1)
...java/com/smartdevicelink/proxy/rpc/AddSubMenu.java 100% <100%> (ø) 13 <2> (+2) ⬆️
...tdevicelink/managers/screen/BaseScreenManager.java 68.46% <100%> (+0.74%) 43 <2> (+2) ⬆️
...vicelink/managers/screen/menu/BaseMenuManager.java 47.77% <61.53%> (+0.66%) 87 <3> (+3) ⬆️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 31c5b1f...7be9b4f. Read the comment docs.

@BrettyWhite BrettyWhite changed the title WIP Implement SDL 0231 Main Menu Tiles Implement SDL 0231 Main Menu Tiles Jul 19, 2019

public class MenuConfiguration {

private MenuLayout mainMenuLayout, defaultSubmenuLayout;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would either add the word "default" to both vars or remove it from both. Also same applied to the constructor params

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is as intended in the proposal. There is only one main menu. However, you can override each submenu's layout in the MenuCell constructor, while making whatever you set here the 'default'.

* @param icon The cell's image
* @param subCells The sub-cells for the sub menu that will appear when the cell is selected
*/
public MenuCell(@NonNull String title, @Nullable MenuLayout subMenuLayout, @Nullable SdlArtwork icon, @Nullable List<MenuCell> subCells) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MenuLayout param should be added to the javadoc

}

/**
* Sets the layout of the submenu screen.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Sets the layout of the submenu screen.
* Gets the layout of the submenu screen.

@@ -83,6 +87,8 @@
List<MenuCell> menuCells, waitingUpdateMenuCells, oldMenuCells, keepsNew, keepsOld;
List<RPCRequest> inProgressUpdate;
DynamicMenuUpdatesMode dynamicMenuUpdatesMode;
MenuConfiguration menuConfiguration;
SdlMsgVersion sdlMsgVersion;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to keep a class var for sdlMsgVersion since we can get it any time from Isdl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going to keep it because i can't test the setter without this

* This will be used when a menu item with sub-cells has a null value for menuConfiguration
* @param menuConfiguration - The default menuConfiguration
*/
public void setMenuConfiguration(final MenuConfiguration menuConfiguration) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add @ NonNull to the menuConfig param?

* The main menu layout. See available menu layouts on DisplayCapabilities.menuLayoutsAvailable. Defaults to LIST.
* @param menuConfiguration - The default menuConfiguration
*/
public void setMenuConfiguration(MenuConfiguration menuConfiguration) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add @ NonNull to the menuConfig param?

@@ -30,6 +31,7 @@ protected RPCMessage createMessage(){
msg.setMenuName(Test.GENERAL_STRING);
msg.setPosition(Test.GENERAL_INT);
msg.setMenuIcon(Test.GENERAL_IMAGE);
msg.setMenuLayout(Test.GENERAL_MENU_LAYOUT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some extra spaces here and in other places in this file

@@ -69,6 +72,7 @@ public void testRpcValues () {
assertEquals(Test.MATCH, Test.GENERAL_MEDIACLOCKFORMAT_LIST.size(), mediaClock.size());
assertEquals(Test.MATCH, Test.GENERAL_TEXTFIELD_LIST.size(), textFields.size());
assertEquals(Test.MATCH, Test.GENERAL_IMAGEFIELD_LIST.size(), imageFields.size());
assertEquals(Test.MATCH, Test.GENERAL_MENU_LAYOUT_LIST.size(), menuLayouts.size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a spacing issue here

@bilal-alsharifi bilal-alsharifi merged commit c992ba0 into develop Jul 23, 2019
@bilal-alsharifi bilal-alsharifi deleted the feature/Implement_sdl_0231_main_menu_tiles branch July 23, 2019 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants