TV Home - Fix SubThumbnailPanel Animation
authorHeonjae Jang <heonjae.jang@samsung.com>
Thu, 23 Mar 2017 11:04:38 +0000 (20:04 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:50 +0000 (18:34 +0900)
1. Fix SubThumbnailPanel Focused Animation
2. Change HidePanel to ShowPanel When Pinned List Changed

Change-Id: I3e8b150bbf1e48ce311550f2166a0ed5ebf3eb61

TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk
TVHome/TVHome/Controls/MainPanelButton.xaml.cs
TVHome/TVHome/Views/SubPanel.xaml.cs
TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs

index 14f06600fbf2978e0f9423d77877ac92f32622a4..25c409e1c05ab049ed720663e6254164742a0b65 100644 (file)
Binary files a/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk and b/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk differ
index 42bab993316623e23ca50a68149a9e4e03223fd5..1069aafd188929b69d06a02f23a3ef861be43ca5 100755 (executable)
  */
 
 using System;
-using System.Windows.Input;
-using LibTVRefCommonPortable.Utils;
 using Xamarin.Forms;
-using System.Threading.Tasks;
 
 namespace TVHome.Controls
 {
@@ -35,54 +32,12 @@ namespace TVHome.Controls
             set { SetValue(StatusProperty, value); }
         }
 
-        private Animation SelectedAnimation;
-        private Animation[] SelectedAnimationFrames;
-
         public MainPanelButton()
         {
             InitializeComponent();
             PropertyChanged += MainPanelButton_PropertyChanged;
         }
 
-        private void SetSelecetedAnimation()
-        {
-            SelectedAnimation = new Animation();
-            SelectedAnimationFrames = new Animation[10];
-            SelectedAnimationFrames[0] = new Animation((v) =>
-            {
-                ButtonBlurImage.Opacity = 0.99;
-            });
-
-            for (int i = 1; i <= 8; i++)
-            {
-                var index = i;
-                SelectedAnimationFrames[i] = new Animation((v) =>
-                {
-                    DebuggingUtils.Dbg("" + index);
-                    ButtonBlurImage.Source = "home_icon_bg_0" + index + ".png";
-                });
-            }
-
-            SelectedAnimationFrames[9] = new Animation((v) =>
-            {
-                ButtonBlurImage.Opacity = 0;
-                ButtonBgImage.Opacity = 0;
-                ButtonTitle.Opacity = 0;
-                ButtonBlurImage.Source = "home_icon_bg_01.png";
-            });
-
-            SelectedAnimation.Add(0.000, 0.001, SelectedAnimationFrames[0]);
-            SelectedAnimation.Add(0.111, 0.112, SelectedAnimationFrames[1]);
-            SelectedAnimation.Add(0.222, 0.223, SelectedAnimationFrames[2]);
-            SelectedAnimation.Add(0.333, 0.334, SelectedAnimationFrames[3]);
-            SelectedAnimation.Add(0.444, 0.445, SelectedAnimationFrames[4]);
-            SelectedAnimation.Add(0.555, 0.556, SelectedAnimationFrames[5]);
-            SelectedAnimation.Add(0.666, 0.667, SelectedAnimationFrames[6]);
-            SelectedAnimation.Add(0.777, 0.778, SelectedAnimationFrames[7]);
-            SelectedAnimation.Add(0.888, 0.889, SelectedAnimationFrames[8]);
-            SelectedAnimation.Add(0.999, 1.000, SelectedAnimationFrames[9]);
-        }
-
         private void MainPanelButton_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
         {
             if (e.PropertyName.CompareTo("Status") == 0)
@@ -91,8 +46,19 @@ namespace TVHome.Controls
                 switch (Status)
                 {
                     case "selected":
-                        SetSelecetedAnimation();
-                        SelectedAnimation.Commit(ButtonBlurImage, "SelectedAnimation", 16, 300);
+                        ButtonBlurImage.Opacity = 0.99;
+                        ButtonBlurImage.Animate("ImageChange", v =>
+                        {
+                            var imageIndex = (int)(1 + 7 * v);
+                            ButtonBlurImage.Source = "home_icon_bg_0" + imageIndex + ".png";
+                        },
+                        length: 200,
+                        finished: (d, b) =>
+                        {
+                            ButtonBlurImage.Opacity = 0;
+                            ButtonBgImage.Opacity = 0;
+                            ButtonTitle.Opacity = 0;
+                        });
                         break;
                     case "focused":
                         ButtonTitle.FadeTo(0.8, 100);
index 547155efd029c62865c90a10587d1ef99d4f4b77..e33b6de0c0ec95026f263d3efef17a573dbda513 100755 (executable)
@@ -87,7 +87,7 @@ namespace TVHome.Views
 
             if (!isFocused)
             {
-                HidePanel();
+                ShowPanel();
             }
             else
             {
index 49c8fc17001236241aafa7768c096fcc05b62559..62301a054c854b1bd82c4ce2bb7c45dc3ffd32b0 100755 (executable)
  * limitations under the License.
  */
 
-using System;
-using System.Collections.Generic;
-using System.Windows.Input;
 using System.ComponentModel;
 using TVHome.Controls;
 using LibTVRefCommonPortable.DataModels;
-using TVHome.ViewModels;
 using Xamarin.Forms;
-using LibTVRefCommonPortable.Utils;
+using System.Threading.Tasks;
 
 namespace TVHome.Views
 {
@@ -143,9 +139,10 @@ namespace TVHome.Views
             OnFocusedCommand.Execute("");
 
             isFocused = true;
-            var button = PanelButtonStack.Children[1];
+            var button = PanelButtonStack.Children[0];
             button.FindByName<Button>("ButtonFocusArea").Focus();
 
+            await Task.Delay(300);
 #pragma warning disable CS4014
             this.TranslateTo(0, -140, 300);
 #pragma warning restore CS4014