From: Kyuho Jo Date: Thu, 4 May 2017 07:55:59 +0000 (+0900) Subject: Addditional changes for launching mediahub on recent tab X-Git-Tag: submit/tizen/20170808.015446~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c44a488d3cc23c808c8ce704bcf3e9974c212e65;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Addditional changes for launching mediahub on recent tab Signed-off-by: Kyuho Jo Change-Id: Iba45545524702b5438fd44d5504e9ec319a49244 --- diff --git a/LibTVRefCommonPortable/DataModels/AppControlAction.cs b/LibTVRefCommonPortable/DataModels/AppControlAction.cs index d879dc1..b51e844 100644 --- a/LibTVRefCommonPortable/DataModels/AppControlAction.cs +++ b/LibTVRefCommonPortable/DataModels/AppControlAction.cs @@ -30,20 +30,10 @@ namespace LibTVRefCommonPortable.DataModels /// public string AppID { get; set; } - /// - /// A file URI to be open - /// - public string FileUri { get; set; } - - /// - /// A media id of MediaContent - /// - public string MediaId { get; set; } - /// /// A dictionary which has extra data for App Control /// - private Dictionary extraData; + protected Dictionary extraData; /// /// A dictionary which has extra data for App Control @@ -68,7 +58,7 @@ namespace LibTVRefCommonPortable.DataModels public string Execute() { // Warn : Do NOT pass 'E'xtraData, it will create a new Dictionary and it might cause unexpected situation. - AppControlUtils.SendLaunchRequest(AppID, extraData, FileUri); + AppControlUtils.SendLaunchRequest(AppID, extraData); return "default"; } } diff --git a/LibTVRefCommonPortable/DataModels/MediaControlAction.cs b/LibTVRefCommonPortable/DataModels/MediaControlAction.cs index 4aecc3b..440fcfb 100644 --- a/LibTVRefCommonPortable/DataModels/MediaControlAction.cs +++ b/LibTVRefCommonPortable/DataModels/MediaControlAction.cs @@ -15,21 +15,29 @@ */ using System; +using LibTVRefCommonPortable.Utils; namespace LibTVRefCommonPortable.DataModels { /// /// A Media ControlAction. /// - class MediaControlAction : IAction + class MediaControlAction : AppControlAction { + /// + /// A file URI to be open + /// + public string FileUri { get; set; } + /// /// A method execute a action. /// /// A next statue of a Shortcut. - public string Execute() + new public string Execute() { - throw new NotImplementedException(); + // Warn : Do NOT pass 'E'xtraData, it will create a new Dictionary and it might cause unexpected situation. + AppControlUtils.SendLaunchRequest(AppID, extraData, FileUri); + return "default"; } } } diff --git a/LibTVRefCommonPortable/Models/RecentShortcutController.cs b/LibTVRefCommonPortable/Models/RecentShortcutController.cs index ad50acf..2a8231b 100755 --- a/LibTVRefCommonPortable/Models/RecentShortcutController.cs +++ b/LibTVRefCommonPortable/Models/RecentShortcutController.cs @@ -172,13 +172,18 @@ namespace LibTVRefCommonPortable.Models { Label = item.DisplayName, IconPath = "ic_launcher_mediahub_138.png", - Action = new AppControlAction() + Action = new MediaControlAction() { AppID = "org.tizen.xamediahub", - MediaId = item.MediaId, FileUri = "file://" + item.FilePath, } }; + var mediaControlAction = defaultStateDescription.Action as MediaControlAction; + + mediaControlAction.ExtraData.Add("View By", "All"); + mediaControlAction.ExtraData.Add("Media type", "Video"); + mediaControlAction.ExtraData.Add("Media Id", item.MediaId); + var recentShortcutInfo = new RecentShortcutInfo(); recentShortcutInfo.ScreenshotPath = item.ThumbnailPath;