Revert "Implement mediahub music player gui" 81/136881/1
authorhjjang <heonjae.jang@samsung.com>
Mon, 3 Jul 2017 09:06:54 +0000 (18:06 +0900)
committerhjjang <heonjae.jang@samsung.com>
Mon, 3 Jul 2017 09:08:03 +0000 (18:08 +0900)
This reverts commit 19402a1cc039f409761be9957a5bf212583bd546.

Change-Id: I3cb96acfec96f83fb4c6014e5685c949b5f4ba90

TVMediaHub/TVMediaHub.Tizen/Models/MusicPlayerModel.cs
TVMediaHub/TVMediaHub.Tizen/TVMediaHub.Tizen.csproj
TVMediaHub/TVMediaHub.Tizen/ViewModels/MusicPlayerViewModel.cs
TVMediaHub/TVMediaHub.Tizen/Views/MusicGroup.xaml
TVMediaHub/TVMediaHub.Tizen/Views/MusicPlayer.xaml
TVMediaHub/TVMediaHub.Tizen/Views/MusicPlayer.xaml.cs
TVMediaHub/TVMediaHub.Tizen/Views/MusicTab.xaml [changed mode: 0644->0755]
TVMediaHub/TVMediaHub.Tizen/Views/MusicTab.xaml.cs
TVMediaHub/TVMediaHub.Tizen/res/btn_music_info_pause.png [deleted file]
TVMediaHub/TVMediaHub.Tizen/res/btn_music_info_play.png [deleted file]
TVMediaHub/TVMediaHub.Tizen/res/img_music_list_focused_shadow.9.png [deleted file]

index b38b31e..74c1294 100644 (file)
@@ -32,7 +32,6 @@ namespace TVMediaHub.Tizen.Models
         public string Title;
         public string Artist;
         public string AlbumCover;
-        public string AlbumName;
     }
 
     /// <summary>
@@ -100,7 +99,7 @@ namespace TVMediaHub.Tizen.Models
                     currentMusic = value;
 
                     /// 1. Stop the player
-                    if (playerInstance.State == PlayerState.Playing || playerInstance.State == PlayerState.Paused)
+                    if (playerInstance.State == PlayerState.Playing)
                     {
                         StopPlayer();
                     }
@@ -114,7 +113,6 @@ namespace TVMediaHub.Tizen.Models
                         Title = (currentMusic.MediaContentInformation as AudioInformation).Title,
                         Artist = (currentMusic.MediaContentInformation as AudioInformation).Artist,
                         AlbumCover = ((currentMusic.MediaContentInformation as AudioInformation).ThumbnailPath.Length != 0) ? (currentMusic.MediaContentInformation as AudioInformation).ThumbnailPath : "img_media_no_contents.png",
-                        AlbumName = (currentMusic.MediaContentInformation as AudioInformation).Album
                     });
 
                     /// 4. Update the progressbar of the current music
