protected override bool OnBackButtonPressed()
{
- if(OnBackButtonPressedHandler != null)
+ if (OnBackButtonPressedHandler != null)
{
OnBackButtonPressedHandler.Invoke(this, EventArgs.Empty);
return true;
using System;
using System.Windows.Input;
-using TVMediaHub.Tizen.Utils;
using Xamarin.Forms;
namespace TVMediaHub.Tizen.Controls
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class CustomImageButton : Image
{
public event EventHandler<string> OnButtonUp;
{
Source = imgViewerPrefix + SubType.ToLower() + imgPressedPostFix;
}
+
if (Type.Equals("Zoom"))
{
Source = imgZoomPrefix + SubType.ToLower() + imgPressedPostFix;
namespace TVMediaHub.Tizen.Controls
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class MediaHubButton : Grid
{
public event EventHandler Clicked;
{
return (BtnIcon.Source as FileImageSource).File;
}
+
set
{
BtnIcon.Source = value;
{
InitializeComponent();
- initializeButton();
- initializeFocuseBG();
+ InitializeButton();
+ InitializeFocuseBG();
}
- private void initializeButton()
+ private void InitializeButton()
{
Btn.Clicked += async (s, e) =>
{
};
}
- private void initializeFocuseBG()
+ private void InitializeFocuseBG()
{
Btn.Focused += (s, e) =>
{
{
ContentDatabase.Connect();
}
- catch(Exception e)
+ catch (Exception e)
{
Log.Debug(TAG, e.Message);
}
newGroupFlag = true;
newTitle = mediaInformation.DisplayName[0].ToString();
}
+
break;
case SortOption.Date:
if (lastGroupItem == null || lastGroupItem.Title != GetDateString(mediaInformation.TimeLine))
newGroupFlag = true;
newTitle = GetDateString(mediaInformation.TimeLine);
}
+
break;
case SortOption.Genre:
if (lastGroupItem == null || lastGroupItem.Title != mediaInformation.Category)
newGroupFlag = true;
newTitle = mediaInformation.Category;
}
+
break;
case SortOption.Type:
if (lastGroupItem == null || lastGroupItem.Title != mediaInformation.MediaType.ToString())
newGroupFlag = true;
newTitle = mediaInformation.MediaType.ToString();
}
+
break;
default:
throw new System.ArgumentException("Invalid sorting option.");
}
if (currentGroupItem != null)
+ {
currentGroupItem.Contents.Add(shortcutInfo);
+ }
else
+ {
throw new System.Exception("Something's wrong on making a GroupItem. Check your logic.");
+ }
}
+
return result;
}
}
if (offset >= 0)
+ {
contentFilter.Offset = offset;
+ }
if (count >= 0)
+ {
contentFilter.Count = count;
+ }
if (storageId != null)
+ {
contentFilter.StorageId = storageId;
+ }
contentFilter.Condition = GetConditionStringForSelection();
return mediaInformations;
}
+
public async Task CheckThumbnail(IEnumerable<MediaShortcutInfo> list)
{
foreach (var info in list)
{
string path = await info.Information.CreateThumbnailAsync();
}
- catch(Exception e)
+ catch (Exception e)
{
DbgPort.D(e.Message);
}
}
if (offset >= 0)
+ {
contentFilter.Offset = offset;
+ }
if (count >= 0)
+ {
contentFilter.Count = count;
+ }
if (storageId != null)
+ {
contentFilter.StorageId = storageId;
+ }
contentFilter.Condition = GetConditionStringForSelection();
IEnumerable<MediaInformation> mediaInformations = new List<MediaInformation>();
try
{
- mediaInformations = ContentManager.Database.SelectAll<MediaInformation>(contentFilter);
+ mediaInformations = ContentManager.Database.SelectAll<MediaInformation>(contentFilter);
}
catch (Exception exception)
{
Log.Debug(TAG, exception.Message);
}
+
return mediaInformations;
}
handler(this, new PropertyChangedEventArgs(name));
}
}
+
private bool isDeleteStatus;
public bool IsDeleteStatus
{
return isDeleteStatus;
}
+
set
{
if (isDeleteStatus != value)
public VideoProvider() : base()
{
}
+
protected override string GetConditionStringForSelection()
{
// TODO : fix this, currently VD GBM media scan recognize .ts file as text/xxxx
base.OnCreate();
// TODO : due to VD's GBM binary issue.
- if(DirectoryInfo.Resource == null || DirectoryInfo.Resource.Length < 1)
+ if (DirectoryInfo.Resource == null || DirectoryInfo.Resource.Length < 1)
{
ResourceDirectoryPath = "/home/owner/apps_rw/org.tizen.xamediahub/res/";
}
{
app.TransitionTo(page);
}
+
public static void TransitionToMain(int tabIndex = 0)
{
app.TransitionToMain(tabIndex);
/// <param name="screenHeight">Screen Height</param>
/// <param name="dpi">Screen DPI</param>
/// <param name="scaleRatio">Scale ratio</param>
+ /// <param name="window">Window</param>
public App(int screenWidth, int screenHeight, int dpi, double scaleRatio, Window window)
{
SizeUtils.ScreenWidth = screenWidth;
{
DbgPort.E("Cant get model name!!!, " + e.Message);
}
+
MainWindow = window;
TransitionToMain();
}
//MainPage = page;
AppMainPage.PushAsync(page);
}
+
public void TransitionToMain(int tabIndex = 0)
{
/*
{
MainPage.FadeTo(0.0, 667);
}
+
public void RunShowAnimation()
{
MainPage.FadeTo(0.99, 667);
public static void D(string message, [CallerFilePath] System.String file = "", [CallerMemberName] System.String func = "", [CallerLineNumber] System.Int32 line = 0)
{
Log.Debug(TAG, message, file, func, line);
- if(IsNeedToShowInConsole)
+ if (IsNeedToShowInConsole)
{
Console.WriteLine(String.Format("{0}, {1}:{2},{3}", message, file.Substring(file.LastIndexOf("\\")), line, func));
}
double currentX;
double guessT = a;
- for(int i =0; i<limit; i++)
+ for (int i = 0; i < limit; i++)
{
currentSlope = CubicBezierSlopeGet(guessT, x1, x2);
if (currentSlope == 0.0)
+ {
return guessT;
+ }
+
currentX = CubicBezierCalc(guessT, x1, x2) - a;
change = currentX / currentSlope;
guessT -= change;
if ((change < 0.01) && (change > -0.01))
+ {
break;
+ }
}
+
return guessT;
}
private static double CubicBezierCalc(double t, double a1, double a2)
{
- return ((CubicBezierA(a1,a2) * t + CubicBezierB(a1,a2)) * t + CubicBezierC(a1)) * t;
+ return ((CubicBezierA(a1, a2) * t + CubicBezierB(a1, a2)) * t + CubicBezierC(a1)) * t;
}
private static double CubicBezierA(double a1, double a2)
namespace TVMediaHub.Tizen.Utils
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class NinePatch : Image
{
/// <summary>
{
UpdateBorder();
}
- else if(args.PropertyName == NinePatch.ImageColorProperty.PropertyName)
+ else if (args.PropertyName == NinePatch.ImageColorProperty.PropertyName)
{
UpdateImageColor();
}
using TVMediaHub.Tizen.Models;
using TVMediaHub.Tizen.DataModels;
using System.Threading.Tasks;
-using TVMediaHub.Tizen.Utils;
-using System;
using System.Collections.ObjectModel;
using System.Threading;
OnPropertyChanged("CurrentImage");
}
}
+
public ImageViewerInfomation CurrentImage
{
get
{
return isDeleteStatus;
}
+
set
{
if (isDeleteStatus != value)
public ICommand GetInformationsCommand { get; set; }
public List<MediaInformation> SelectedList { get; set; }
- public int SelectedCount { get { return SelectedList.Count; } }
+ public int SelectedCount
+ {
+ get
+ {
+ return SelectedList.Count;
+ }
+ }
public event PropertyChangedEventHandler PropertyChanged;
{
SelectedList.Add(info);
}
+
OnPropertyChanged("SelectedCount");
}
else
IsFooterSelStatus = !IsFooterNorStatus;
}
}
+
get
{
return isFooterNor;
isFooterSel = value;
OnPropertyChanged();
}
-
}
+
get
{
return isFooterSel;
{
return isDeleteStatus;
}
+
set
{
if (isDeleteStatus != value)
public List<MediaInformation> SelectedList { get; set; }
- public int SelectedCount { get { return SelectedList.Count; } }
+
+ public int SelectedCount
+ {
+ get
+ {
+ return SelectedList.Count;
+ }
+ }
public VideoTabViewModel()
{
* limitations under the License.
*/
-using TVMediaHub.Tizen.Utils;
-
namespace TVMediaHub.Tizen.ViewModels
{
public class VideoTabViewModelLocator
{
_viewModel = new VideoTabViewModel();
}
+
return _viewModel;
}
}
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FooterDeleteStatus : RelativeLayout
{
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FooterNormalStatus : RelativeLayout
{
ButtonOption.Command = new Command(() =>
{
- showContextPopup();
+ ShowContextPopup();
});
// TODO : Change yConstraint.
ButtonOption.FontSize = SizeUtils.GetFontSize(28);
}
- private void showContextPopup()
+ private void ShowContextPopup()
{
if (isPopupShowing)
{
*/
using System;
-using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
-using System.Threading.Tasks;
using System.Windows.Input;
using TVMediaHub.Tizen.DataModels;
using TVMediaHub.Tizen.Models;
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ImageGroup : RelativeLayout
{
InitializeSize();
PropertyChanged += ImageGroupPropertyChanged;
}
+
private void Init()
{
TitleFocusArea.Clicked += (e, v) =>
GroupContentArea.Children.Add(view, index / 3, index % 3);
index++;
}
+
SetFocusChain();
}
}
using System;
using System.ComponentModel;
-using System.Threading.Tasks;
using Tizen.Content.MediaContent;
using TVMediaHub.Tizen.Utils;
using Xamarin.Forms;
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ImageItem : RelativeLayout
{
{
SetValue(IsDeleteModeProperty, value);
}
+
get
{
return (bool)GetValue(IsDeleteModeProperty);
{
SetValue(ImageInfoProperty, value);
}
+
get
{
return (MediaInformation)GetValue(ImageInfoProperty);
ImgCheckDimmed.LayoutTo(ImageAreaFocusedBounds, 500, easing);
ImgCheck.LayoutTo(ImageAreaFocusedBounds, 500, easing);
}
+
ImageArea.LayoutTo(ImageAreaFocusedBounds, 500, easing);
}
});
ImgCheckDimmed.LayoutTo(ImageAreaNormalBounds, 167, easing);
ImgCheck.LayoutTo(ImageAreaNormalBounds, 167, easing);
}
+
ImageArea.LayoutTo(ImageAreaNormalBounds, 167, easing);
}
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class ImageTab : ContentPageEx
{
private bool IsContentReady = false;
{
return (ICommand)GetValue(OnClickCommandProperty);
}
+
set
{
SetValue(OnClickCommandProperty, value);
GalleryNoContents.IsVisible = false;
ImageTabScrollView.IsVisible = true;
}
+
var group = e.NewItems[0] as GroupItem;
ImageGroup galleryGroup = new ImageGroup();
galleryGroup.PropertyChanged += (se, ev) =>
{
using Tizen = Xamarin.Forms.PlatformConfiguration.Tizen;
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class ImageViewer : ContentPage
{
enum NaviDirection
};
}
- private void grabRemoteKeys()
+ private void GrabRemoteKeys()
{
foreach (var key in remoteKeys)
{
App.MainWindow.KeyDown += RemoteKeyDownListener;
}
- private void ungrabRemoteKeys()
+ private void UngrabRemoteKeys()
{
App.MainWindow.KeyDown -= RemoteKeyDownListener;
private void RemoteKeyDownListener(object sender, ElmSharp.EvasKeyEventArgs e)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
}
- private void initializeTimer()
+ private void InitializeTimer()
{
if (timer != default(IntPtr))
{
}
}
- private void setControlAreaState(ControlAreaState state)
+ private void SetControlAreaState(ControlAreaState state)
{
switch (state)
{
RunShowAnimation();
}
- initializeTimer();
+ InitializeTimer();
break;
case ControlAreaState.HIDE:
RunHideAnimation();
}
- initializeTimer();
+ InitializeTimer();
break;
case ControlAreaState.AUTO:
RunShowAnimation();
}
- initializeTimer();
+ InitializeTimer();
- timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, hideControlAreaHandler());
+ timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, HideControlAreaHandler());
break;
}
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
if (isRotationRunning)
{
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
Program.TransitionTo(new ImageViewerZoom());
}
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
if (isNaviRunning)
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
if (isNaviRunning)
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
Program.TransitionTo(new ImageViewerSlideShow());
}
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
- createOptionPopup();
+ SetControlAreaState(ControlAreaState.AUTO);
+ CreateOptionPopup();
}
- private void createOptionPopup()
+ private void CreateOptionPopup()
{
if (isOptionPopupShowing)
{
{
case 0:
/// Slide Show Speed
- createSlideShowSpeedOptionPopup();
+ CreateSlideShowSpeedOptionPopup();
break;
case 1:
/// Slide Show Effect
- createSlideShowEffectOptionPopup();
+ CreateSlideShowEffectOptionPopup();
break;
default:
break;
if (!isSpeedOptionPopupShowing && !isEffectOptionPopupShowing)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
}
};
optionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isOptionPopupShowing = true;
- setControlAreaState(ControlAreaState.SHOW);
+ SetControlAreaState(ControlAreaState.SHOW);
}
- private void createSlideShowSpeedOptionPopup()
+ private void CreateSlideShowSpeedOptionPopup()
{
if (isSpeedOptionPopupShowing)
{
{
isSpeedOptionPopupShowing = false;
- createOptionPopup();
+ CreateOptionPopup();
};
speedOptionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isSpeedOptionPopupShowing = true;
}
- private void createSlideShowEffectOptionPopup()
+ private void CreateSlideShowEffectOptionPopup()
{
if (isEffectOptionPopupShowing)
{
{
isEffectOptionPopupShowing = false;
- createOptionPopup();
+ CreateOptionPopup();
};
OptionBtn.MediaHubButtonBtn.On<Tizen>().SetNextFocusRightView(OptionBtn.MediaHubButtonBtn);
RunShowAnimation();
- timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, hideControlAreaHandler());
+ timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, HideControlAreaHandler());
if (isFirstLaunching)
{
isFirstLaunching = false;
}
- grabRemoteKeys();
+ GrabRemoteKeys();
}
protected override void OnDisappearing()
ControlArea.TranslationY = 93;
ControlArea.Opacity = 0;
- initializeTimer();
+ InitializeTimer();
- ungrabRemoteKeys();
+ UngrabRemoteKeys();
}
- private Func<bool> hideControlAreaHandler()
+ private Func<bool> HideControlAreaHandler()
{
- return delegate ()
+ return delegate()
{
- setControlAreaState(ControlAreaState.HIDE);
+ SetControlAreaState(ControlAreaState.HIDE);
timer = default(IntPtr);
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class ImageViewerSlideShow : ContentPageEx
{
private List<ImageViewerInfomation> imageList = new List<ImageViewerInfomation>();
}
}
- private int getDelayTimeBySpeedOption()
+ private int GetDelayTimeBySpeedOption()
{
int delayTime = 2000;
private async void DissolveSlideShow()
{
- int delayTime = getDelayTimeBySpeedOption();
+ int delayTime = GetDelayTimeBySpeedOption();
uint testDelay = Convert.ToUInt32(delayTime / 2);
int index = imageList.IndexOf(CurrentImage);
private async void FadeoutSlideShow()
{
- int delayTime = getDelayTimeBySpeedOption();
+ int delayTime = GetDelayTimeBySpeedOption();
int index = imageList.IndexOf(CurrentImage);
CurrentThumbnail.Source = imageList[(index) % imageList.Count].FilePath;
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class ImageViewerZoom : ContentPageEx
{
private static List<string> MoveDirection = new List<string> { "Up", "Down", "Left", "Right" };
Toast.DisplayText("Press [Back] to Escape from Zoom mode.");
/// Set the current image
- setCurrentImage();
+ SetCurrentImage();
/// Create the mini map
- createMiniMap();
+ CreateMiniMap();
OnBackButtonPressedHandler += (s, e) =>
{
protected override void InitializePage()
{
/// Grabs the hw keys to move the given image
- grabMoveKeys();
+ GrabMoveKeys();
}
protected override void FinalizePage()
{
- ungrabMoveKeys();
+ UngrabMoveKeys();
if (backgroundThumbnail != null)
{
/// <summary>
/// Grabs the hw keys to move the given image
/// </summary>
- private void grabMoveKeys()
+ private void GrabMoveKeys()
{
foreach (string direction in MoveDirection)
{
/// <summary>
/// Ungrab the hw keys
/// </summary>
- private void ungrabMoveKeys()
+ private void UngrabMoveKeys()
{
App.MainWindow.KeyUp -= MoveKeyUpListener;
App.MainWindow.KeyDown -= MoveKeyDownListener;
return;
}
- ElmSharp.EcoreAnimator.AddAmimator(delegate ()
+ ElmSharp.EcoreAnimator.AddAmimator(delegate()
{
clipper.Move(clipper.Geometry.X, clipper.Geometry.Y - 1);
if (clipper.Geometry.Y <= toY)
return;
}
- ElmSharp.EcoreAnimator.AddAmimator(delegate ()
+ ElmSharp.EcoreAnimator.AddAmimator(delegate()
{
clipper.Move(clipper.Geometry.X, clipper.Geometry.Y + 1);
if (clipper.Geometry.Y >= toY)
return;
}
- ElmSharp.EcoreAnimator.AddAmimator(delegate ()
+ ElmSharp.EcoreAnimator.AddAmimator(delegate()
{
clipper.Move(clipper.Geometry.X - 1, clipper.Geometry.Y);
if (clipper.Geometry.X <= toX)
return;
}
- ElmSharp.EcoreAnimator.AddAmimator(delegate ()
+ ElmSharp.EcoreAnimator.AddAmimator(delegate()
{
clipper.Move(clipper.Geometry.X + 1, clipper.Geometry.Y);
if (clipper.Geometry.X >= toX)
}
}
- private void setCurrentImage()
+ private void SetCurrentImage()
{
CurrentImage.WidthRequest = App.MainWindow.Geometry.Width * zoomRatio;
CurrentImage.HeightRequest = App.MainWindow.Geometry.Height * zoomRatio;
CurrentImage.Rotation = SavedRotation;
}
- private void createMiniMap()
+ private void CreateMiniMap()
{
Grid miniMap = new Grid()
{
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MediaHubMainPage : TabbedPage
{
{
base.OnAppearing();
var page = CurrentPage as ContentPageEx;
- if(IsAppLoaded == false)
+ if (IsAppLoaded == false)
{
page.RunShowAnimation();
IsAppLoaded = true;
}
+
await App.AppMainPage.FadeTo(0.99, 667);
Focus();
}
* limitations under the License.
*/
-using System;
using TVMediaHub.Tizen.Controls;
using TVMediaHub.Tizen.Utils;
using Xamarin.Forms;
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class MusicTab : ContentPageEx
{
public MusicTab()
{
using Tizen = Xamarin.Forms.PlatformConfiguration.Tizen;
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class SimpleImageViewer : ContentPageEx
{
enum ControlAreaState
};
}
- private void grabRemoteKeys()
+ private void GrabRemoteKeys()
{
foreach (var key in remoteKeys)
{
App.MainWindow.KeyDown += RemoteKeyDownListener;
}
- private void ungrabRemoteKeys()
+ private void UngrabRemoteKeys()
{
App.MainWindow.KeyDown -= RemoteKeyDownListener;
private void RemoteKeyDownListener(object sender, ElmSharp.EvasKeyEventArgs e)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
}
- private void setControlAreaState(ControlAreaState state)
+ private void SetControlAreaState(ControlAreaState state)
{
switch (state)
{
timer = default(IntPtr);
}
- timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, hideControlAreaHandler());
+ timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, HideControlAreaHandler());
break;
}
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
if (isRotationRunning)
{
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
Program.TransitionTo(new ImageViewerZoom());
}
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
NavigationCommand?.Execute("Left");
}
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
NavigationCommand?.Execute("Right");
}
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
Program.TransitionTo(new ImageViewerSlideShow());
}
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
- createOptionPopup();
+ CreateOptionPopup();
}
- private void createOptionPopup()
+ private void CreateOptionPopup()
{
if (isOptionPopupShowing)
{
{
case 0:
/// Slide Show Speed
- createSlideShowSpeedOptionPopup();
+ CreateSlideShowSpeedOptionPopup();
break;
case 1:
/// Slide Show Effect
- createSlideShowEffectOptionPopup();
+ CreateSlideShowEffectOptionPopup();
break;
default:
break;
if (!isSpeedOptionPopupShowing && !isEffectOptionPopupShowing)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
}
};
optionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isOptionPopupShowing = true;
- setControlAreaState(ControlAreaState.SHOW);
+ SetControlAreaState(ControlAreaState.SHOW);
}
- private void createSlideShowSpeedOptionPopup()
+ private void CreateSlideShowSpeedOptionPopup()
{
if (isSpeedOptionPopupShowing)
{
{
isSpeedOptionPopupShowing = false;
- createOptionPopup();
+ CreateOptionPopup();
};
speedOptionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isSpeedOptionPopupShowing = true;
}
- private void createSlideShowEffectOptionPopup()
+ private void CreateSlideShowEffectOptionPopup()
{
if (isEffectOptionPopupShowing)
{
{
isEffectOptionPopupShowing = false;
- createOptionPopup();
+ CreateOptionPopup();
};
OptionBtn.MediaHubButtonBtn.On<Tizen>().SetNextFocusRightView(OptionBtn.MediaHubButtonBtn);
RunShowAnimation();
- timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, hideControlAreaHandler());
+ timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, HideControlAreaHandler());
RotateBtn.MediaHubButtonBtn.Focus();
- grabRemoteKeys();
+ GrabRemoteKeys();
}
- private Func<bool> hideControlAreaHandler()
+ private Func<bool> HideControlAreaHandler()
{
- return delegate ()
+ return delegate()
{
- setControlAreaState(ControlAreaState.HIDE);
+ SetControlAreaState(ControlAreaState.HIDE);
timer = default(IntPtr);
protected override void FinalizePage()
{
- ungrabRemoteKeys();
+ UngrabRemoteKeys();
}
public override void RunHideAnimation()
using System;
using System.Collections.Generic;
-using System.Threading.Tasks;
using TVMediaHub.Tizen.DataModels;
using System.Windows.Input;
-using Tizen;
-using Tizen.Content.MediaContent;
using TVMediaHub.Tizen.Models;
using TVMediaHub.Tizen.Utils;
using Xamarin.Forms;
namespace TVMediaHub.Tizen.Views
{
-
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class VideoGroup : RelativeLayout
{
private Xamarin.Forms.Label GroupTitle;
GroupContentArea.Children.Add(view, index / 3, index % 3);
index++;
}
+
SetFocusChain();
}
}
using System;
using System.ComponentModel;
-using System.Threading.Tasks;
using Tizen.Content.MediaContent;
using TVMediaHub.Tizen.Utils;
-using TVMediaHub.Tizen.Models;
using Xamarin.Forms;
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class VideoItem : RelativeLayout
{
private bool IsLoaded = false;
{
SetValue(IsDeleteModeProperty, value);
}
+
get
{
return (bool)GetValue(IsDeleteModeProperty);
{
SetValue(VideoInfoProperty, value);
}
+
get
{
return (MediaInformation)GetValue(VideoInfoProperty);
CheckDimImage.LayoutTo(NormalBounds, 167, easing);
CheckImage.LayoutTo(NormalBounds, 167, easing);
}
+
ImageArea.LayoutTo(NormalBounds, 167, easing);
}
{
using Tizen = Xamarin.Forms.PlatformConfiguration.Tizen;
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class VideoPlayer : ContentPageEx
{
enum ControlAreaState
PlayBackRewindIndex = 0;
}
}
+
get
{
if (PlayBackForwardIndex == 0 &&
{
return false;
}
+
return true;
}
}
{
playBackForwardIndex = value;
}
+
get
{
return playBackForwardIndex % PlayBackRate.Length;
{
playBackRewindIndex = value;
}
+
get
{
return playBackRewindIndex % PlayBackRate.Length;
}
}
+
private float[] PlayBackRate = { 1, 2, 4 };
public static readonly BindableProperty CurrentVideoProperty = BindableProperty.Create("CurrentVideo", typeof(MediaInformation), typeof(VideoPlayer), null);
};
}
- private void grabRemoteKeys()
+ private void GrabRemoteKeys()
{
foreach (var key in remoteKeys)
{
App.MainWindow.KeyDown += RemoteKeyDownListener;
}
- private void ungrabRemoteKeys()
+ private void UngrabRemoteKeys()
{
App.MainWindow.KeyDown -= RemoteKeyDownListener;
private void RemoteKeyDownListener(object sender, ElmSharp.EvasKeyEventArgs e)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
}
- private void setControlAreaState(ControlAreaState state)
+ private void SetControlAreaState(ControlAreaState state)
{
switch (state)
{
timer = default(IntPtr);
}
- timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, hideControlAreaHandler());
+ timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, HideControlAreaHandler());
break;
}
{
return;
}
+
int playPosition = playerInstance.GetPlayPosition();
SetPlayTime(playPosition);
progress.Progress = (double)playPosition / duration;
{
DbgPort.E("Stop Failed : " + ex.Message);
}
+
fullScreenWindow.Hide();
PausePlayBtn.NormalImage = PausePlayBtn.NormalImage.Replace("pause", "play");
PausePlayBtn.PressedImage = PausePlayBtn.PressedImage.Replace("pause", "play");
PausePlayBtn.MediaHubButtonIcon = PausePlayBtn.NormalImage;
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
}
};
OptionBtn.MediaHubButtonBtn.On<Tizen>().SetNextFocusRightView(OptionBtn.MediaHubButtonBtn);
RunShowAnimation();
- timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, hideControlAreaHandler());
+ timer = ElmSharp.EcoreMainloop.AddTimer(timerInterval, HideControlAreaHandler());
PausePlayBtn.MediaHubButtonBtn.Focus();
- grabRemoteKeys();
+ GrabRemoteKeys();
}
- private Func<bool> hideControlAreaHandler()
+ private Func<bool> HideControlAreaHandler()
{
- return delegate ()
+ return delegate()
{
- setControlAreaState(ControlAreaState.HIDE);
+ SetControlAreaState(ControlAreaState.HIDE);
timer = default(IntPtr);
timer = default(IntPtr);
}
- ungrabRemoteKeys();
+ UngrabRemoteKeys();
}
private void PlayVideo()
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
try
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
/*
int playPosition = playerInstance.GetPlayPosition();
playPosition /= 2;
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
if (playerInstance.State == PlayerState.Paused || playerInstance.State == PlayerState.Ready)
{
- setControlAreaState(ControlAreaState.SHOW);
+ SetControlAreaState(ControlAreaState.SHOW);
PlayVideo();
}
else if (playerInstance.State == PlayerState.Playing)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
try
{
PlayBackRewindIndex = 0;
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
+
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
try
{
{
PlayVideo();
}
+
SpeedInfo.IsVisible = true;
SpeedInfo.FadeTo(1.0, 100);
NumText.Text = PlayBackRate[PlayBackForwardIndex].ToString();
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
try
{
if (ControlArea.Opacity == 0)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
return;
}
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
- createOptionPopup();
+ CreateOptionPopup();
}
- private void createScreenRateOptionPopup()
+ private void CreateScreenRateOptionPopup()
{
if (isScreenRatePopupShowing)
{
{
isScreenRatePopupShowing = false;
- createOptionPopup();
+ CreateOptionPopup();
};
screenRateOptionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isScreenRatePopupShowing = true;
}
- private void createSoundEffectOptionPopup()
+ private void CreateSoundEffectOptionPopup()
{
if (isSoundEffectPopupShowing)
{
{
isSoundEffectPopupShowing = false;
- createOptionPopup();
+ CreateOptionPopup();
};
soundEffectOptionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isSoundEffectPopupShowing = true;
}
- private void createOptionPopup()
+ private void CreateOptionPopup()
{
if (isOptionPopupShowing)
{
{
case 0:
/// Screen Rate
- createScreenRateOptionPopup();
+ CreateScreenRateOptionPopup();
break;
case 1:
/// Sound Effect
- createSoundEffectOptionPopup();
+ CreateSoundEffectOptionPopup();
break;
default:
break;
if (!isScreenRatePopupShowing && !isSoundEffectPopupShowing)
{
- setControlAreaState(ControlAreaState.AUTO);
+ SetControlAreaState(ControlAreaState.AUTO);
}
};
optionPopup.Show(PopupAnchor, (PopupAnchor.Width / 2), PopupAnchor.Height);
isOptionPopupShowing = true;
- setControlAreaState(ControlAreaState.SHOW);
+ SetControlAreaState(ControlAreaState.SHOW);
}
public override void RunHideAnimation()
namespace TVMediaHub.Tizen.Views
{
+ /// <summary>
+ /// @TODO: Comment
+ /// </summary>
public partial class VideoTab : ContentPageEx
{
private bool IsContentReady = false;
{
return (ICommand)GetValue(OnClickCommandProperty);
}
+
set
{
SetValue(OnClickCommandProperty, value);
VideoNoContents.IsVisible = false;
VideoTabScrollView.IsVisible = true;
}
+
VideoGroup groupView = new VideoGroup();
groupView.PropertyChanged += (se, ev) =>