summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeonjae.Jang <Heonjae.Jang@samsung.com>2017-09-05 10:15:46 +0900
committerHeonjae.Jang <Heonjae.Jang@samsung.com>2017-09-05 10:58:34 +0900
commitc4dd1ba59d5c8652b8fbe63bae0dd94b26a9a5e2 (patch)
tree0e13af324bdb4a93ca9b73366439a91ab6034441
parent775cd95a45c5ec0e3dacf94ceaeaacaae1bfe4fa (diff)
downloadhome-c4dd1ba59d5c8652b8fbe63bae0dd94b26a9a5e2.tar.gz
home-c4dd1ba59d5c8652b8fbe63bae0dd94b26a9a5e2.tar.bz2
home-c4dd1ba59d5c8652b8fbe63bae0dd94b26a9a5e2.zip
Fix issue : Navigation doesn't work after changing value in Settings.
Patch : Add ShortcutType Property Change-Id: I2d6951100d27862c2d07d68567fdf52007f3d8d9 Signed-off-by: Heonjae.Jang <Heonjae.Jang@samsung.com>
-rw-r--r--LibCommon.Shared/DataModels/RecentShortcutInfo.cs14
-rw-r--r--LibCommon.Shared/DataModels/ShortcutInfo.cs14
-rw-r--r--LibCommon.Shared/Utils/RecentShortcutStorage.cs4
-rw-r--r--TVHome/TVHome/ViewModels/MainPanelViewModel.cs1
-rw-r--r--TVHome/TVHome/ViewModels/SettingsViewModel.cs2
-rwxr-xr-xTVHome/TVHome/Views/SubPanel.xaml.cs12
6 files changed, 25 insertions, 22 deletions
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
@@ -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; }
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
+ }
+
/// <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>
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;
+ }
});
}