@@ -153,6 +151,7 @@ namespace TVMediaHub.Tizen.Models
         private void InitializePlayer()
         {
             playerInstance = new Player();
+
             playerInstance.PlaybackCompleted += ((s, e) =>
             {
                 StopPlayer();
@@ -223,37 +222,6 @@ namespace TVMediaHub.Tizen.Models
         }
 
         /// <summary>
-        /// Toggles pause and play the current music
-        /// </summary>
-        public void TogglePausePlay()
-        {
-            if (playerInstance.State == PlayerState.Playing)
-            {
-                try
-                {
-                    playerInstance.Pause();
-                }
-                catch (Exception e)
-                {
-                    DbgPort.E("Error : " + e.Message);
-                }
-                StopProgressbarTimer();
-            }
-            else if (playerInstance.State == PlayerState.Paused)
-            {
-                try
-                {
-                    playerInstance.Start();
-                }
-                catch (Exception e)
-                {
-                    DbgPort.E("Error : " + e.Message);
-                }
-                StartProgressbarTimer();
-            }
-        }
-
-        /// <summary>
         /// Stops the current music
         /// </summary>
         public void StopPlayer()
index edff850..3f8a617 100755 (executable)
     <Content Include="res\btn_media_select_pre.9.png" />
     <Content Include="res\btn_media_unselect_check_bk.png" />
     <Content Include="res\btn_media_unselect_check_wh.png" />
-    <Content Include="res\btn_music_info_pause.png" />
-    <Content Include="res\btn_music_info_play.png" />
     <Content Include="res\btn_viewer_control_focused.png" />
     <Content Include="res\btn_viewer_control_forward_normal.png" />
     <Content Include="res\btn_viewer_control_forward_pressed.png" />
     <Content Include="res\img_gradient_topbottom.9.png" />
     <Content Include="res\img_media_no_contents.png" />
     <Content Include="res\img_movie_unavailable.png" />
-    <Content Include="res\img_music_list_focused_shadow.9.png" />
     <Content Include="res\img_photozoom_gradient.9.png" />
     <Content Include="res\img_stroke.9.png" />
     <Content Include="res\img_stroke2.9.png" />
       </FlavorProperties>
     </VisualStudio>
   </ProjectExtensions>
-</Project>
\ No newline at end of file
+</Project>
index ee9d2d6..b4d39d9 100644 (file)
@@ -16,7 +16,6 @@
 
 using System.ComponentModel;
 using TVMediaHub.Tizen.Models;
-using Xamarin.Forms;
 
 namespace TVMediaHub.Tizen.ViewModels
 {
@@ -41,17 +40,10 @@ namespace TVMediaHub.Tizen.ViewModels
         public string AlbumArtist { get; private set; }
 
         /// <summary>
-        /// The album name to be shown
-        /// </summary>
-        public string AlbumName { get; private set; }
-
-        /// <summary>
         /// The album cover to be shown
         /// </summary>
         public string AlbumCover { get; private set; }
 
-        public Command MusicPlayerButtonClickCommand { get; private set; }
-
         /// <summary>
         /// An event that is occurred when property of ViewModel is changed
         /// </summary>
@@ -79,12 +71,6 @@ namespace TVMediaHub.Tizen.ViewModels
             AlbumTitle = "Title";
             AlbumArtist = "Artist";
             AlbumCover = "img_media_no_contents.png";
-            AlbumName = "Album";
-
-            MusicPlayerButtonClickCommand = new Command(() =>
-            {
-                MusicPlayerModel.Instance.TogglePausePlay();
-            });
 
             MusicPlayerModel.Instance.SetCurrentMusicInfoListener((e, args) =>
             {
@@ -101,9 +87,6 @@ namespace TVMediaHub.Tizen.ViewModels
 
                 AlbumCover = args.AlbumCover;
                 OnPropertyChanged("AlbumCover");
-
-                AlbumName = args.AlbumName;
-                OnPropertyChanged("AlbumName");
             });
 
             MusicPlayerModel.Instance.SetCurrentMusicProgressListener((e, arg) =>
index 34277cc..1b9dbad 100644 (file)
@@ -11,6 +11,6 @@
 
     <Grid x:Name="GroupContentArea"
           RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.926}"
-          RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.0737}">
-        </Grid>
+          RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.085}">
+    </Grid>
 </RelativeLayout>
\ No newline at end of file
index ca8f177..3667788 100644 (file)
@@ -1,26 +1,18 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<RelativeLayout xmlns="http://xamarin.com/schemas/2014/forms"
-                xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
-                xmlns:Utils="clr-namespace:TVMediaHub.Tizen.Utils"
-                x:Class="TVMediaHub.Tizen.Views.MusicPlayer">
-    <Utils:NinePatch x:Name="MusicPlayerShadowImage"
-           Source="img_music_list_focused_shadow.9.png" />    
+<StackLayout xmlns="http://xamarin.com/schemas/2014/forms"
+                  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+                  x:Class="TVMediaHub.Tizen.Views.MusicPlayer">
     <Image x:Name="MusicPlayerAlbumArt"
-           Source="{Binding AlbumCover}" />
-    <Image x:Name="MusicPlayerPausePlayButton"
-           Source="btn_music_info_play.png" />
-    <Button x:Name="MusicPlayerFocusArea"
-            Command="{Binding MusicPlayerButtonClickCommand}"
-            Focused="MusicPlayerFocusAreaFocused"
-            Unfocused="MusicPlayerFocusAreaUnfocused"
-            Opacity="0"/>
+           Source="{Binding AlbumCover}"
+           WidthRequest="300"
+           HeightRequest="300"
+           HorizontalOptions="Center"/>
     <Label x:Name="MusicPlayerTitle"
            Text="{Binding AlbumTitle}"
-           LineBreakMode="TailTruncation" />
+           HorizontalOptions="Center"/>
     <Label x:Name="MusicPlayerArtist"
            Text="{Binding AlbumArtist}"
-           LineBreakMode="TailTruncation" />
-    <Label x:Name="MusicPlayerAlbum"
-           Text="{Binding AlbumName}"
-           LineBreakMode="TailTruncation" />
-</RelativeLayout>
\ No newline at end of file
+           HorizontalOptions="Center"/>
+    <ProgressBar x:Name="MusicPlayerProgressbar"
+                 Progress="{Binding ProgressBarPercentage}"/>
+</StackLayout>
\ No newline at end of file
index 8c20801..008a402 100644 (file)
@@ -14,9 +14,6 @@
 * limitations under the License.
 */
 
-using System;
-using Tizen.Xamarin.Forms.Extension;
-using TVMediaHub.Tizen.Utils;
 using TVMediaHub.Tizen.ViewModels;
 using Xamarin.Forms;
 
@@ -25,91 +22,16 @@ namespace TVMediaHub.Tizen.Views
     /// <summary>
     /// A custom ContentPage for displaying the music player
     /// </summary>
-    public partial class MusicPlayer : RelativeLayout
+    public partial class MusicPlayer : StackLayout
     {
-        private bool IsInitailized;
-        private Rectangle ShadowImageFocusedBounds;
-        private Rectangle ShadowImageNormalBounds;
-
-        private Rectangle AlbumImageFocusedBounds;
-        private Rectangle AlbumImageNormalBounds;
-
-        private Rectangle PausePlayButtonBounds;
-
-        private Rectangle TitleBounds;
-        private Rectangle ArtistBounds;
-        private Rectangle AlbumNameBounds;
-
         /// <summary>
         /// A constructor
         /// </summary>
         public MusicPlayer()
         {
             BindingContext = MusicPlayerViewModelLocator.ViewModel;
-            IsInitailized = false;
-            InitializeComponent();
-            InitializeSize();
-        }
-
-        private void MusicPlayerFocusAreaFocused(object sender, FocusEventArgs e)
-        {
-            MusicPlayerShadowImage.LayoutTo(ShadowImageFocusedBounds);
-            MusicPlayerAlbumArt.LayoutTo(AlbumImageFocusedBounds);
-        }
-
-        private void MusicPlayerFocusAreaUnfocused(object sender, FocusEventArgs e)
-        {
-            MusicPlayerShadowImage.LayoutTo(ShadowImageNormalBounds);
-            MusicPlayerAlbumArt.LayoutTo(AlbumImageNormalBounds);
-        }
-
-        private void InitializeSize()
-        {
-            WidthRequest = SizeUtils.GetWidthSize(546);
-            HeightRequest = SizeUtils.GetHeightSize(546);
-            Margin = new Thickness(SizeUtils.GetWidthSize(-14), SizeUtils.GetHeightSize(-14), 0, 0);
-
-
-            MusicPlayerShadowImage.BorderTop = SizeUtils.GetHeightSize(67);
-            MusicPlayerShadowImage.BorderBottom = SizeUtils.GetHeightSize(67);
-            MusicPlayerShadowImage.BorderLeft = SizeUtils.GetWidthSize(67);
-            MusicPlayerShadowImage.BorderRight = SizeUtils.GetWidthSize(67);
-
-            ShadowImageFocusedBounds = new Rectangle(0, 0, SizeUtils.GetWidthSize(546), SizeUtils.GetHeightSize(546));
-            ShadowImageNormalBounds = new Rectangle(SizeUtils.GetWidthSize(6), SizeUtils.GetHeightSize(6), SizeUtils.GetWidthSize(532), SizeUtils.GetHeightSize(532));
-
-            AlbumImageFocusedBounds = new Rectangle(SizeUtils.GetWidthSize(64), SizeUtils.GetHeightSize(64), SizeUtils.GetWidthSize(418), SizeUtils.GetHeightSize(418));
-            AlbumImageNormalBounds = new Rectangle(SizeUtils.GetWidthSize(70), SizeUtils.GetHeightSize(70), SizeUtils.GetWidthSize(406), SizeUtils.GetHeightSize(406));
-
-            PausePlayButtonBounds = new Rectangle(SizeUtils.GetWidthSize(223), SizeUtils.GetHeightSize(223), SizeUtils.GetWidthSize(100), SizeUtils.GetHeightSize(100));
-
-            TitleBounds = new Rectangle(SizeUtils.GetWidthSize(72), SizeUtils.GetHeightSize(498), SizeUtils.GetWidthSize(406), SizeUtils.GetHeightSize(32));
-            ArtistBounds = new Rectangle(SizeUtils.GetWidthSize(72), SizeUtils.GetHeightSize(542), SizeUtils.GetWidthSize(418), SizeUtils.GetHeightSize(28));
-            AlbumNameBounds = new Rectangle(SizeUtils.GetWidthSize(72), SizeUtils.GetHeightSize(572), SizeUtils.GetWidthSize(418), SizeUtils.GetHeightSize(28));
 
-            MusicPlayerTitle.FontSize = SizeUtils.GetFontSize(28);
-
-            MusicPlayerArtist.FontSize = SizeUtils.GetFontSize(24);
-            MusicPlayerArtist.Opacity = 0.5;
-
-            MusicPlayerAlbum.FontSize = SizeUtils.GetFontSize(24);
-            MusicPlayerAlbum.Opacity = 0.25;
-        }
-
-        protected override void LayoutChildren(double x, double y, double width, double height)
-        {
-            if (IsInitailized == false)
-            {
-                base.LayoutChildren(x, y, width, height);
-                MusicPlayerAlbumArt.Layout(AlbumImageNormalBounds);
-                MusicPlayerTitle.Layout(TitleBounds);
-                MusicPlayerArtist.Layout(ArtistBounds);
-                MusicPlayerAlbum.Layout(AlbumNameBounds);
-                MusicPlayerShadowImage.Layout(ShadowImageNormalBounds);
-                MusicPlayerPausePlayButton.Layout(PausePlayButtonBounds);
-                MusicPlayerFocusArea.Layout(PausePlayButtonBounds);
-                IsInitailized = true;
-            }
+            InitializeComponent();
         }
     }
 }
