From: Hyerim Kim Date: Thu, 27 Apr 2017 07:30:13 +0000 (+0900) Subject: Adjust font weight & font family X-Git-Tag: submit/tizen/20170808.015446~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0422a37c4e25ceadd92ce31cd458606a4460af73;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Adjust font weight & font family Removes unused files Change-Id: I23dea2f84c84c04e0b368b60907a52ab29e33081 Signed-off-by: Hyerim Kim --- diff --git a/TVApps/TVApps.TizenTV/Renderer/CustomButtonRenderer.cs b/TVApps/TVApps.TizenTV/Renderer/CustomButtonRenderer.cs deleted file mode 100644 index bcf0504..0000000 --- a/TVApps/TVApps.TizenTV/Renderer/CustomButtonRenderer.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using LibTVRefCommonTizen.Ports; -using System; - -using TVApps.Controls; -using TVApps.TizenTV.Renderer; -using Xamarin.Forms.Platform.Tizen; - -[assembly: ExportRenderer(typeof(CustomButton), typeof(CustomButtonRenderer))] -namespace TVApps.TizenTV.Renderer -{ - /// - /// A custom renderer for CustomButton - /// - /// - class CustomButtonRenderer : ButtonRenderer//ViewRenderer - { - /// - /// Register touch event callback for the Tap. - /// - /// A button element changed event's argument - protected override void OnElementChanged(ElementChangedEventArgs args) - { - base.OnElementChanged(args); - - if (Control == null || - Element == null) - { - return; - } - - if (args.NewElement == null) - { - return; - } - - Control.Pressed += KeyDown; - Control.Released += KeyUp; - } - - /// - /// A action delegate invokes OnButtonUp event - /// - /// The source of the event - /// The event that is occurred when Control(Native Button) is pressed - private void KeyUp(object sender, EventArgs e) - { - DbgPort.D("KeyUp"); - CustomButton BtnElement = Element as CustomButton; - BtnElement.OnButtonUp.Invoke(sender, e); - } - - /// - /// A action delegate invokes OnButtonDown event - /// - /// The source of the event - /// The event that is occurred when Control(Native Button) is released - private void KeyDown(object sender, EventArgs e) - { - DbgPort.D("KeyDown"); - CustomButton BtnElement = Element as CustomButton; - BtnElement.OnButtonDown.Invoke(sender, e); - } - } -} diff --git a/TVApps/TVApps.TizenTV/TVApps.TizenTV.csproj b/TVApps/TVApps.TizenTV/TVApps.TizenTV.csproj old mode 100644 new mode 100755 index 58da673..928e07d --- a/TVApps/TVApps.TizenTV/TVApps.TizenTV.csproj +++ b/TVApps/TVApps.TizenTV/TVApps.TizenTV.csproj @@ -47,7 +47,6 @@ - diff --git a/TVApps/TVApps/Controls/AppItemCell.xaml b/TVApps/TVApps/Controls/AppItemCell.xaml index d89ffdb..ae81644 100755 --- a/TVApps/TVApps/Controls/AppItemCell.xaml +++ b/TVApps/TVApps/Controls/AppItemCell.xaml @@ -58,6 +58,7 @@ LineBreakMode="TailTruncation" HorizontalTextAlignment="Center" VerticalTextAlignment="End" + FontFamily="BreezeSans" Text="{Binding CurrentStateDescription.Label}" /> /// A enumeration for AppItemCell icon size /// @@ -281,6 +283,7 @@ namespace TVApps.Controls OnPropertyChanged("IsFocused"); OnFocusedCommand?.Execute(""); + ButtonTitle.On().SetFontWeight(FontWeight.Medium); if (IsChecked) { @@ -304,6 +307,7 @@ namespace TVApps.Controls { IsFocused = false; OnPropertyChanged("IsFocused"); + ButtonTitle.On().SetFontWeight(FontWeight.Normal); if (!IsShowOptions) { diff --git a/TVApps/TVApps/Controls/CustomButton.xaml b/TVApps/TVApps/Controls/CustomButton.xaml deleted file mode 100644 index 413f1e2..0000000 --- a/TVApps/TVApps/Controls/CustomButton.xaml +++ /dev/null @@ -1,5 +0,0 @@ - - \ No newline at end of file diff --git a/TVApps/TVApps/Controls/CustomButton.xaml.cs b/TVApps/TVApps/Controls/CustomButton.xaml.cs deleted file mode 100644 index 19e76b5..0000000 --- a/TVApps/TVApps/Controls/CustomButton.xaml.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; - -using Xamarin.Forms; - -namespace TVApps.Controls -{ - /// - /// A custom control for TVButton to get pressed/release status - /// - public partial class CustomButton : Button - { - /// - /// A event handler for button released event - /// - public EventHandler OnButtonUp; - - /// - /// A event handler for button pressed event - /// - public EventHandler OnButtonDown; - - /// - /// A constructor - /// - public CustomButton() - { - InitializeComponent(); - } - } -} diff --git a/TVApps/TVApps/Controls/TVButton.xaml b/TVApps/TVApps/Controls/TVButton.xaml deleted file mode 100644 index 765c448..0000000 --- a/TVApps/TVApps/Controls/TVButton.xaml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TVApps/TVApps/Controls/TVButton.xaml.cs b/TVApps/TVApps/Controls/TVButton.xaml.cs deleted file mode 100644 index 8b00e77..0000000 --- a/TVApps/TVApps/Controls/TVButton.xaml.cs +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.1 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using LibTVRefCommonPortable.Utils; -using System; -using System.Windows.Input; -using Xamarin.Forms; - -namespace TVApps.Controls -{ - /// - /// A custom control for buttons in footer of TV Apps - /// - public partial class TVButton : StackLayout - { - /// - /// Gets or sets text of TVButton - /// - public string Text - { - get { return TitleText.Text; } - set { TitleText.Text = value; } - } - - public event EventHandler Clicked; - - /// - /// Identifies the Command bindable property - /// - public static readonly BindableProperty CommandProperty = BindableProperty.Create(nameof(Command), typeof(ICommand), typeof(TVButton), null, BindingMode.TwoWay); - - /// - /// Gets or sets command of TV Button - /// The command will be executed if the button is touched - /// - public ICommand Command - { - get { return (ICommand)GetValue(CommandProperty); } - set { SetValue(CommandProperty, value); } - } - - /// - /// A command parameter will be passed when the Command is executed - /// - /// - public string CommandParameter - { - get; - set; - } - - - /// - /// The image path for button is pressed - /// - private static readonly string ButtonImagePressed = "btn_tizen_dropdown_line_dimmed.9.png"; - - /// - /// The image path for button is released - /// - private static readonly string ButtonImageReleased = "btn_tizen_dropdown_line_normal.9.png"; - - /// - /// Constructor - /// - public TVButton() - { - InitializeComponent(); - - WidthRequest = SizeUtils.GetWidthSize(300); - HeightRequest = SizeUtils.GetHeightSize(80); - - HiddenButton.Clicked += ButtonClickListener; - HiddenButton.Focused += ButtonFocusedListener; - HiddenButton.Unfocused += ButtonUnfocusedListener; - HiddenButton.OnButtonUp += ButtonUpListener; - HiddenButton.OnButtonDown += ButtonDownListener; - } - - /// - /// This method is called when the TVButton is clicked - /// - /// The source of the event - /// The event that is occurred when button is clicked - private void ButtonClickListener(object sender, EventArgs e) - { - // Stops playing animation - ButtonGrid.AbortAnimation("ColorChange"); - - // Starts animation that change Focused Color to Selected Color - ButtonGrid.Animate("ColorChange", v => - { - var gridColorR = (int)(255 * (1 - v)); - var gridColorG = (int)(255 - 126 * v); - var gridColorB = (int)(255 - 57 * v); - ButtonGrid.BackgroundColor = Color.FromRgb(gridColorR, gridColorG, gridColorB); - }, - length: 100, - finished: (a, b) => - { - // Starts animation that change Selected Color to Focused Color - ButtonGrid.Animate("ColorChange", v => - { - var gridColorR = (int)(255 * v); - var gridColorG = (int)(129 + 126 * v); - var gridColorB = (int)(198 + 57 * v); - ButtonGrid.BackgroundColor = Color.FromRgb(gridColorR, gridColorG, gridColorB); - }, - length: 50, - finished: (c, d) => - { - ButtonGrid.BackgroundColor = Color.FromRgb(255, 255, 255); - Command?.Execute(CommandParameter); - Clicked?.Invoke(sender, e); - }); - }); - } - - /// - /// This method is called when the TVButton receives focus - /// - /// The source of the event - /// The event that is occurred when button is focused - private void ButtonFocusedListener(object sender, FocusEventArgs e) - { - // Stops playing animation - ButtonGrid.AbortAnimation("ColorChange"); - - // Starts animation that change Unfocused Color to Focused Color - ButtonGrid.Animate("ColorChange", v => - { - var gridColor = (int)(255 * v); - var textColor = (int)(255 * (1 - v)); - ButtonGrid.BackgroundColor = Color.FromRgb(gridColor, gridColor, gridColor); - TitleText.TextColor = Color.FromRgb(textColor, textColor, textColor); - }, - length: 150); - } - - /// - /// This method is called when the TVButton loses focus - /// - /// The source of the event - /// The event that is occurred when button is unfocused - private void ButtonUnfocusedListener(object sender, FocusEventArgs e) - { - // Stops playing animation - ButtonGrid.AbortAnimation("ColorChange"); - - // Starts animation that change Focused Color to Unfocused Color - ButtonGrid.Animate("ColorChange", v => - { - var gridColor = (int)(255 * (1 - v)); - var textColor = (int)(255 * v); - ButtonGrid.BackgroundColor = Color.FromRgb(gridColor, gridColor, gridColor); - TitleText.TextColor = Color.FromRgb(textColor, textColor, textColor); - }, - length: 150); - } - - /// - /// This method is called when the TVButton is released - /// - /// The event sender - /// The event that is occurred when button is released - public void ButtonUpListener(object sender, EventArgs e) - { - BackgroundImage.Source = ButtonImageReleased; - Command?.Execute(CommandParameter); - } - - /// - /// This method is called when the TVButton is pressed - /// - /// The source of the event - /// The event that is occurred when button is pressed - public void ButtonDownListener(object sender, EventArgs e) - { - BackgroundImage.Source = ButtonImagePressed; - } - - /// - /// A method positions and sizes the children - /// - /// The x position for the children - /// The y position for the children - /// The width for the children - /// The height for the children - protected override void LayoutChildren(double x, double y, double width, double height) - { - base.LayoutChildren(x, y, width, height); - - BackgroundImage.HeightRequest = height; - BackgroundImage.WidthRequest = width; - } - } -} diff --git a/TVApps/TVApps/TVApps.csproj b/TVApps/TVApps/TVApps.csproj index 80ffed5..fdc7c03 100755 --- a/TVApps/TVApps/TVApps.csproj +++ b/TVApps/TVApps/TVApps.csproj @@ -40,15 +40,9 @@ AppListView.xaml - - CustomButton.xaml - NinePatchImage.xaml - - TVButton.xaml - @@ -92,12 +86,6 @@ Designer - - - MSBuild:UpdateDesignTimeXaml - Designer - - MSBuild:UpdateDesignTimeXaml @@ -112,12 +100,6 @@ Designer - - - MSBuild:UpdateDesignTimeXaml - Designer - - {67f9d3a8-f71e-4428-913f-c37ae82cdb24} diff --git a/TVApps/TVApps/Views/MainPage.xaml b/TVApps/TVApps/Views/MainPage.xaml index b191d31..0c9dc8f 100755 --- a/TVApps/TVApps/Views/MainPage.xaml +++ b/TVApps/TVApps/Views/MainPage.xaml @@ -22,21 +22,21 @@ @@ -87,7 +87,7 @@ HorizontalTextAlignment="Center" VerticalOptions="CenterAndExpand" FontSize="{Binding AddtionalInfoTextSize}" /> -