(WIP)
authorHyerim Kim <rimi.kim@samsung.com>
Tue, 23 May 2017 06:20:56 +0000 (15:20 +0900)
committerHyerim Kim <rimi.kim@samsung.com>
Tue, 23 May 2017 07:17:35 +0000 (16:17 +0900)
Modifies text of No content and font properties
Implements delete and update MediaInformation

Change-Id: Ib05434a8b275d6dd0702b63754ae6f017649c219
Signed-off-by: Hyerim Kim <rimi.kim@samsung.com>
TVMediaHub/TVMediaHub.Tizen/Models/ContentProvider.cs
TVMediaHub/TVMediaHub.Tizen/ViewModels/VideoTabViewModel.cs
TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml
TVMediaHub/TVMediaHub.Tizen/Views/ImageTab.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/MusicTab.xaml [changed mode: 0644->0755]
TVMediaHub/TVMediaHub.Tizen/Views/MusicTab.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/VideoPlayer.xaml
TVMediaHub/TVMediaHub.Tizen/Views/VideoPlayer.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/VideoTab.xaml [changed mode: 0644->0755]
TVMediaHub/TVMediaHub.Tizen/Views/VideoTab.xaml.cs

index d854f10ec2b0aa22346ad74f6614b0d5ba77fe13..6563a37ecdf8ca221fdb89248933c128cfdf7b60 100755 (executable)
@@ -383,9 +383,17 @@ namespace TVMediaHub.Tizen.Models
         /// </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;
         }
 
@@ -394,9 +402,18 @@ namespace TVMediaHub.Tizen.Models
         /// </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;
         }
 
index 9ef6ff240b181ca8e2aa1ae53aee2ac9b1734ed6..5e912de0e874ba202b92233906af5325e72b0968 100755 (executable)
@@ -88,6 +88,11 @@ namespace TVMediaHub.Tizen.ViewModels
         /// </summary>
         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>
@@ -172,6 +177,19 @@ namespace TVMediaHub.Tizen.ViewModels
                     }
                 }
             });
+            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();
index bb60352c2f786b115520d6f8bad2d3a474a7c101..925d0f9a59a452dbc84c576bc5bd5d122aa69c14 100755 (executable)
@@ -44,7 +44,7 @@
         <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
index 33d8d58c618de305f8a1f66303d503fda0fca5fc..c2f9d870a953eba65e5fd6b9583c0616da0d44b9 100755 (executable)
@@ -145,6 +145,7 @@ namespace TVMediaHub.Tizen.Views
 
             InitializeData();
             InitializeSize();
+            InitializeFonts();
             InitializeFooter();
             ItemsSource.CollectionChanged += ItemsSourceCollectionChanged;
 
@@ -177,6 +178,15 @@ namespace TVMediaHub.Tizen.Views
             LabelNoContents.FontSize = Utils.SizeUtils.GetFontSize(28);
         }
 
+        /// <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>
old mode 100644 (file)
new mode 100755 (executable)
index 663ead1..3179c60
@@ -26,7 +26,7 @@
             <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>
index 87f9415b893037fa0b2143b3dc07759a3505f4ec..60ff382a85eb6e5ec0acf92e3905adfeaae4d47a 100755 (executable)
@@ -17,6 +17,7 @@
 using TVMediaHub.Tizen.Controls;
 using TVMediaHub.Tizen.Utils;
 using Xamarin.Forms;
+using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
 
 namespace TVMediaHub.Tizen.Views
 {
@@ -33,6 +34,7 @@ namespace TVMediaHub.Tizen.Views
         {
             InitializeComponent();
             InitializeSize();
+            InitializeFonts();
         }
 
         /// <summary>
@@ -47,6 +49,15 @@ namespace TVMediaHub.Tizen.Views
             LabelNoContents.FontSize = SizeUtils.GetFontSize(28);
         }
 
+        /// <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>
index 379924262ed7119d32c1babbe30a46784283ded4..54a7975ab7c1984bedfe74f4a5e2f1514e5b31b3 100755 (executable)
                                      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
index f0a60250694fe4c538c6d0bccef2bc34c28deea5..59b9546a7de119cdadbfebbd77eae0570b61c1a7 100755 (executable)
@@ -507,10 +507,7 @@ namespace TVMediaHub.Tizen.Views
             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());
@@ -619,8 +616,8 @@ namespace TVMediaHub.Tizen.Views
         /// </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++)
old mode 100644 (file)
new mode 100755 (executable)
index 6142e55..d3d576b
@@ -11,7 +11,8 @@
              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}">
@@ -46,7 +47,7 @@
         <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
index cbf1b654444b36285782eb1c055be97a3ab59dc0..58336da5c2d764bd9d06e7e984c35161a4993819 100755 (executable)
@@ -108,6 +108,20 @@ namespace TVMediaHub.Tizen.Views
             set { SetValue(ChangeSortOptionCommandProperty, value); }
         }
 
+        /// <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>
@@ -143,6 +157,7 @@ namespace TVMediaHub.Tizen.Views
             InitializeComponent();
             InitializeData();
             InitializeSize();
+            InitializeFonts();
             InitializeFooter();
             ItemsSource.CollectionChanged += ItemsSourceCollectionChanged;
         }
@@ -155,6 +170,15 @@ namespace TVMediaHub.Tizen.Views
             BottomButtonList = new List<KeyValuePair<double, Button>>();
         }
 
+        /// <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>
@@ -422,6 +446,7 @@ namespace TVMediaHub.Tizen.Views
         {
             // TODO : Change to delete Content command
             ChangeTabStatusCommand?.Execute("");
+            DeleteContentCommand?.Execute("");
             FooterNormal.IsVisible = true;
             FooterDelete.IsVisible = false;
             SetFooterFocusChain(VideoTabScrollView.ScrollX);