/// </summary>
/// <param name="media">A media content to be deleted</param>
/// <returns>Always returns true</returns>
- bool Delete(MediaInformation media)
+ public bool Delete(MediaInformation media)
{
- // TODO : delete
+ try
+ {
+ ContentManager.Database.Delete(media);
+ }
+ catch (Exception exception)
+ {
+ Log.Error(TAG, exception.Message);
+ }
+
return true;
}
/// </summary>
/// <param name="media">A media content to be updated</param>
/// <returns>Always returns true</returns>
- bool Update(MediaInformation media)
+ public bool Update(MediaInformation media)
{
- // TODO : update
+ try
+ {
+ ContentManager.Database.Update(media);
+ UpdateListeners?.Invoke(this, EventArgs.Empty);
+ }
+ catch (Exception exception)
+ {
+ Log.Error(TAG, exception.Message);
+ }
+
return true;
}
public ICommand GetInformationsCommand { get; set; }
/// <summary>
+ /// A command for deleting a video content
+ /// </summary>
+ public ICommand DeleteContentCommand { get; set; }
+
+ /// <summary>
/// A command to set current video information
/// </summary>
public ICommand SetCurrentVideoInfo
}
}
});
+ DeleteContentCommand = new Command(() =>
+ {
+ IsDeleteStatus = !IsDeleteStatus;
+
+ foreach (var group in VideoList)
+ {
+ foreach (var info in group.Contents)
+ {
+ info.IsDeleteStatus = IsDeleteStatus;
+ MediaHubImpl.GetInstance.VideoProviderInstance.Delete(info.Information);
+ }
+ }
+ });
ChangeSortOptionCommand = new Command<string>((opt) =>
{
var option = opt.ToLower();
<StackLayout x:Name="GalleryNoContents" Orientation="Vertical" IsVisible="True"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}">
<Image x:Name="ImgNoContents" Source="img_media_no_contents.png" HorizontalOptions="Center"/>
- <Label x:Name="LabelNoContents" Text="No content to display" FontFamily="Breeze Sans Light" TextColor="#33FFFFFF" HorizontalOptions="Center"/>
+ <Label x:Name="LabelNoContents" Text="No content" FontFamily="BreezeSans" HorizontalOptions="Center"/>
</StackLayout>
</RelativeLayout>
</mh:ContentPageEx>
\ No newline at end of file
InitializeData();
InitializeSize();
+ InitializeFonts();
InitializeFooter();
ItemsSource.CollectionChanged += ItemsSourceCollectionChanged;
}
/// <summary>
+ /// A method for initializing several fonts that are used in this class
+ /// </summary>
+ private void InitializeFonts()
+ {
+ LabelNoContents.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Light);
+ LabelNoContents.TextColor = Color.FromRgba(255, 255, 255, 20);
+ }
+
+ /// <summary>
/// A method for initializing footer
/// </summary>
private void InitializeFooter()
<StackLayout x:Name="MusicNoContents" Orientation="Vertical" IsVisible="True"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}">
<Image x:Name="ImgNoContents" Source="img_media_no_contents.png" HorizontalOptions="Center"/>
- <Label x:Name="LabelNoContents" Text="No content to display" FontFamily="Breeze Sans Light" TextColor="#33FFFFFF" HorizontalOptions="Center"/>
+ <Label x:Name="LabelNoContents" Text="No content" FontFamily="BreezeSans" HorizontalOptions="Center"/>
</StackLayout>
</RelativeLayout>
</RelativeLayout>
using TVMediaHub.Tizen.Controls;
using TVMediaHub.Tizen.Utils;
using Xamarin.Forms;
+using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
namespace TVMediaHub.Tizen.Views
{
{
InitializeComponent();
InitializeSize();
+ InitializeFonts();
}
/// <summary>
}
/// <summary>
+ /// A method for initializing several fonts that are used in this class
+ /// </summary>
+ private void InitializeFonts()
+ {
+ LabelNoContents.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Light);
+ LabelNoContents.TextColor = Color.FromRgba(255, 255, 255, 20);
+ }
+
+ /// <summary>
/// A method for initializing page when the page is appeared
/// </summary>
protected override void InitializePage()
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.075}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.5958}" />
-
- <Controls:MediaHubButton x:Name="OptionBtn"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.075}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.9015}" />
</RelativeLayout>
<RelativeLayout x:Name="SpeedInfo" IsVisible="false" Opacity="0"
TextColor="White"
HorizontalTextAlignment="Start"/>
</RelativeLayout>
-
- <BoxView x:Name="PopupAnchor"
- Opacity="0"
- RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.1333}"
- RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.177}"
- RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.6963}"
- RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.7729}" />
</RelativeLayout>
</mh:ContentPageEx>
\ No newline at end of file
ForwardBtn.MediaHubButtonBtn.On<Tizen>().SetNextFocusRightView(NextBtn.MediaHubButtonBtn);
NextBtn.MediaHubButtonBtn.On<Tizen>().SetNextFocusLeftView(ForwardBtn.MediaHubButtonBtn);
- NextBtn.MediaHubButtonBtn.On<Tizen>().SetNextFocusRightView(OptionBtn.MediaHubButtonBtn);
-
- OptionBtn.MediaHubButtonBtn.On<Tizen>().SetNextFocusLeftView(NextBtn.MediaHubButtonBtn);
- OptionBtn.MediaHubButtonBtn.On<Tizen>().SetNextFocusRightView(OptionBtn.MediaHubButtonBtn);
+ NextBtn.MediaHubButtonBtn.On<Tizen>().SetNextFocusRightView(NextBtn.MediaHubButtonBtn);
RunShowAnimation();
timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, HideControlAreaHandler());
/// </summary>
private void InitializeButtons()
{
- MediaHubButton[] buttons = new MediaHubButton[6] { PreviousBtn, RewindBtn, PausePlayBtn, ForwardBtn, NextBtn, OptionBtn };
- string[] icons = new string[6] { "previous", "rewind", "play", "forward", "next", "option" };
+ MediaHubButton[] buttons = new MediaHubButton[5] { PreviousBtn, RewindBtn, PausePlayBtn, ForwardBtn, NextBtn };
+ string[] icons = new string[5] { "previous", "rewind", "play", "forward", "next" };
string iconPath = "btn_viewer_control_previous_normal.png";
for (int i = 0; i < buttons.Length; i++)
ChangeTabStatusCommand="{Binding ChangeTabStatusCommand}"
ChangeSortOptionCommand="{Binding ChangeSortOptionCommand}"
GetInformationsCommand="{Binding GetInformationsCommand}"
- OnClickCommand="{Binding SetCurrentVideoInfo}">
+ OnClickCommand="{Binding SetCurrentVideoInfo}"
+ DeleteContentCommand="{Binding DeleteContentCommand}">
<RelativeLayout
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}">
<StackLayout x:Name="VideoNoContents" Orientation="Vertical" IsVisible="True"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}">
<Image x:Name="ImgNoContents" Source="img_media_no_contents.png" HorizontalOptions="Center"/>
- <Label x:Name="LabelNoContents" Text="No content to display" FontFamily="Breeze Sans Light" TextColor="#33FFFFFF" HorizontalOptions="Center"/>
+ <Label x:Name="LabelNoContents" Text="No content" FontFamily="BreezeSans" HorizontalOptions="Center"/>
</StackLayout>
</RelativeLayout>
</mh:ContentPageEx>
\ No newline at end of file
}
/// <summary>
+ /// Identifies the DeleteContentCommand bindable property
+ /// </summary>
+ public static readonly BindableProperty DeleteContentCommandProperty = BindableProperty.Create("DeleteContentCommand", typeof(ICommand), typeof(VideoTab), default(ICommand));
+
+ /// <summary>
+ /// Gets or sets DeleteContent Command
+ /// </summary>
+ public ICommand DeleteContentCommand
+ {
+ get { return (ICommand)GetValue(DeleteContentCommandProperty); }
+ set { SetValue(DeleteContentCommandProperty, value); }
+ }
+
+ /// <summary>
/// Identifies the OnClickCommand bindable property
/// </summary>
public static readonly BindableProperty OnClickCommandProperty = BindableProperty.Create("OnClickCommand", typeof(ICommand), typeof(VideoItem), default(ICommand));
InitializeComponent();
InitializeData();
InitializeSize();
+ InitializeFonts();
InitializeFooter();
ItemsSource.CollectionChanged += ItemsSourceCollectionChanged;
}
}
/// <summary>
+ /// A method for initializing several fonts that are used in this class
+ /// </summary>
+ private void InitializeFonts()
+ {
+ LabelNoContents.On<Xamarin.Forms.PlatformConfiguration.Tizen>().SetFontWeight(FontWeight.Light);
+ LabelNoContents.TextColor = Color.FromRgba(255, 255, 255, 20);
+ }
+
+ /// <summary>
/// Initialize the size that is used in this class
/// </summary>
private void InitializeSize()
{
// TODO : Change to delete Content command
ChangeTabStatusCommand?.Execute("");
+ DeleteContentCommand?.Execute("");
FooterNormal.IsVisible = true;
FooterDelete.IsVisible = false;
SetFooterFocusChain(VideoTabScrollView.ScrollX);