From: Heonjae Jang Date: Thu, 23 Mar 2017 11:04:38 +0000 (+0900) Subject: TV Home - Fix SubThumbnailPanel Animation X-Git-Tag: submit/tizen/20170808.015446~164 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7abcb930b4f761c9f848322d62ae2f5a0c76dd85;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git TV Home - Fix SubThumbnailPanel Animation 1. Fix SubThumbnailPanel Focused Animation 2. Change HidePanel to ShowPanel When Pinned List Changed Change-Id: I3e8b150bbf1e48ce311550f2166a0ed5ebf3eb61 --- diff --git a/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk b/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk index 14f0660..25c409e 100644 Binary files a/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk and b/TVHome/TVHome.TizenTV/bin/Debug/TVHome.TizenTV.tpk differ diff --git a/TVHome/TVHome/Controls/MainPanelButton.xaml.cs b/TVHome/TVHome/Controls/MainPanelButton.xaml.cs index 42bab99..1069aaf 100755 --- a/TVHome/TVHome/Controls/MainPanelButton.xaml.cs +++ b/TVHome/TVHome/Controls/MainPanelButton.xaml.cs @@ -15,10 +15,7 @@ */ 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); diff --git a/TVHome/TVHome/Views/SubPanel.xaml.cs b/TVHome/TVHome/Views/SubPanel.xaml.cs index 547155e..e33b6de 100755 --- a/TVHome/TVHome/Views/SubPanel.xaml.cs +++ b/TVHome/TVHome/Views/SubPanel.xaml.cs @@ -87,7 +87,7 @@ namespace TVHome.Views if (!isFocused) { - HidePanel(); + ShowPanel(); } else { diff --git a/TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs b/TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs index 49c8fc1..62301a0 100755 --- a/TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs +++ b/TVHome/TVHome/Views/SubThumbnailPanel.xaml.cs @@ -14,15 +14,11 @@ * 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