Ok, Back key action changed.
authorjjie.choi <jjie.choi@samsung.com>
Tue, 25 Apr 2017 11:09:51 +0000 (20:09 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:53 +0000 (18:34 +0900)
Change-Id: I08812379dc70ec94963833d0556ac88114706f9d
Signed-off-by: jjie.choi <jjie.choi@samsung.com>
TVHome/TVHome/Views/MainPage.xaml.cs
TVHome/TVHome/Views/MainPanel.xaml.cs
TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs

index 0932dce..868894e 100755 (executable)
@@ -167,6 +167,27 @@ namespace TVHome.Views
                         break;
                 }
             });
+            PageMainPanel.OnItemSelectedHandler += (id) => {
+                DebuggingUtils.Dbg("Selected Item " + id);
+                switch (id)
+                {
+                    case HomeMenuItem.Recent:
+                        RecentSubPanel.FocusPanel();
+                        AppsSubPanel.HidePanel();
+                        SettingsSubPanel.HidePanel();
+                        break;
+                    case HomeMenuItem.Apps:
+                        RecentSubPanel.HidePanel();
+                        AppsSubPanel.FocusPanel();
+                        SettingsSubPanel.HidePanel();
+                        break;
+                    case HomeMenuItem.Settings:
+                        RecentSubPanel.HidePanel();
+                        AppsSubPanel.HidePanel();
+                        SettingsSubPanel.FocusPanel();
+                        break;
+                }
+            };
         }
 
         protected override void OnAppearing()
@@ -293,6 +314,18 @@ namespace TVHome.Views
             {
                 AppsSubPanel.ChangeToDefaultMode();
             }
+            else if (AppsSubPanel.isFocused)
+            {
+                PageMainPanel.SetButtonFocus(1);
+            }
+            else if (RecentSubPanel.isFocused)
+            {
+                PageMainPanel.SetButtonFocus(0);
+            }
+            else if (SettingsSubPanel.isFocused)
+            {
+                PageMainPanel.SetButtonFocus(2);
+            }
             else
             {
                 ToggleIconified();
index 2586234..6220509 100755 (executable)
@@ -29,6 +29,8 @@ namespace TVHome.Views
     /// </summary>
     public partial class MainPanel : Panel
     {
+        public delegate void SelectEventHandler(HomeMenuItem item);
+        public SelectEventHandler OnItemSelectedHandler;
         /// <summary>
         /// MainPanel icon's transition height value when it focused.
         /// </summary>
@@ -71,7 +73,8 @@ namespace TVHome.Views
                 });
                 button.OnClickedCommand = new Command(() =>
                 {
-                    item.DoAction();
+                    OnItemSelectedHandler?.Invoke(ItemName);
+                    //item.DoAction();
                 });
                 PanelButtonGrid.Children.Add(button.View, index, 0);
 
@@ -129,5 +132,10 @@ namespace TVHome.Views
         {
             await this.ScaleTo(1, 0);
         }
+        public void SetButtonFocus(int idx)
+        {
+            var button = PanelButtonGrid.Children[idx];
+            button.FindByName<Button>("ButtonFocusArea").Focus();
+        }
     }
 }
\ No newline at end of file
index 5154a4c..e4264af 100755 (executable)
@@ -207,7 +207,7 @@ namespace TVHome.Views
         /// </summary>
         public override async void FocusPanel()
         {
-            if (isFocused)
+            if (isFocused || ShowNoContentsInfo)
             {
                 return;
             }