old mode 100644 (file)
new mode 100755 (executable)
index c1fdee6..445a45d
                     RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}">
         <RelativeLayout RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
                         RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}">
-            <Views:FooterDeleteStatus x:Name="FooterDelete"
-                                      IsVisible="False"
+            <Views:FooterDeleteStatus x:Name="FooterDelete" IsVisible="False"
                                       RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
                                       RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
-                                      SelectedCount="{Binding SelectedCount}" />
-            <Views:FooterNormalStatus x:Name="FooterNormal"
-                                      IsVisible="True"
+                                      SelectedCount="{Binding SelectedCount}"/>
+            <Views:FooterNormalStatus x:Name="FooterNormal"  IsVisible="True"
                                       IsFooterEnabled="True"
                                       RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
                                       RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
                                       SourceList="{Binding SourceList}"
                                       SortOptions="{Binding SortOptions}"
-                                      OptionList="{Binding OptionList}" />
+                                      OptionList="{Binding OptionList}"/>
         </RelativeLayout>
-        
-        <StackLayout x:Name="MusicTabContents"
-                     RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.855}"
-                     RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
-                     Orientation="Horizontal">
-            <Views:MusicPlayer x:Name="MusicPlayer" />            
-            <ScrollView x:Name="MusicTabScrollView"
-                        Orientation="Horizontal"
-                        IsVisible="False">
-                <StackLayout x:Name="MusicContentView"
-                             Orientation="Horizontal"
-                             HorizontalOptions="Start"
-                             RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.1}">
-                </StackLayout>
-            </ScrollView>
-        </StackLayout>
-
-        <StackLayout x:Name="MusicNoContents"
-                     Orientation="Vertical"
-                     IsVisible="True"
+        <Views:MusicPlayer x:Name="MusicPlayer"
+                           RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.855}"
+                           RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.3}"
+                           RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.0}">
+        </Views:MusicPlayer>
+        <ScrollView x:Name="MusicTabScrollView"
+                    RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8545}"
+                    RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.7386}"
+                    RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.2614}"
+                    Orientation="Horizontal" IsVisible="False">
+            <StackLayout x:Name="MusicContentView"
+                         Orientation="Horizontal"
+                         HorizontalOptions="Start"
+                         RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.1}">
+            </StackLayout>
+        </ScrollView>
+        <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"
-                   FontFamily="BreezeSans"
-                   HorizontalOptions="Center" />
+            <Image x:Name="ImgNoContents" Source="img_media_no_contents.png" HorizontalOptions="Center"/>
+            <Label x:Name="LabelNoContents" Text="No content" FontFamily="BreezeSans" HorizontalOptions="Center"/>
         </StackLayout>
     </RelativeLayout>
 </mh:ContentPageEx>
