Fix issue : Navigation doesn't work after changing value in Settings. 49/147549/2
authorHeonjae.Jang <Heonjae.Jang@samsung.com>
Tue, 5 Sep 2017 01:15:46 +0000 (10:15 +0900)
committerHeonjae.Jang <Heonjae.Jang@samsung.com>
Tue, 5 Sep 2017 01:58:34 +0000 (10:58 +0900)
Patch : Add ShortcutType Property

Change-Id: I2d6951100d27862c2d07d68567fdf52007f3d8d9
Signed-off-by: Heonjae.Jang <Heonjae.Jang@samsung.com>
LibCommon.Shared/DataModels/RecentShortcutInfo.cs
LibCommon.Shared/DataModels/ShortcutInfo.cs
LibCommon.Shared/Utils/RecentShortcutStorage.cs
TVHome/TVHome/ViewModels/MainPanelViewModel.cs
TVHome/TVHome/ViewModels/SettingsViewModel.cs
TVHome/TVHome/Views/SubPanel.xaml.cs

index 3d853ef..6dd61b2 100644 (file)
@@ -20,25 +20,11 @@ using System.Collections;
 namespace LibTVRefCommonPortable.DataModels
 {
     /// <summary>
-    /// Types for recent shortcut
-    /// </summary>
-    public enum RecentShortcutType
-    {
-        Application = 0,
-        Media = 1,
-    }
-
-    /// <summary>
     /// A Recent Shortcut information
     /// </summary>
     public class RecentShortcutInfo : ShortcutInfo, IComparable
     {
         /// <summary>
-        /// A type for the content of the shortcut
-        /// </summary>
-        public RecentShortcutType Type { get; set; }
-
-        /// <summary>
         /// An Id for the content of the shortcut
         /// </summary>
         public string Id { get; set; }
index 00854f6..e4c2dca 100644 (file)
@@ -22,6 +22,14 @@ using LibTVRefCommonPortable.Utils;
 
 namespace LibTVRefCommonPortable.DataModels
 {
+    public enum ShortcutType
+    {
+        MainPanelItem,
+        Application,
+        Media,
+        Setting
+    }
+
     /// <summary>
     /// TVHome and TVApps has several buttons that represent Apps, Contents, Settings.
     /// The ShortcutInfo is a model for those buttons with detail information of the represented object.
@@ -69,6 +77,12 @@ namespace LibTVRefCommonPortable.DataModels
             set;
         }
 
+        public ShortcutType ShortcutType
+        {
+            get;
+            set;
+        }
+
         /// <summary>
         /// A current state description of a Shortcut. </summary>
         /// <param name="state"> A property name.</param>
index 6d9dedd..d781e2f 100644 (file)
@@ -98,7 +98,7 @@ namespace LibTVRefCommonPortable.Utils
                         recentShortcutInfo.ScreenshotPath = item.ScreenShot;
                     }
 
-                    recentShortcutInfo.Type = RecentShortcutType.Application;
+                    recentShortcutInfo.ShortcutType = ShortcutType.Application;
                     recentShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);
                     recentShortcutInfo.CurrentStateDescription = defaultStateDescription;
                     recentShortcutInfo.Id = item.AppID;
@@ -144,7 +144,7 @@ namespace LibTVRefCommonPortable.Utils
                     }
                 }
 
-                recentShortcutInfo.Type = RecentShortcutType.Media;
+                recentShortcutInfo.ShortcutType = ShortcutType.Media;
                 recentShortcutInfo.StateDescriptions.Add("default", defaultStateDescription);
                 recentShortcutInfo.CurrentStateDescription = defaultStateDescription;
                 recentShortcutInfo.Id = "org.tizen.xamediahub";
index 43bd322..5191d07 100644 (file)
@@ -145,6 +145,7 @@ namespace TVHome.ViewModels
 
                 ShortcutInfo shortcutInfo = new HomeMenuAppShortcutInfo()
                 {
+                    ShortcutType = ShortcutType.MainPanelItem,
                     StateDescriptions =
                     {
                         {
index fd30bbd..874e5a2 100644 (file)
@@ -110,6 +110,7 @@ namespace TVHome.ViewModels
 
             ShortcutInfo Settings = new SettingShortcutInfo()
             {
+                ShortcutType = ShortcutType.Setting,
                 StateDescriptions =
                 {
                     {
@@ -151,6 +152,7 @@ namespace TVHome.ViewModels
 
                 ShortcutInfo shortcutInfo = new SettingShortcutInfo()
                 {
+                    ShortcutType = ShortcutType.Setting,
                     StateDescriptions =
                     {
                         {
index c36bbda..47e3154 100755 (executable)
@@ -165,9 +165,9 @@ namespace TVHome.Views
                     button.OnClickedCommand = new Command(() =>
                     {
                         item.DoAction();
-                        if (!item.StateDescriptions["default"].Label.Equals("Add pin"))
+                        if (!item.StateDescriptions["default"].Label.Equals("Add pin") && item.ShortcutType != ShortcutType.Setting)
                         {
-                            PanelState = PanelState.Iconified;
+                            MainPageViewModel.Publisher.CurrentState = AppState.HomeIconified;
                         }
                     });
                     button.OnUnpinCommand = new Command(() =>
@@ -308,10 +308,6 @@ namespace TVHome.Views
         public override void OnPanelHiding()
         {
             DebuggingUtils.Dbg("SubPanel HidePanel");
-            foreach (var item in PanelButtonStack.Children)
-            {
-                item.IsEnabled = false;
-            }
 
             AnimationExtensions.AbortAnimation(this, "PanelAnimation");
             var currentTranslationY = TranslationY;
@@ -325,6 +321,10 @@ namespace TVHome.Views
             animation.Commit(this, "PanelAnimation", length: 300, finished: (percentage, cancel) =>
               {
                   PanelScrollView.ScrollToAsync(0, 0, true);
+                  foreach (var item in PanelButtonStack.Children)
+                  {
+                      item.IsEnabled = false;
+                  }
               });
 
         }