Addditional changes for launching mediahub on recent tab
authorKyuho Jo <kyuho.jo@samsung.com>
Thu, 4 May 2017 07:55:59 +0000 (16:55 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:53 +0000 (18:34 +0900)
Signed-off-by: Kyuho Jo <kyuho.jo@samsung.com>
Change-Id: Iba45545524702b5438fd44d5504e9ec319a49244

LibTVRefCommonPortable/DataModels/AppControlAction.cs
LibTVRefCommonPortable/DataModels/MediaControlAction.cs
LibTVRefCommonPortable/Models/RecentShortcutController.cs

index d879dc1..b51e844 100644 (file)
@@ -31,19 +31,9 @@ namespace LibTVRefCommonPortable.DataModels
         public string AppID { get; set; }
 
         /// <summary>
-        /// A file URI to be open
-        /// </summary>
-        public string FileUri { get; set; }
-
-        /// <summary>
-        /// A media id of MediaContent
-        /// </summary>
-        public string MediaId { get; set; }
-
-        /// <summary>
         /// A dictionary which has extra data for App Control
         /// </summary>
-        private Dictionary<string, string> extraData;
+        protected Dictionary<string, string> extraData;
 
         /// <summary>
         /// 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";
         }
     }
index 4aecc3b..440fcfb 100644 (file)
  */
 
 using System;
+using LibTVRefCommonPortable.Utils;
 
 namespace LibTVRefCommonPortable.DataModels
 {
     /// <summary>
     /// A Media ControlAction.
     /// </summary>
-    class MediaControlAction : IAction
+    class MediaControlAction : AppControlAction
     {
         /// <summary>
+        /// A file URI to be open
+        /// </summary>
+        public string FileUri { get; set; }
+
+        /// <summary>
         /// A method execute a action.
         /// </summary>
         /// <returns>A next statue of a Shortcut.</returns>
-        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";
         }
     }
 }
index ad50acf..2a8231b 100755 (executable)
@@ -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;