\ No newline at end of file
index 7b3d946..c89ba88 100755 (executable)
  * limitations under the License.
  */
 
+using System;
 using System.Collections.ObjectModel;
 using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Threading;
 using System.Windows.Input;
 using TVMediaHub.Tizen.Controls;
 using TVMediaHub.Tizen.DataModels;
@@ -119,8 +122,8 @@ namespace TVMediaHub.Tizen.Views
             ImgNoContents.WidthRequest = SizeUtils.GetWidthSize(68);
             LabelNoContents.HeightRequest = SizeUtils.GetHeightSize(32);
             LabelNoContents.FontSize = SizeUtils.GetFontSize(28);
+            MusicContentView.Padding = new Thickness(0, SizeUtils.GetHeightSize(74));
             MusicContentView.Spacing = SizeUtils.GetWidthSize(60);
-            MusicTabContents.Padding = new Thickness(0, SizeUtils.GetHeightSize(74), 0, 0);
         }
 
         /// <summary>
@@ -219,7 +222,7 @@ namespace TVMediaHub.Tizen.Views
         /// <param name="e">A SelectedItemChanged event's argument</param>
         private void OnSourceChanged(object sender, SelectedItemChangedEventArgs e)
         {
-            string storageName = e.SelectedItem as string;
+            String storageName = e.SelectedItem as String;
 
             //BottomButtonList.Clear();
             ChangeSourceCommand?.Execute(storageName);
diff --git a/TVMediaHub/TVMediaHub.Tizen/res/btn_music_info_pause.png b/TVMediaHub/TVMediaHub.Tizen/res/btn_music_info_pause.png
deleted file mode 100644 (file)
index f73f5c8..0000000
Binary files a/TVMediaHub/TVMediaHub.Tizen/res/btn_music_info_pause.png and /dev/null differ
diff --git a/TVMediaHub/TVMediaHub.Tizen/res/btn_music_info_play.png b/TVMediaHub/TVMediaHub.Tizen/res/btn_music_info_play.png
deleted file mode 100644 (file)
index 9380081..0000000
Binary files a/TVMediaHub/TVMediaHub.Tizen/res/btn_music_info_play.png and /dev/null differ
diff --git a/TVMediaHub/TVMediaHub.Tizen/res/img_music_list_focused_shadow.9.png b/TVMediaHub/TVMediaHub.Tizen/res/img_music_list_focused_shadow.9.png
deleted file mode 100644 (file)
index 93ba39d..0000000
Binary files a/TVMediaHub/TVMediaHub.Tizen/res/img_music_list_focused_shadow.9.png and /dev/null differ