From: Heonjae.Jang Date: Tue, 5 Sep 2017 01:15:46 +0000 (+0900) Subject: Fix issue : Navigation doesn't work after changing value in Settings. X-Git-Tag: submit/tizen_4.0/20170911.075016~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4dd1ba59d5c8652b8fbe63bae0dd94b26a9a5e2;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Fix issue : Navigation doesn't work after changing value in Settings. Patch : Add ShortcutType Property Change-Id: I2d6951100d27862c2d07d68567fdf52007f3d8d9 Signed-off-by: Heonjae.Jang --- diff --git a/LibCommon.Shared/DataModels/RecentShortcutInfo.cs b/LibCommon.Shared/DataModels/RecentShortcutInfo.cs index 3d853ef..6dd61b2 100644 --- a/LibCommon.Shared/DataModels/RecentShortcutInfo.cs +++ b/LibCommon.Shared/DataModels/RecentShortcutInfo.cs @@ -19,25 +19,11 @@ using System.Collections; namespace LibTVRefCommonPortable.DataModels { - /// - /// Types for recent shortcut - /// - public enum RecentShortcutType - { - Application = 0, - Media = 1, - } - /// /// A Recent Shortcut information /// public class RecentShortcutInfo : ShortcutInfo, IComparable { - /// - /// A type for the content of the shortcut - /// - public RecentShortcutType Type { get; set; } - /// /// An Id for the content of the shortcut /// diff --git a/LibCommon.Shared/DataModels/ShortcutInfo.cs b/LibCommon.Shared/DataModels/ShortcutInfo.cs index 00854f6..e4c2dca 100644 --- a/LibCommon.Shared/DataModels/ShortcutInfo.cs +++ b/LibCommon.Shared/DataModels/ShortcutInfo.cs @@ -22,6 +22,14 @@ using LibTVRefCommonPortable.Utils; namespace LibTVRefCommonPortable.DataModels { + public enum ShortcutType + { + MainPanelItem, + Application, + Media, + Setting + } + /// /// 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; + } + /// /// A current state description of a Shortcut. /// A property name. diff --git a/LibCommon.Shared/Utils/RecentShortcutStorage.cs b/LibCommon.Shared/Utils/RecentShortcutStorage.cs index 6d9dedd..d781e2f 100644 --- a/LibCommon.Shared/Utils/RecentShortcutStorage.cs +++ b/LibCommon.Shared/Utils/RecentShortcutStorage.cs @@ -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"; diff --git a/TVHome/TVHome/ViewModels/MainPanelViewModel.cs b/TVHome/TVHome/ViewModels/MainPanelViewModel.cs index 43bd322..5191d07 100644 --- a/TVHome/TVHome/ViewModels/MainPanelViewModel.cs +++ b/TVHome/TVHome/ViewModels/MainPanelViewModel.cs @@ -145,6 +145,7 @@ namespace TVHome.ViewModels ShortcutInfo shortcutInfo = new HomeMenuAppShortcutInfo() { + ShortcutType = ShortcutType.MainPanelItem, StateDescriptions = { { diff --git a/TVHome/TVHome/ViewModels/SettingsViewModel.cs b/TVHome/TVHome/ViewModels/SettingsViewModel.cs index fd30bbd..874e5a2 100644 --- a/TVHome/TVHome/ViewModels/SettingsViewModel.cs +++ b/TVHome/TVHome/ViewModels/SettingsViewModel.cs @@ -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 = { { diff --git a/TVHome/TVHome/Views/SubPanel.xaml.cs b/TVHome/TVHome/Views/SubPanel.xaml.cs index c36bbda..47e3154 100755 --- a/TVHome/TVHome/Views/SubPanel.xaml.cs +++ b/TVHome/TVHome/Views/SubPanel.xaml.cs @@ -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; + } }); }