<Controls:PanelButton xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:Controls="clr-namespace:TVHome.Controls"
- x:Class="TVHome.Controls.MainPanelButton">
- <RelativeLayout x:Name="ButtonBox"
- HorizontalOptions="Center"
- VerticalOptions="Center">
+ x:Class="TVHome.Controls.MainPanelButton"
+ HorizontalOptions="Center"
+ VerticalOptions="Center">
<Image x:Name="ButtonBgImage"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
Unfocused="OnUnfocused"
Clicked="OnClicked"
Opacity="0" />
- </RelativeLayout>
</Controls:PanelButton>
{
InitializeComponent();
- ButtonBox.WidthRequest = SizeUtils.GetWidthSize(236);
- ButtonBox.HeightRequest = SizeUtils.GetHeightSize(260);
+ WidthRequest = SizeUtils.GetWidthSize(236);
+ HeightRequest = SizeUtils.GetHeightSize(260);
ButtonTitle.FontSize = SizeUtils.GetFontSize(26);
ButtonTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Medium);
/// TVHome has two panels, MainPanel and SubPanel. The panels have several panel buttons.
/// The class for handling panel button's events
/// </summary>
- public abstract class PanelButton : ViewCell
+ public abstract class PanelButton : RelativeLayout
{
public bool isMoveMode;
public bool isFocused;
<Controls:PanelButton xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:Controls="clr-namespace:TVHome.Controls"
- x:Class="TVHome.Controls.SubPanelAllAppsButton">
- <RelativeLayout x:Name="ButtonBox"
- HorizontalOptions="Center"
- VerticalOptions="End">
- <Image x:Name="ButtonImage"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.120879}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.095652}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.6}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.75824}"
- Source="{Binding CurrentStateDescription.IconPath}" />
- <Image x:Name="ButtonDimmedImage"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.120879}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.095652}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.6}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.75824}"
- Source="img_home_list_dimmed_apps_60.png" />
- <Label x:Name="ButtonTitle"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.120879}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.77391}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.1303478}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.758241}"
- Opacity="0.6"
- TextColor="White"
- LineBreakMode="TailTruncation"
- FontFamily="BreezeSans"
- HorizontalTextAlignment="Center"
- Text="{Binding CurrentStateDescription.Label}" />
- <Button x:Name = "ButtonFocusArea"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
- Focused="OnFocused"
- Unfocused="OnUnfocused"
- Clicked="OnClicked"
- Opacity="0" />
- </RelativeLayout>
+ x:Class="TVHome.Controls.SubPanelAllAppsButton"
+ HorizontalOptions="Center"
+ VerticalOptions="End">
+ <Image x:Name="ButtonImage"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.120879}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.095652}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.75824}"
+ Source="{Binding CurrentStateDescription.IconPath}" />
+ <Image x:Name="ButtonDimmedImage"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.120879}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.095652}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.75824}"
+ Source="img_home_list_dimmed_apps_60.png" />
+ <Label x:Name="ButtonTitle"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.120879}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.77391}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.1303478}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.758241}"
+ Opacity="0.6"
+ TextColor="White"
+ LineBreakMode="TailTruncation"
+ FontFamily="BreezeSans"
+ HorizontalTextAlignment="Center"
+ Text="{Binding CurrentStateDescription.Label}" />
+ <Button x:Name = "ButtonFocusArea"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ Focused="OnFocused"
+ Unfocused="OnUnfocused"
+ Clicked="OnClicked"
+ Opacity="0" />
</Controls:PanelButton>
\ No newline at end of file
{
InitializeComponent();
- ButtonBox.WidthRequest = SizeUtils.GetWidthSize(182);
- ButtonBox.HeightRequest = SizeUtils.GetHeightSize(230);
+ WidthRequest = SizeUtils.GetWidthSize(182);
+ HeightRequest = SizeUtils.GetHeightSize(230);
ButtonTitle.FontSize = SizeUtils.GetFontSize(26);
ButtonTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Normal);
}
OnClickedCommand.Execute("");
}
- await View.FadeTo(0.99, 300);
+ await this.FadeTo(0.99, 300);
}
/// <summary>
<Controls:PanelButton xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:Controls="clr-namespace:TVHome.Controls"
- x:Class="TVHome.Controls.SubPanelButton">
- <RelativeLayout x:Name="ButtonBox"
- HorizontalOptions="Center"
- VerticalOptions="End">
- <Image x:Name="ButtonImage"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.120879}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.095652}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.6}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.75824}"
- Source="{Binding CurrentStateDescription.IconPath}" />
- <Image x:Name="ButtonDimmedImage"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.120879}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.095652}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.6}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.75824}"
- Source="img_home_list_dimmed_apps_60.png" />
- <Label x:Name="ButtonTitle"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.120879}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.77391}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.1303478}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.758241}"
- Opacity="0.6"
- TextColor="White"
- FontFamily="BreezeSans"
- LineBreakMode="TailTruncation"
- HorizontalTextAlignment="Center"
- Text="{Binding CurrentStateDescription.Label}" />
- <Button x:Name = "ButtonFocusArea"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
- Focused="OnFocused"
- Unfocused="OnUnfocused"
- Clicked="OnClicked"
- Opacity="0" />
- <Image x:Name="LeftBtnImg"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.326923}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.156521}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.06044}"
- Source="btn_home_list_move_left.png"
- Opacity="0"/>
- <Image x:Name="RightBtnImg"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.93956}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.326923}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.156521}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.06044}"
- Source="btn_home_list_move_right.png"
- Opacity="0"/>
- </RelativeLayout>
+ x:Class="TVHome.Controls.SubPanelButton"
+ HorizontalOptions="Center"
+ VerticalOptions="End">
+ <Image x:Name="ButtonImage"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.120879}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.095652}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.75824}"
+ Source="{Binding CurrentStateDescription.IconPath}" />
+ <Image x:Name="ButtonDimmedImage"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.120879}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.095652}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.75824}"
+ Source="img_home_list_dimmed_apps_60.png" />
+ <Label x:Name="ButtonTitle"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.120879}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.77391}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.1303478}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.758241}"
+ Opacity="0.6"
+ TextColor="White"
+ FontFamily="BreezeSans"
+ LineBreakMode="TailTruncation"
+ HorizontalTextAlignment="Center"
+ Text="{Binding CurrentStateDescription.Label}" />
+ <Button x:Name = "ButtonFocusArea"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ Focused="OnFocused"
+ Unfocused="OnUnfocused"
+ Clicked="OnClicked"
+ Opacity="0" />
+ <Image x:Name="LeftBtnImg"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.326923}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.156521}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.06044}"
+ Source="btn_home_list_move_left.png"
+ Opacity="0"/>
+ <Image x:Name="RightBtnImg"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.93956}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.326923}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.156521}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.06044}"
+ Source="btn_home_list_move_right.png"
+ Opacity="0"/>
</Controls:PanelButton>
\ No newline at end of file
{
InitializeComponent();
- ButtonBox.WidthRequest = SizeUtils.GetWidthSize(182);
- ButtonBox.HeightRequest = SizeUtils.GetHeightSize(230);
+ WidthRequest = SizeUtils.GetWidthSize(182);
+ HeightRequest = SizeUtils.GetHeightSize(230);
ButtonTitle.FontSize = SizeUtils.GetFontSize(26);
ButtonTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Normal);
}
};
- popup.Show(View, View.Width / 2, View.Height - (moveTransitionHeight + selectTransitionHeight));
+ popup.Show(this, Width / 2, Height - (moveTransitionHeight + selectTransitionHeight));
ButtonTitle.FadeTo(0, 300);
isShowOptions = true;
}
OnClickedCommand.Execute("");
}
- await View.FadeTo(0.99, 300);
+ await this.FadeTo(0.99, 300);
}
else
{
{
if (!isDefault)
{
- await View.TranslateTo(SizeUtils.GetWidthSize((int)View.TranslationX), 0, 300);
+ await this.TranslateTo(SizeUtils.GetWidthSize((int)TranslationX), 0, 300);
}
else
{
- await View.TranslateTo(0, SizeUtils.GetHeightSize((int)View.TranslationY), 0);
- await View.TranslateTo(0, 0, 300);
+ await this.TranslateTo(0, SizeUtils.GetHeightSize((int)TranslationY), 0);
+ await this.TranslateTo(0, 0, 300);
}
OnFocused(null, null);
if (showOptions)
{
#pragma warning disable CS4014
- View.TranslateTo(0, -moveTransitionHeight, 300);
+ this.TranslateTo(0, -moveTransitionHeight, 300);
ButtonImage.ScaleTo(1, 300);
#pragma warning restore CS4014
}
else
{
- await View.TranslateTo(0, 0, 300);
+ await this.TranslateTo(0, 0, 300);
OnFocused(null, null);
}
<Controls:PanelButton xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:Controls="clr-namespace:TVHome.Controls"
- x:Class="TVHome.Controls.SubPanelSettingButton">
- <RelativeLayout x:Name="ButtonBox"
- HorizontalOptions="Center"
- VerticalOptions="End">
+ x:Class="TVHome.Controls.SubPanelSettingButton"
+ HorizontalOptions="Center"
+ VerticalOptions="End">
<Image x:Name="ButtonImage"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.120879}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.095652}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.6}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.75824}"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.120879}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.095652}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.75824}"
Source="{Binding CurrentStateDescription.IconPath}" />
<Image x:Name="ButtonDimmedImage"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.120879}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.095652}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.6}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.75824}"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.120879}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.095652}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.75824}"
Source="img_home_list_dimmed_apps_60.png" />
<Label x:Name="ButtonTitle"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.120879}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.77391}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.1303478}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.758241}"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.120879}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.77391}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.1303478}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.758241}"
Opacity="0.6"
TextColor="White"
FontFamily="BreezeSans"
HorizontalTextAlignment="Center"
Text="{Binding CurrentStateDescription.Label}"/>
<Button x:Name = "ButtonFocusArea"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
Focused="OnFocused"
Unfocused="OnUnfocused"
Clicked="OnClicked"
Opacity="0" />
- </RelativeLayout>
</Controls:PanelButton>
\ No newline at end of file
{
InitializeComponent();
- ButtonBox.WidthRequest = SizeUtils.GetWidthSize(182);
- ButtonBox.HeightRequest = SizeUtils.GetHeightSize(230);
+ WidthRequest = SizeUtils.GetWidthSize(182);
+ HeightRequest = SizeUtils.GetHeightSize(230);
ButtonTitle.FontSize = SizeUtils.GetFontSize(26);
ButtonTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Normal);
}
OnClickedCommand.Execute("");
}
- await View.FadeTo(0.99, 300);
+ await this.FadeTo(0.99, 300);
}
/// <summary>
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:Controls="clr-namespace:TVHome.Controls"
x:Class="TVHome.Controls.SubPanelThumbnailButton">
- <RelativeLayout x:Name="ButtonBox">
- <Image x:Name="ThumbnailImage"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
- Source="{Binding ScreenshotPath}" />
- <Controls:NinePatchImage x:Name="ThumbnailGradient"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
- Aspect="Fill"
- BorderTop="2"
- BorderBottom="2"
- BorderLeft="1"
- BorderRight="1"
- Source="ic_list_thumbnail_gradient_normal.9.png" />
- <Image x:Name="ThumbnailIcon"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.043}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.689}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.131}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.233}"
- Source="{Binding CurrentStateDescription.IconPath}" />
- <Label x:Name="ThumbnailTitle"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.206}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.722}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=0.75}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=0.166}"
- LineBreakMode="TailTruncation"
- FontFamily="BreezeSans"
- Text="{Binding CurrentStateDescription.Label}"
- TextColor="#FFFFFF"/>
- <Image x:Name="ThumnailDimLayer"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
- Aspect="Fill"
- Opacity="0.99"
- Source="img_tizen_home_list_dimmed_recent.png"/>
- <Button x:Name="ButtonFocusArea"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Width, Factor=1}"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonBox, Property=Height, Factor=1}"
- Focused="OnFocused"
- Unfocused="OnUnfocused"
- Clicked="OnClicked"
- Opacity="0" />
- </RelativeLayout>
+ <Image x:Name="ThumbnailImage"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ Source="{Binding ScreenshotPath}" />
+ <Controls:NinePatchImage x:Name="ThumbnailGradient"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ Aspect="Fill"
+ BorderTop="2"
+ BorderBottom="2"
+ BorderLeft="1"
+ BorderRight="1"
+ Source="ic_list_thumbnail_gradient_normal.9.png" />
+ <Image x:Name="ThumbnailIcon"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.043}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.689}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.131}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.233}"
+ Source="{Binding CurrentStateDescription.IconPath}" />
+ <Label x:Name="ThumbnailTitle"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.206}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.722}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.75}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.166}"
+ LineBreakMode="TailTruncation"
+ FontFamily="BreezeSans"
+ Text="{Binding CurrentStateDescription.Label}"
+ TextColor="#FFFFFF"/>
+ <Image x:Name="ThumnailDimLayer"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ Aspect="Fill"
+ Opacity="0.99"
+ Source="img_tizen_home_list_dimmed_recent.png"/>
+ <Button x:Name="ButtonFocusArea"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ Focused="OnFocused"
+ Unfocused="OnUnfocused"
+ Clicked="OnClicked"
+ Opacity="0" />
</Controls:PanelButton>
\ No newline at end of file
{
InitializeComponent();
- ButtonBox.WidthRequest = SizeUtils.GetWidthSize(320);
- ButtonBox.HeightRequest = SizeUtils.GetHeightSize(180);
+ WidthRequest = SizeUtils.GetWidthSize(320);
+ HeightRequest = SizeUtils.GetHeightSize(180);
ThumbnailTitle.FontSize = SizeUtils.GetFontSize(26);
ThumbnailTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Normal);
OnClickedCommand.Execute("");
}
- await View.FadeTo(0.9, 300);
+ await this.FadeTo(0.9, 300);
}
/// <summary>
ThumbnailTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Medium);
//ThumbnailTitle.FadeTo(0.8, 300);
#pragma warning restore CS4014
- await View.ScaleTo(1.2, 300);
+ await this.ScaleTo(1.2, 300);
}
/// <summary>
ThumbnailGradient.Source = "ic_list_thumbnail_gradient_normal.9.png";
ThumbnailTitle.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Normal);
#pragma warning restore CS4014
- await View.ScaleTo(1.0, 300);
+ await this.ScaleTo(1.0, 300);
}
/// <summary>
isPopupShowing = false;
};
- popup.Show(View);
+ popup.Show(this);
isPopupShowing = true;
}
xmlns:Controls="clr-namespace:TVHome.Controls"
CurrentStatus="{Binding CurrentStatus}"
SelectedMenuName="{Binding SelectedMenuName}">
- <ContentPage.BindingContext>
- <ViewModels:MainPageViewModel />
- </ContentPage.BindingContext>
- <ContentPage.Content>
- <RelativeLayout>
- <Controls:NinePatchImage x:Name="DimmedBgImage"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
- Source="bg_home_gradient_dimmed.9.png"
- Aspect="Fill"
- BorderTop="2"
- BorderBottom="2"
- BorderLeft="2"
- BorderRight="2"/>
- <Views:MainPanel x:Name="PageMainPanel"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.22}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6537}"
- OnFocusedCommand="{Binding MainPanelFocusedCommand}"
- ItemsSource="{Binding MainList}"/>
+ <ContentPage.BindingContext>
+ <ViewModels:MainPageViewModel />
+ </ContentPage.BindingContext>
+ <ContentPage.Content>
+ <RelativeLayout>
+ <Controls:NinePatchImage x:Name="DimmedBgImage"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
+ Source="bg_home_gradient_dimmed.9.png"
+ Aspect="Fill"
+ BorderTop="2"
+ BorderBottom="2"
+ BorderLeft="2"
+ BorderRight="2"/>
+ <Views:MainPanel x:Name="PageMainPanel"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.22}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6537}"
+ OnFocusedCommand="{Binding MainPanelFocusedCommand}"
+ ItemsSource="{Binding MainList}"/>
- <Views:SubThumbnailPanel x:Name="RecentSubPanel"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.224}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.89}"
- OnFocusedCommand="{Binding SubPanelFocusedCommand}"
- OnClearVMCommand="{Binding OnClearCommand}"
- OnClearAllVMCommand="{Binding OnClearAllCommand}"
- ItemsSource="{Binding RecentList}"
- ShowNoContentsInfo="{Binding IsShowNoRecentContents}">
- </Views:SubThumbnailPanel>
+ <Views:SubThumbnailPanel x:Name="RecentSubPanel"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.224}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.89}"
+ OnFocusedCommand="{Binding SubPanelFocusedCommand}"
+ OnClearVMCommand="{Binding OnClearCommand}"
+ OnClearAllVMCommand="{Binding OnClearAllCommand}"
+ ItemsSource="{Binding RecentList}"
+ ShowNoContentsInfo="{Binding IsShowNoRecentContents}" />
- <Views:SubPanel x:Name="AppsSubPanel"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2370}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8833}"
- OnFocusedCommand="{Binding SubPanelFocusedCommand}"
- OnMoveVMCommand="{Binding OnMoveCommand}"
- OnUnpinVMCommand="{Binding OnUnpinCommand}"
- ItemsSource="{Binding AppList}" >
- </Views:SubPanel>
+ <Views:SubPanel x:Name="AppsSubPanel"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2370}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8833}"
+ OnFocusedCommand="{Binding SubPanelFocusedCommand}"
+ OnMoveVMCommand="{Binding OnMoveCommand}"
+ OnUnpinVMCommand="{Binding OnUnpinCommand}"
+ ItemsSource="{Binding AppList}" />
- <Views:SubPanel x:Name="SettingsSubPanel"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2370}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8833}"
- OnFocusedCommand="{Binding SubPanelFocusedCommand}"
- ItemsSource="{Binding SettingsList}">
- <Views:SubPanel.ItemTemplate>
- <DataTemplate>
- <Controls:SubPanelButton/>
- </DataTemplate>
- </Views:SubPanel.ItemTemplate>
- </Views:SubPanel>
-
- </RelativeLayout>
- </ContentPage.Content>
+ <Views:SubPanel x:Name="SettingsSubPanel"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2370}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8833}"
+ OnFocusedCommand="{Binding SubPanelFocusedCommand}"
+ ItemsSource="{Binding SettingsList}" />
+ </RelativeLayout>
+ </ContentPage.Content>
</ContentPage>
\ No newline at end of file
foreach (ShortcutInfo item in ItemsSource)
{
var button = new MainPanelButton();
- button.View.BindingContext = item;
- button.SetBinding(MainPanelButton.StatusProperty, new Binding("BindingContext.Status", source: button.View));
+ button.BindingContext = item;
HomeMenuItem ItemName = menuIndex;
button.OnFocusedCommand = new Command(() =>
{
OnItemSelectedHandler?.Invoke(ItemName);
//item.DoAction();
});
- PanelButtonGrid.Children.Add(button.View, index, 0);
+ PanelButtonGrid.Children.Add(button, index, 0);
index++;
menuIndex++;
/// <summary>
/// A method for translating when panel is selected
/// </summary>
- public async void SelectPanel()
+ public void SelectPanel()
{
- await Task.Delay(300);
- await this.TranslateTo(0, selectTransitionHeight, 300);
+ AnimationExtensions.AbortAnimation(this,"PanelAnimation");
+ var currentTranslationY = TranslationY;
+ var diff = selectTransitionHeight - currentTranslationY;
+ Animation animation = new Animation();
+ Animation translateAnimation = new Animation(v => TranslationY = (currentTranslationY + diff * v));
+ animation.Add(0.5, 1, translateAnimation);
+ animation.Commit(this, "PanelAnimation", length: 600);
}
/// <summary>
/// A method for scaling the panel when the panel is showed
/// </summary>
- public override async void ShowPanel()
+ public override void ShowPanel()
{
- await this.ScaleTo(1, 0);
+ Scale = 1;
}
/// <summary>
}
/// <summary>
- /// Identifies the ItemTemplate bindable property
- /// </summary>
- public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create("ItemTemplate", typeof(DataTemplate), typeof(SubPanel));
-
- /// <summary>
- /// Gets or set DataTemplate to display item
- /// </summary>
- public DataTemplate ItemTemplate
- {
- get { return (DataTemplate)GetValue(ItemTemplateProperty); }
- set { SetValue(ItemTemplateProperty, value); }
- }
-
- /// <summary>
/// A flag indicates whether the panel is focused or not
/// </summary>
public bool isFocused;
OnShowOptionsCommand?.Execute(isShowOptions);
item.ShowContextPopup();
item.ChangeShowOptionsMode(isShowOptions);
- ChangeIsEnabledProperty(item.View, false);
+ ChangeIsEnabledProperty(item, false);
}
}
}
return;
}
- int index = ButtonViewList.IndexOf(button.View);
+ int index = ButtonViewList.IndexOf(button);
if (direction.Equals("Right"))
{
button.rightMoving = true;
isMoveMode = !isMoveMode;
isShowOptions = false;
- ChangeIsEnabledProperty(button.View, false);
+ ChangeIsEnabledProperty(button, false);
button.ChangeMoveMode(isMoveMode, false);
if (!isMoveMode)
button = new SubPanelSettingButton();
}
- button.View.BindingContext = item;
+ button.BindingContext = item;
button.OnFocusedCommand = new Command(() =>
{
FocusPanel();
- if (SizeUtils.GetWidthSize((int)button.View.X) - SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) < 0)
+ if (SizeUtils.GetWidthSize((int)button.X) - SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) < 0)
{
ScrollToLeft();
}
- else if (SizeUtils.GetWidthSize((int)button.View.X) + SizeUtils.GetWidthSize(216) > SizeUtils.GetWidthSize(1920))
+ else if (SizeUtils.GetWidthSize((int)button.X) + SizeUtils.GetWidthSize(216) > SizeUtils.GetWidthSize(1920))
{
ScrollToRight();
}
});
button.OnUnpinCommand = new Command(() =>
{
- AppShortcutInfo shortcut = (AppShortcutInfo)button.View.BindingContext;
+ AppShortcutInfo shortcut = (AppShortcutInfo)button.BindingContext;
OnUnpinVMCommand?.Execute(shortcut.AppID);
});
button.OnDefaultModeCommand = new Command(() =>
OnShowOptionsCommand?.Execute(param);
});
- PanelButtonStack.Children.Add(button.View);
- ButtonViewList.Add(button.View);
+ PanelButtonStack.Children.Add(button);
+ ButtonViewList.Add(button);
}
OnItemSourceChanged(EventArgs.Empty);
{
if (item.isMoveMode)
{
- ChangeIsEnabledProperty(item.View, true);
+ ChangeIsEnabledProperty(item, true);
item.ChangeMoveMode(isMoveMode, true);
}
else
{
- item.View.TranslateTo(0, 0, 0);
+ item.TranslateTo(0, 0, 0);
}
}
if (item.isFocused)
{
item.ChangeShowOptionsMode(isShowOptions);
- ChangeIsEnabledProperty(item.View, true);
+ ChangeIsEnabledProperty(item, true);
}
}
}
foreach (RecentShortcutInfo item in ItemsSource)
{
PanelButton button = new SubPanelThumbnailButton();
- button.View.BindingContext = item;
+ button.BindingContext = item;
button.OnFocusedCommand = new Command(() =>
{
FocusPanel();
- if (SizeUtils.GetWidthSize((int)button.View.X) - SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) < 0)
+ if (SizeUtils.GetWidthSize((int)button.X) - SizeUtils.GetWidthSize((int)PanelScrollView.ScrollX) < 0)
{
ScrollToLeft();
}
- else if (SizeUtils.GetWidthSize((int)button.View.X) + SizeUtils.GetWidthSize(320) > SizeUtils.GetWidthSize(1920))
+ else if (SizeUtils.GetWidthSize((int)button.X) + SizeUtils.GetWidthSize(320) > SizeUtils.GetWidthSize(1920))
{
ScrollToRight();
}
{
OnClearAllVMCommand.Execute("");
});
- PanelButtonStack.Children.Add(button.View);
+ PanelButtonStack.Children.Add(button);
ButtonList.Add(button);
}