-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fixed HMI does not apply Display mode to the main screen image #584
Conversation
6240865
to
c0df972
Compare
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.
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
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"}} />'+ |
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.
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.
@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() { |
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.
Where is this callback triggered? I wasn't able to find a function call for this function in the sdl_hmi code
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.
@ShobhitAd this is an observer function. It gets called automatically by framework whenever value of observable variable is updated
app/model/sdl/MediaModel.js
Outdated
*/ | ||
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',''); |
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.
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)
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.
@ShobhitAd agree. Fixed in 3550773
@ShobhitAd overlay logic has also been implemented for non media model in 3550773 |
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