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

Fixed HMI does not apply Display mode to the main screen image #584

Conversation

Ypostolov
Copy link
Contributor

@Ypostolov Ypostolov commented Jul 23, 2021

Fixes#515

This PR is ready for review.

Testing Plan

SDL and HMI are started;mobile app is registered and activated;
Mobile application send “Show”(activate: “Graphic”,"imageType" = "DYNAMIC", .png, activate: “isTemplate”= ON),
than display mode changed, observe HMI applies display mode to the main screen image.

Summary

Fixed HMI does not apply Display mode to the main screen image.

CLA

@Ypostolov Ypostolov force-pushed the fix/fix_HMI_does_not_apply_Display_mode_to_the_main_screen_image branch from 6240865 to c0df972 Compare July 24, 2021 05:49
Copy link
Contributor

@ShobhitAd ShobhitAd left a comment

Choose a reason for hiding this comment

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

The template overlay should probably also be implemented for images in NonMedia Layout https://github.com/smartdevicelink/sdl_hmi/blob/master/app/view/info/nonMediaView.js#L98

app/view/media/sdl/controllsView.js Outdated Show resolved Hide resolved
app/view/media/sdl/controllsView.js Outdated Show resolved Hide resolved
Ypostolov and others added 2 commits August 3, 2021 17:07
Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com>
Co-authored-by: Shobhit Adlakha <ShobhitAd@users.noreply.github.com>
@@ -57,8 +57,9 @@ SDL.SDLMediaControlls = Em.ContainerView.create(
'<div class="artist textLimit"{{bindAttr class="SDL.SDLController.model.mediaPreset:hidden"}}>{{SDL.SDLController.model.appInfo.field3}}</div>' +
'<div class="track textLimit"{{bindAttr style="SDL.SDLController.model.appInfo.alignment"}}>{{SDL.SDLController.model.appInfo.mediaTrack}}</div>' +
'<div class="time"{{bindAttr class="SDL.SDLController.model.mediaPreset:timeV2"}}>{{SDL.SDLController.model.appInfo.mediaClock}}</div>' +
'<img class="cd_logo" onerror="this.style.display=\'none\'" {{bindAttr class="SDL.SDLController.model.mediaPreset:cd_logoV2"}} {{bindAttr class="SDL.SDLController.model.mode"}} {{bindAttr class="SDL.SDLController.model.isTemplate"}}/>' +
'<img class="cd_logo" onerror="this.style.display=\'none\'" {{bindAttr src="SDL.SDLController.model.appInfo.mainImage" class="SDL.SDLController.model.mediaPreset:cd_logoV2"}} />' +
'<img {{bindAttr class="SDL.SDLController.model.isTemplate:ico-overlay"}} {{bindAttr class="SDL.SDLController.model.mediaPreset:cd_logoV2"}} {{bindAttr class="SDL.SDLController.model.mode"}} {{bindAttr class="SDL.SDLController.model.isTemplate"}} />'+
Copy link
Contributor

Choose a reason for hiding this comment

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

The ico overlay doesn't appear at the moment since it's missing the display mode class - day-mode, night-mode or high-lighted-mode
templatedGraphicShow

Copy link
Contributor

Choose a reason for hiding this comment

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

@ShobhitAd good point, looks like we should track not only image mode, but also switching of template image parameter set by UI.Show
Fixed in 3550773

*/
setMode:function(mode){
imageModeChanged: function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this callback triggered? I wasn't able to find a function call for this function in the sdl_hmi code

Copy link
Contributor

Choose a reason for hiding this comment

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

@ShobhitAd this is an observer function. It gets called automatically by framework whenever value of observable variable is updated

*/
setMode:function(mode){
imageModeChanged: function() {
const mode = SDL.SDLModel.data.imageMode;
if(this.isTemplate){
switch(mode){
case SDL.SDLModel.data.imageModeList[0]:this.set('mode','day-mode');break;
case SDL.SDLModel.data.imageModeList[1]:this.set('mode','night-mode');break;
case SDL.SDLModel.data.imageModeList[2]:this.set('mode','high-lighted-mode');break;
default:this.set('mode','');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the imageMode should default to one of the modes instead of being empty (similar to how its handled in https://github.com/smartdevicelink/sdl_hmi/blob/master/app/controlls/Button.js#L95)

Copy link
Contributor

Choose a reason for hiding this comment

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

@ShobhitAd agree. Fixed in 3550773

@AKalinich-Luxoft
Copy link
Contributor

The template overlay should probably also be implemented for images in NonMedia Layout https://github.com/smartdevicelink/sdl_hmi/blob/master/app/view/info/nonMediaView.js#L98

@ShobhitAd overlay logic has also been implemented for non media model in 3550773

@ShobhitAd ShobhitAd merged commit 5bf32aa into smartdevicelink:develop Aug 10, 2021
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