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"
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;
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}"/>
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>
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
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);
GroupContentArea.RowSpacing = SizeUtils.GetWidthSize(-150);
GroupContentArea.ColumnSpacing = SizeUtils.GetWidthSize(-150);
- GroupTitle.FontSize = SizeUtils.GetFontSize(24);
+ GroupTitle.FontSize = SizeUtils.GetFontSize(28);
}
/// <summary>