diff options
author | JH Choi <jjie.choi@samsung.com> | 2017-07-14 17:38:56 +0900 |
---|---|---|
committer | JH Choi <jjie.choi@samsung.com> | 2017-07-14 17:38:56 +0900 |
commit | e4314b3412fa3384e5212b25bee9112c1f2776c9 (patch) | |
tree | 2850060d3613ac7373ddea7510f580a6c7f2eaa9 | |
parent | d654987aec0b674a36a4219474109af323e225ef (diff) | |
download | mediahub-e4314b3412fa3384e5212b25bee9112c1f2776c9.tar.gz mediahub-e4314b3412fa3384e5212b25bee9112c1f2776c9.tar.bz2 mediahub-e4314b3412fa3384e5212b25bee9112c1f2776c9.zip |
Implements music tab title animation. Changed group title font
Change-Id: Ib3d7a19940e5f6af2b05267c36226b931499de3b
Signed-off-by: JH Choi <jjie.choi@samsung.com>
5 files changed, 75 insertions, 15 deletions
diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/ImageGroup.xaml b/TVMediaHub/TVMediaHub.Tizen/Views/ImageGroup.xaml index db52011..1577bfc 100644 --- a/TVMediaHub/TVMediaHub.Tizen/Views/ImageGroup.xaml +++ b/TVMediaHub/TVMediaHub.Tizen/Views/ImageGroup.xaml @@ -3,22 +3,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="TVMediaHub.Tizen.Views.ImageGroup" ItemsSource="{Binding Contents}"> - <RelativeLayout.Resources> - <ResourceDictionary> - <Style x:Key="GroupNameNormal" TargetType="Label"> - <Setter Property="FontFamily" Value="Breeze Sans Light"/> - <Setter Property="TextColor" Value="#33FFFFFF"/> - </Style> - <Style x:Key="GroupNameSelected" TargetType="Label"> - <Setter Property="FontFamily" Value="Breeze Sans Light"/> - <Setter Property="TextColor" Value="#FFFFFFFF"/> - </Style> - </ResourceDictionary> - </RelativeLayout.Resources> <Button x:Name="TitleFocusArea" Opacity ="0" RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.085}"/> - <Label x:Name="GroupTitle" Text="{Binding Title}" Style="{StaticResource GroupNameSelected}" + <Label x:Name="GroupTitle" Text="{Binding Title}" RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.085}"/> <Grid x:Name="GroupContentArea" diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/ImageGroup.xaml.cs b/TVMediaHub/TVMediaHub.Tizen/Views/ImageGroup.xaml.cs index e335222..6d539eb 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Views/ImageGroup.xaml.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Views/ImageGroup.xaml.cs @@ -105,6 +105,8 @@ namespace TVMediaHub.Tizen.Views ImageItemList = new List<ImageItem>(); GroupTitle.TextColor = Color.FromRgba(255, 255, 255, 31); + GroupTitle.FontFamily = "BreezSans"; + GroupTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Normal); TitleFocusArea.Focused += TitleFocused; TitleFocusArea.Unfocused += TitleUnfocused; diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml b/TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml index 34277cc..4ae9ec0 100644 --- a/TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml +++ b/TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml @@ -4,7 +4,8 @@ x:Class="TVMediaHub.Tizen.Views.MusicGroup" ItemsSource="{Binding Contents}"> <Button x:Name="TitleFocusArea" Opacity ="0" - RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.0737}"/> + RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.0737}" + Focused="OnTitleFocused" Unfocused="OnTitleUnFocused"/> <Label x:Name="GroupTitle" Text="{Binding Title}" RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.0737}"/> diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml.cs b/TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml.cs index e246b74..d4b06a0 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml.cs @@ -118,6 +118,9 @@ namespace TVMediaHub.Tizen.Views LeftFocusList = new List<Button>(); RightFocusList = new List<Button>(); MusicItemList = new List<MusicItem>(); + GroupTitle.TextColor = Color.FromRgba(255, 255, 255, 31); + GroupTitle.FontFamily = "BreezSans"; + GroupTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Normal); } /// <summary> @@ -300,5 +303,69 @@ namespace TVMediaHub.Tizen.Views return false; } + + /// <summary> + /// This method is called when the group's title is focused + /// </summary> + /// <param name="sender">The source of the event</param> + /// <param name="e">A Focus event's argument</param> + public void OnTitleFocused(object sender, FocusEventArgs e) + { + GroupTitle.AbortAnimation("FocusAnimation"); + GroupTitle.Animate("FocusAnimation", + (v) => { }, + length: 167, + finished: (v, IsCanceled) => + { + if (!IsCanceled) + { + + GroupTitle.Animate("FocusAnimation", + (v2) => + { + var R = (int)(255 * (1 - v)); + var G = (int)(255 - 126 * v); + var B = (int)(255 - 57 * v); + var A = (int)(31 + 224 * v); + GroupTitle.TextColor = Color.FromRgba(R, G, B, A); + }, + length: 167, + finished: (v2, IsCanceled2) => + { + if (!IsCanceled) + { + GroupTitle.TextColor = Color.FromRgba(0, 129, 198, 255); + } + }); + } + }); + } + + /// <summary> + /// This method is called when the group's title is unfocused + /// </summary> + /// <param name="sender">The source of the event</param> + /// <param name="e">A Focus event's argument</param> + public void OnTitleUnFocused(object sender, FocusEventArgs e) + { + GroupTitle.AbortAnimation("FocusAnimation"); + GroupTitle.Animate("FocusAnimation", + (v) => + { + var R = (int)(255 * v); + var G = (int)(129 + 126 * v); + var B = (int)(198 + 57 * v); + var A = (int)(255 - 224 * v); + GroupTitle.TextColor = Color.FromRgba(R, G, B, A); + }, + length: 167, + finished: (v, IsCanceled) => + { + if (!IsCanceled) + { + GroupTitle.TextColor = Color.FromRgba(255, 255, 255, 31); + } + }); + } } }
\ No newline at end of file diff --git a/TVMediaHub/TVMediaHub.Tizen/Views/VideoGroup.xaml.cs b/TVMediaHub/TVMediaHub.Tizen/Views/VideoGroup.xaml.cs index 90532d5..204d1e9 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Views/VideoGroup.xaml.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Views/VideoGroup.xaml.cs @@ -125,6 +125,8 @@ namespace TVMediaHub.Tizen.Views GroupTitleFocusArea = new Button(); GroupContentArea = new Grid(); + GroupTitle.FontFamily = "BreezSans"; + GroupTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Normal); GroupTitle.SetBinding(Xamarin.Forms.Label.TextProperty, new Binding("Title")); GroupTitle.TextColor = Color.FromRgba(255, 255, 255, 31); @@ -225,7 +227,7 @@ namespace TVMediaHub.Tizen.Views GroupContentArea.RowSpacing = SizeUtils.GetWidthSize(-150); GroupContentArea.ColumnSpacing = SizeUtils.GetWidthSize(-150); - GroupTitle.FontSize = SizeUtils.GetFontSize(24); + GroupTitle.FontSize = SizeUtils.GetFontSize(28); } /// <summary> |