/// <summary>
/// An abstract method to determine the availability of the content.
/// </summary>
+ /// <param name="mediaContent">A media content to be checked the availability</param>
abstract protected void CheckUnavailableContent(MediaInformationEx mediaContent);
/// <summary>
/// A method for making thumbnail of Media contents.
/// </summary>
/// <param name="list">A list of media contents</param>
- /// <returns></returns>
+ /// <returns>A path of thumbnail</returns>
public async Task CheckThumbnail(IEnumerable<MediaShortcutInfo> list)
{
foreach (var info in list)
/// <summary>
/// A method to determine the availability of the content.
/// </summary>
+ /// <param name="mediaContent">A media content to be checked the availability</param>
protected override void CheckUnavailableContent(MediaInformationEx mediaContent)
{
if (mediaContent.MediaContentInformation.FilePath != null)
/// <summary>
/// A method to determine the availability of the content.
/// </summary>
+ /// <param name="mediaContent">A media content to be checked the availability</param>
protected override void CheckUnavailableContent(MediaInformationEx mediaContent)
{
// TODO : Add unsupported mime type here
/// <summary>
/// A method to determine the availability of the content.
/// </summary>
+ /// <param name="mediaContent">A media content to be checked the availability</param>
protected override void CheckUnavailableContent(MediaInformationEx mediaContent)
{
// TODO : Add unsupported mime type here
SelectedList.Clear();
SelectedList.Add(SelectedItem);
}
+
foreach (var info in SelectedList)
{
try
{
File.Delete(info.MediaContentInformation.FilePath);
}
- catch(Exception exception)
+ catch (Exception exception)
{
// TODO: Handling exceptions
DbgPort.E("Exception - " + exception.Message);
public int CurrentVideoIndex { get; set; }
public List<MediaInformationEx> PlayList { get; set; }
- public bool IsLastVideo {
+ public bool IsLastVideo
+ {
get
{
return (PlayList.Count - 1) == CurrentVideoIndex;
SelectedList.Clear();
SelectedList.Add(SelectedItem);
}
+
foreach (var info in SelectedList)
{
try
{
File.Delete(info.MediaContentInformation.FilePath);
}
- catch(Exception exception)
+ catch (Exception exception)
{
// TODO: Handling exceptions
DbgPort.E("Exception - " + exception.Message);
/// A method for reading video contents through VideoProvider and updating VideoList
/// </summary>
/// <param name="option">A current sort option</param>
+ /// <param name="storageId">A storage id</param>
private async void ReadVideoList(SortOption option, string storageId = null)
{
VideoList.Clear();
focusedItem.ShowContextPopup();
return true;
}
+
return false;
}
}
IsLoaded = true;
}
}
+
public void ShowContextPopup()
{
if (!FocusArea.IsFocused)
ContextPopup popup = new ContextPopup();
popup.Items.Add(new ContextPopupItem("FILE INFO"));
popup.Items.Add(new ContextPopupItem("DELETE"));
- popup.SelectedIndexChanged += selectedIndexChanged;
+ popup.SelectedIndexChanged += SelectedIndexChanged;
popup.Show(this, this.Width / 2, this.Height + SizeUtils.GetHeightSize(72));
}
- private void selectedIndexChanged(object sender, EventArgs e)
+ private void SelectedIndexChanged(object sender, EventArgs e)
{
var ctxPopup = sender as ContextPopup;
switch (ctxPopup.SelectedIndex)
App.MainWindow.KeyUp -= MenuKeyListener;
App.MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName);
}
+
private void MenuKeyListener(object sender, ElmSharp.EvasKeyEventArgs e)
{
if (e.KeyName.Equals(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName))
{
DeleteContentCommand?.Execute(item);
}
+
break;
}
/// <summary>
/// A method for getting visible image
/// </summary>
- /// <returns></returns>
+ /// <returns>The image to be seen</returns>
private Xamarin.Forms.Image GetVisibleImage()
{
Xamarin.Forms.Image visibleImage = null;
/// <summary>
/// A method for getting invisible image
/// </summary>
- /// <returns></returns>
+ /// <returns>The image to be unseen</returns>
private Xamarin.Forms.Image GetUnVisibleImage()
{
Xamarin.Forms.Image unVisibleImage = null;
/// <summary>e
/// A method for hiding control area when timer is over
/// </summary>
+ /// <param name="state">The status to be set</param>
private void HideControlAreaHandler(object state)
{
SetControlAreaState(ControlAreaState.HIDE);
/// <returns>If group has a focused video item, true; otherwise, false</returns>
public bool NotifyMenuKeyPressedToFocusedItem()
{
- if(focusedItem != null)
+ if (focusedItem != null)
{
focusedItem.ShowContextPopup();
return true;
}
+
return false;
}
}
ContextPopup popup = new ContextPopup();
popup.Items.Add(new ContextPopupItem(" FILE INFO "));
popup.Items.Add(new ContextPopupItem("DELETE"));
- popup.SelectedIndexChanged += selectedIndexChanged;
- popup.Show(this, this.Width/2, this.Height + SizeUtils.GetHeightSize(72));
+ popup.SelectedIndexChanged += SelectedIndexChanged;
+ popup.Show(this, this.Width / 2, this.Height + SizeUtils.GetHeightSize(72));
}
- private void selectedIndexChanged(object sender, EventArgs e)
+ private void SelectedIndexChanged(object sender, EventArgs e)
{
var ctxPopup = sender as ContextPopup;
switch (ctxPopup.SelectedIndex)
ContextPopupItemSelectedHandler?.Invoke(VideoInfo, VideoContextPopupItem.Delete);
break;
}
+
ctxPopup.Dismiss();
}
}
DbgPort.D(ex.Message);
return;
}
+
PrepareAsync();
}
}
/// <summary>
/// Sets the play time on the control area
/// </summary>
- /// <param name="time"></param>
+ /// <param name="time">A current playing time</param>
private void SetPlayTime(int time)
{
int second = (time / 1000) % 60;
/// <summary>e
/// A method for hiding control area when timer is over
/// </summary>
+ /// <param name="state">The status to be set</param>
private void HideControlAreaHandler(object state)
{
SetControlAreaState(ControlAreaState.HIDE);
using TVMediaHub.Tizen.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
-using Tizen.Content.MediaContent;
-using static TVMediaHub.Tizen.Views.VideoItem;
-using Tizen.Xamarin.Forms.Extension;
namespace TVMediaHub.Tizen.Views
{
+ using static TVMediaHub.Tizen.Views.VideoItem;
/// <summary>
/// A custom ContentPage for displaying the video tab
/// </summary>
App.MainWindow.KeyUp -= MenuKeyListener;
App.MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName);
}
+
private void MenuKeyListener(object sender, ElmSharp.EvasKeyEventArgs e)
{
if (e.KeyName.Equals(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName))
{
if (VideoTabList.Children.Count > 0)
{
- foreach(VideoGroup group in VideoTabList.Children)
+ foreach (VideoGroup group in VideoTabList.Children)
{
if (group.NotifyMenuKeyPressedToFocusedItem())
{
{
DeleteContentCommand?.Execute(item);
}
+
break;
}
}