From d520312a7463c6e60b223853de7a1ff01ce3f74d Mon Sep 17 00:00:00 2001 From: Hyerim Kim Date: Sat, 15 Apr 2017 15:23:12 +0900 Subject: [PATCH] Implement Move icons in Home subpanel Change-Id: If0a882ea66773600b26f58b23370587fea437cc1 Signed-off-by: Hyerim Kim --- .../Utils/IPlatformNotification.cs | 6 +++ TVApps/TVApps/TVApps.cs | 4 ++ TVHome/TVHome.TizenTV/TVHome.TizenTV.cs | 15 ++++++ TVHome/TVHome/Controls/MainPanelButton.xaml.cs | 3 +- TVHome/TVHome/Controls/PanelButton.cs | 3 +- .../TVHome/Controls/SubPanelAllAppsButton.xaml.cs | 7 +-- TVHome/TVHome/Controls/SubPanelButton.xaml | 18 +------ TVHome/TVHome/Controls/SubPanelButton.xaml.cs | 56 ++++++++++------------ .../TVHome/Controls/SubPanelReservedButton.xaml.cs | 7 +-- .../TVHome/Controls/SubPanelSettingButton.xaml.cs | 7 +-- .../Controls/SubPanelThumbnailButton.xaml.cs | 3 +- TVHome/TVHome/TVHome.cs | 5 ++ TVHome/TVHome/Views/MainPage.xaml.cs | 10 ++-- TVHome/TVHome/Views/SubPanel.xaml.cs | 54 ++++++++++++++++----- 14 files changed, 124 insertions(+), 74 deletions(-) diff --git a/LibTVRefCommonPortable/Utils/IPlatformNotification.cs b/LibTVRefCommonPortable/Utils/IPlatformNotification.cs index c816f1d..2198c3f 100755 --- a/LibTVRefCommonPortable/Utils/IPlatformNotification.cs +++ b/LibTVRefCommonPortable/Utils/IPlatformNotification.cs @@ -54,5 +54,11 @@ namespace LibTVRefCommonPortable.Utils /// /// A pinned app ID void OnAppPinnedNotificationReceived(string appID); + + /// + /// A method will be called when the Nativation remote control key is pressed. + /// + /// A pressed remote control key name + void OnNavigationKeyPressed(string keyName); } } diff --git a/TVApps/TVApps/TVApps.cs b/TVApps/TVApps/TVApps.cs index 2df3aa7..1263ddd 100755 --- a/TVApps/TVApps/TVApps.cs +++ b/TVApps/TVApps/TVApps.cs @@ -202,5 +202,9 @@ namespace TVApps }); } + public void OnNavigationKeyPressed(string keyName) + { + + } } } diff --git a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs index d9fcd5c..ac184ee 100755 --- a/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs +++ b/TVHome/TVHome.TizenTV/TVHome.TizenTV.cs @@ -81,6 +81,10 @@ namespace TVHome.TizenTV // Grab key events MainWindow.KeyGrab(ElmSharp.EvasKeyEventArgs.PlatformHomeButtonName, true); MainWindow.KeyGrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName, true); + MainWindow.KeyGrab("Up", false); + MainWindow.KeyGrab("Down", false); + MainWindow.KeyGrab("Left", false); + MainWindow.KeyGrab("Right", false); windowPort.SetKeyGrabExclusively(ElmSharp.EvasKeyEventArgs.PlatformHomeButtonName); } @@ -106,6 +110,13 @@ namespace TVHome.TizenTV notification.OnMenuKeyPressed(); } } + else if (e.KeyName.Equals("Up") || e.KeyName.Equals("Down") || e.KeyName.Equals("Left") || e.KeyName.Equals("Right")) + { + if (notification != null) + { + notification.OnNavigationKeyPressed(e.KeyName); + } + } } /// @@ -119,6 +130,10 @@ namespace TVHome.TizenTV PackageManagerPort.UnregisterCallbacks(); MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformHomeButtonName); MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName); + MainWindow.KeyUngrab("Up"); + MainWindow.KeyUngrab("Down"); + MainWindow.KeyUngrab("Left"); + MainWindow.KeyUngrab("Right"); } /// diff --git a/TVHome/TVHome/Controls/MainPanelButton.xaml.cs b/TVHome/TVHome/Controls/MainPanelButton.xaml.cs index 86c645c..b7f5fb4 100755 --- a/TVHome/TVHome/Controls/MainPanelButton.xaml.cs +++ b/TVHome/TVHome/Controls/MainPanelButton.xaml.cs @@ -139,7 +139,8 @@ namespace TVHome.Controls /// A method for handling the button when button is changed to move mode /// /// A flag indicates whether the button is move mode or not - public override void ChangeMoveMode(bool isMoveMode) + /// A flag indicates whether this method is called by ChangeToDefaultMode method + public override void ChangeMoveMode(bool isMoveMode, bool isDefault) { } diff --git a/TVHome/TVHome/Controls/PanelButton.cs b/TVHome/TVHome/Controls/PanelButton.cs index 4f310e8..84fa5b6 100755 --- a/TVHome/TVHome/Controls/PanelButton.cs +++ b/TVHome/TVHome/Controls/PanelButton.cs @@ -88,7 +88,8 @@ namespace TVHome.Controls /// A method for handling the button when button is changed to move mode /// /// A flag indicates whether the button is move mode or not - public abstract void ChangeMoveMode(bool isMoveMode); + /// A flag indicates whether this method is called by ChangeToDefaultMode method + public abstract void ChangeMoveMode(bool isMoveMode, bool isDefault); /// /// A method for changing the button's LayoutOptions according to parameter diff --git a/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml.cs b/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml.cs index c8e8d22..173cdce 100755 --- a/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml.cs +++ b/TVHome/TVHome/Controls/SubPanelAllAppsButton.xaml.cs @@ -37,8 +37,8 @@ namespace TVHome.Controls { InitializeComponent(); - ButtonBox.WidthRequest = SizeUtils.GetWidthSize(236); - ButtonBox.HeightRequest = SizeUtils.GetHeightSize(240); + ButtonBox.WidthRequest = SizeUtils.GetWidthSize(182); + ButtonBox.HeightRequest = SizeUtils.GetHeightSize(230); ButtonTitle.FontSize = SizeUtils.GetFontSize(26); } @@ -96,7 +96,8 @@ namespace TVHome.Controls /// A method for handling the button when button is changed to move mode /// /// A flag indicates whether the button is move mode or not - public override void ChangeMoveMode(bool isMoveMode) + /// A flag indicates whether this method is called by ChangeToDefaultMode method + public override void ChangeMoveMode(bool isMoveMode, bool isDefault) { } diff --git a/TVHome/TVHome/Controls/SubPanelButton.xaml b/TVHome/TVHome/Controls/SubPanelButton.xaml index 269ec4b..cbd9f3c 100755 --- a/TVHome/TVHome/Controls/SubPanelButton.xaml +++ b/TVHome/TVHome/Controls/SubPanelButton.xaml @@ -38,31 +38,17 @@ Opacity="0" /> -