Fixed Focus Chaining bug
authorHyerim Kim <rimi.kim@samsung.com>
Wed, 19 Apr 2017 10:37:47 +0000 (19:37 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:53 +0000 (18:34 +0900)
 - After uninstall/install apps
 - After sorting apps list

Change-Id: Ic02b4ee05a43b1cd29eb4ec039cf12027d64752a
Signed-off-by: Hyerim Kim <rimi.kim@samsung.com>
TVApps/TVApps/Controls/AppListView.xaml.cs
TVApps/TVApps/Views/MainPage.xaml.cs

index 79c9b3f..870cb86 100755 (executable)
@@ -21,6 +21,7 @@ using System.Collections.Generic;
 using System;
 using System.Threading.Tasks;
 using LibTVRefCommonPortable.Utils;
+using System.Windows.Input;
 
 namespace TVApps.Controls
 {
@@ -100,6 +101,8 @@ namespace TVApps.Controls
             }
         }
 
+        public ICommand OnChangeFocusChainingCommand { get; set; }
+
         /// <summary>
         /// A constructor
         /// Adds PropertyChanged event handler
@@ -189,6 +192,11 @@ namespace TVApps.Controls
 
                 AppCount = AppCount + 1;
             }
+
+            if (OnChangeFocusChainingCommand != null)
+            {
+                OnChangeFocusChainingCommand.Execute("");
+            }
         }
 
         /// <summary>
index c54bdb4..a606c86 100755 (executable)
@@ -123,21 +123,6 @@ namespace TVApps.Views
         */
 
         /// <summary>
-        /// A method runs animation when TV Apps is started
-        /// </summary>
-        private async void PlayShowAnimation()
-        {
-            await AppList.TranslateTo(0, showTransitionHeight, 0);
-#pragma warning disable CS4014
-            AppList.TranslateTo(0, 0, 667);
-#pragma warning restore CS4014
-            await PageDimBox.FadeTo(0.0, 667);
-            PageDimBox.IsVisible = false;
-            await Task.Delay(1);
-            AppList.InitializeFocus();
-        }
-
-        /// <summary>
         /// A constructor
         /// Adds PropertyChanged event handler and MenuKey event listener
         /// </summary>
@@ -165,6 +150,11 @@ namespace TVApps.Views
                     MessagingCenter.Send<MainPage, string>(this, "ChangeCurrentStatus", AppsStatus.LongPress.ToString());
                 }
             });
+
+            AppList.OnChangeFocusChainingCommand = new Command(() =>
+            {
+                MakeFocusChaining();
+            });
         }
 
         protected override async void OnAppearing()
@@ -179,7 +169,11 @@ namespace TVApps.Views
             PageDimBox.IsVisible = false;
             await Task.Delay(1);
             AppList.InitializeFocus();
+            MakeFocusChaining();
+        }
 
+        private void MakeFocusChaining()
+        {
             List<View> upperList = AppList.GetAppsUpperList().ToList();
             List<View> lowerList = AppList.GetAppsLowerList().ToList();
 
@@ -365,7 +359,7 @@ namespace TVApps.Views
                     break;
             }
 
-            SetFocusChainingWithCurrentStatus(status);
+            MakeFocusChaining();
         }
 
         /// <summary>