Added Detail View options 55/265955/2
authoraman.jeph <aman.jeph@samsung.com>
Tue, 2 Nov 2021 09:43:06 +0000 (15:13 +0530)
committeraman.jeph <aman.jeph@samsung.com>
Tue, 2 Nov 2021 09:57:11 +0000 (15:27 +0530)
Fix dark theme support of some views

Change-Id: Ie5b6ef89227368382cf0fa2a1a34acd50faf15fd
Signed-off-by: aman.jeph <aman.jeph@samsung.com>
23 files changed:
music-player/Common/Conversion.cs [new file with mode: 0755]
music-player/Common/UIColors.cs
music-player/Core/PlaybackHelper.cs
music-player/MediaContent/TrackContents.cs
music-player/Models/TrackExtension.cs [new file with mode: 0755]
music-player/ViewModels/PlayerViewModel.cs
music-player/ViewModels/TrackDetailViewModel.cs [new file with mode: 0755]
music-player/Views/AlbumDetailView.cs
music-player/Views/ArtistDetailGroupLayout.cs
music-player/Views/BaseContentView.cs
music-player/Views/BaseSubContentView.cs
music-player/Views/BaseView.cs
music-player/Views/PlayerView.cs
music-player/Views/PlayingListView.cs
music-player/Views/PlaylistSelectorView.cs
music-player/Views/SearchView.cs
music-player/Views/SelectorView.cs
music-player/Views/TrackDetailView.cs [new file with mode: 0755]
music-player/res/images/dark/search_button_bg.png [new file with mode: 0755]
music-player/res/images/search_button_bg.png [deleted file]
music-player/res/images/search_icon.png [deleted file]
music-player/res/themes/dark.xaml
music-player/res/themes/light.xaml

diff --git a/music-player/Common/Conversion.cs b/music-player/Common/Conversion.cs
new file mode 100755 (executable)
index 0000000..f490731
--- /dev/null
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace MusicPlayer.Common
+{
+    public class Conversion
+    {
+        private const string MediaPath = "/opt/usr/home/owner/media";
+        private const string DevicePath = "Device Storage";
+
+        static readonly string[] SizeSuffixes =
+                   { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
+        public static string BytesToPrefixMultipliers(Int64 value, int decimalPlaces = 1)
+        {
+            if (decimalPlaces < 0) { throw new ArgumentOutOfRangeException("decimalPlaces"); }
+            if (value < 0) { return "-" + BytesToPrefixMultipliers(-value, decimalPlaces); }
+            if (value == 0) { return string.Format("{0:n" + decimalPlaces + "} bytes", 0); }
+
+            // mag is 0 for bytes, 1 for KB, 2, for MB, etc.
+            int mag = (int)Math.Log(value, 1024);
+
+            // 1L << (mag * 10) == 2 ^ (10 * mag)
+            // [i.e. the number of bytes in the unit corresponding to mag]
+            decimal adjustedSize = (decimal)value / (1L << (mag * 10));
+
+            // make adjustment when the value is large enough that
+            // it would round up to 1000 or more
+            if (Math.Round(adjustedSize, decimalPlaces) >= 1000)
+            {
+                mag += 1;
+                adjustedSize /= 1024;
+            }
+
+            return string.Format("{0:n" + decimalPlaces + "} {1}",
+                adjustedSize,
+                SizeSuffixes[mag]);
+        }
+
+        public static string AbsolutePathToDevicePath(string absolutePath)
+        {
+            return absolutePath.Replace(MediaPath, DevicePath);
+        }
+    }
+}
index 3bf5a2149a2549c3647eaf8767e0535ec019f3c1..2562765e32b5396daff656b15e87bee242b4c26a 100755 (executable)
@@ -11,6 +11,7 @@ namespace MusicPlayer.Common
         public static readonly Color HEX001447 = new Color(0.0f, 0.0784f, 0.2784f, 1.0f);
         public static readonly Color HEXEEEFF1 = new Color(0.9333f, 0.9373f, 0.9450f, 1.0f);
         public static readonly Color HEX000C2B = new Color(0.0f, 0.0471f, 0.1686f, 1.0f);
+        public static readonly Color HEXC3CAD2 = new Color(0.7647f, 0.7922f, 0.8235f, 1.0f);
 
         public static readonly Color LyricsBackground = new Color(0.0f, 0.0f, 0.0f, 0.85f);
         public static readonly Color ItemSeperator = new Color(0.75f, 0.79f, 0.82f, 1.0f);
index 2e27ae06de89d5ece3a8b8a4589d7ba92253ae15..6f9c4caf4fe27d36c86458cb8fe1fc33b131666e 100755 (executable)
@@ -21,6 +21,13 @@ namespace MusicPlayer.Core
             playerViewModel = new PlayerViewModel();
             playerView = new PlayerView(playerViewModel);
             playerView.BackKeyPressed += OnBackKeyPressed;
+            playerViewModel.ShowDetails += OnShowDetails;
+        }
+
+        private void OnShowDetails(object sender, DetailOperationEventHandlerArgs e)
+        {
+            TrackDetailViewModel viewModel = new TrackDetailViewModel(e.MediaId);
+            TrackDetailView view = new TrackDetailView(viewModel);
         }
 
         public static PlaybackHelper Instance
index e063518f10396156da51e101d01adba05dd037ff..355ba5c91e1753bcc129fb5fdd682607d98a3c3c 100755 (executable)
@@ -134,5 +134,10 @@ namespace MusicPlayer.Media
             dataReader.Dispose();\r
             return mediaList;\r
         }\r
+\r
+        public static AudioInfo GetTrack(string mediaId)\r
+        {\r
+            return (AudioInfo)mediaInfo.SelectMedia(mediaId);\r
+        }\r
     }\r
 }\r
diff --git a/music-player/Models/TrackExtension.cs b/music-player/Models/TrackExtension.cs
new file mode 100755 (executable)
index 0000000..28d1aa5
--- /dev/null
@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using MusicPlayer.Common;
+
+namespace MusicPlayer.Models
+{
+    class TrackExtension : Track
+    {
+        public TrackExtension():base()
+        {
+        }
+
+        public TrackExtension(Tizen.Content.MediaContent.AudioInfo audioInfo):base(audioInfo)
+        {
+            DateOfRecording = VerifyValue(audioInfo.DateRecorded);
+            TrackNumber = VerifyValue(audioInfo.TrackNumber);
+            Format = VerifyValue(audioInfo.MimeType);
+            BitDepth = VerifyValue(audioInfo.BitRate.ToString());
+            SampleRate = VerifyValue(audioInfo.SampleRate.ToString());
+            TrackSize = Conversion.BytesToPrefixMultipliers(audioInfo.FileSize);
+            Location = Conversion.AbsolutePathToDevicePath(audioInfo.Path);
+        }
+
+        private string dateofRecording;
+
+        public string DateOfRecording
+        {
+            get => dateofRecording;
+            set => SetProperty(ref dateofRecording, value);
+        }
+
+        private string trackNumber;
+
+        public string TrackNumber
+        {
+            get => trackNumber;
+            set => SetProperty(ref trackNumber, value);
+        }
+
+        private string format;
+
+        public string Format
+        {
+            get => format;
+            set => SetProperty(ref format, value);
+        }
+
+        private string bitDepth;
+
+        public string BitDepth
+        {
+            get => bitDepth;
+            set => SetProperty(ref bitDepth, value);
+        }
+
+        private string sampleRate;
+
+        public string SampleRate
+        {
+            get => sampleRate;
+            set => SetProperty(ref sampleRate, value);
+        }
+
+        private string trackSize;
+
+        public String TrackSize
+        {
+            get => trackSize;
+            set => SetProperty(ref trackSize, value);
+        }
+
+        private string location;
+
+        public string Location
+        {
+            get => location;
+            set => SetProperty(ref location, value);
+        }
+
+        private string VerifyValue(string value)
+        {
+            if(string.IsNullOrEmpty(value))
+            {
+                return "Unknown";
+            }
+            return value;
+        }
+    }
+}
index 28a52a144b19197042d2f2c56a4b5b6b19164119..4eb4cf3a1879ab3b6171967f71ef2915f65fc24e 100755 (executable)
@@ -11,6 +11,15 @@ using System.Threading.Tasks;
 
 namespace MusicPlayer.ViewModels
 {
+    class DetailOperationEventHandlerArgs : EventArgs
+    {
+        public DetailOperationEventHandlerArgs(string mediaId)
+        {
+            MediaId = mediaId;
+        }
+        public string MediaId { get; private set; }
+    }
+
     class PlayerViewModel : PropertyNotifier
     {
         public const string PlayState = "Play";
@@ -23,6 +32,8 @@ namespace MusicPlayer.ViewModels
         private Timer playbackTimer;
         private bool isVolumeChanging;
 
+        public event EventHandler<DetailOperationEventHandlerArgs> ShowDetails;
+
         public PlayerViewModel()
         {
             lyricsViewModel = new LyricsViewModel();
@@ -105,6 +116,11 @@ namespace MusicPlayer.ViewModels
             set => UpdatePlayingStatus(value);
         }
 
+        public void ShowDetailView()
+        {
+            ShowDetails?.Invoke(this, new DetailOperationEventHandlerArgs(playerModel.CurrentTrack.Id));
+        }
+
         public void SetPlayingList(ListViewModel<Track> trackListVM)
         {
             playingListViewModel.SetTrackListViewModel(trackListVM);
diff --git a/music-player/ViewModels/TrackDetailViewModel.cs b/music-player/ViewModels/TrackDetailViewModel.cs
new file mode 100755 (executable)
index 0000000..0e84aa3
--- /dev/null
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.Content.MediaContent;
+using MusicPlayer.Models;
+using MusicPlayer.Media;
+using MusicPlayer.Common;
+
+namespace MusicPlayer.ViewModels
+{
+    class TrackDetailViewModel
+    {
+        private TrackExtension trackExtensionModel;
+
+        public TrackDetailViewModel(string mediaId)
+        {
+            AudioInfo audioInfo = Contents.GetTrack(mediaId);
+            trackExtensionModel = new TrackExtension(audioInfo);
+        }
+
+        public TrackExtension Model => trackExtensionModel;
+    }
+}
index bcbf1cfdb46b946a989cccf1b0b3b960932b0943..2c74b00769145d3958150209954f18b96891497b 100755 (executable)
@@ -202,6 +202,7 @@ namespace MusicPlayer.Views
 \r
         private void UpdateCollectionView()\r
         {\r
+            collectionView.StyleName = "PlayingListBackground";\r
             collectionView.ItemTemplate = new DataTemplate(() =>\r
             {\r
                 AlbumDetailLayout layout = new AlbumDetailLayout();\r
index c4d2b63a4c0a2b85f73feecf328e2aaca42b4c8c..aeefd2f048b47bffa42c16c4bf81f27f2778de96 100755 (executable)
@@ -31,6 +31,7 @@ namespace MusicPlayer.Views
             Size2D = new Size2D(Width, Height);
             // to show the rounded rect of the bg
             BackgroundColor = Color.Transparent;
+            ThemeChangeSensitive = true;
 
             icon = CreateIcon();
             titleLabel = CreateTitleLabel();
@@ -70,7 +71,6 @@ namespace MusicPlayer.Views
                 StyleName = "ItemLabel",
                 ThemeChangeSensitive = true,
                 Size2D = new Size2D((Width - (2 * LeftPadding) - IconSize - LayoutPadding), 40),
-                TextColor = UIColors.HEX001447,
                 PixelSize = 32,
                 FontFamily = "BreezeSans",
                 VerticalAlignment = VerticalAlignment.Center,
index d4da99a9235a5c8d059df99556a583aee986ed3b..d137ff3d1ad26cee364bba18ee06f33bbc9a25a5 100755 (executable)
@@ -58,9 +58,9 @@ namespace MusicPlayer.Views
             collectionView = new CollectionView()
             {
                 ThemeChangeSensitive = true,
+                StyleName = "ListBackground",
                 Size2D = new Size2D(1792, 108),
                 Margin = new Extents(0, 0, 0, 2),
-                BackgroundImage = GetBackgroundImagePath(ThemeManager.PlatformThemeId),
                 ItemsLayouter = new LinearLayouter(),
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
@@ -201,15 +201,6 @@ namespace MusicPlayer.Views
             OperationViewAdded?.Invoke(this, args);
         }
 
-        protected override void OnThemeChanged(object sender, ThemeChangedEventArgs e)
-        {
-            base.OnThemeChanged(sender, e);
-            if(e.IsPlatformThemeChanged)
-            {
-                collectionView.BackgroundImage = GetBackgroundImagePath(e.PlatformThemeId);
-            }
-        }
-
         protected override void Dispose(DisposeTypes type)
         {
             if(Disposed)
@@ -242,17 +233,6 @@ namespace MusicPlayer.Views
             base.Dispose(type);
         }
 
-        private string GetBackgroundImagePath(string platformThemeId)
-        {
-            if (platformThemeId.Equals(AppConstants.DarkPlatformThemeId))
-            {
-                return Resources.GetImagePath() + "dark/list_view_bg.png";
-            }
-            else
-            {
-                return Resources.GetImagePath() + "light/list_view_bg.png";
-            }
-        }
         private void OnSubContentOperationViewAdd(object sender, OperationViewAddEventArgs e)
         {
             DismissMoreMenu();
index 2de91561c28e17028f1427fa3cb600c22dec0df6..2b15bd0132eddb5d16a034682ce1ddda48af1d13 100755 (executable)
@@ -24,6 +24,7 @@ namespace MusicPlayer.Views
         {
             WidthResizePolicy = ResizePolicyType.FillToParent;
             HeightResizePolicy = ResizePolicyType.FillToParent;
+            ThemeChangeSensitive = true;
             StyleName = "AppBackground";
 
             listContainer = new View()
@@ -97,9 +98,9 @@ namespace MusicPlayer.Views
             collectionView = new CollectionView()
             {
                 ThemeChangeSensitive = true,
+                StyleName = "ListBackground",
                 //Size2D = new Size2D(1792, 108),
                 Margin = new Extents(0, 0, 0, 2),
-                BackgroundImage = GetBackgroundImagePath(ThemeManager.PlatformThemeId),
                 ItemsLayouter = new LinearLayouter(),
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
@@ -151,18 +152,6 @@ namespace MusicPlayer.Views
 
         }
 
-        private string GetBackgroundImagePath(string platformThemeId)
-        {
-            if (platformThemeId.Equals(AppConstants.DarkPlatformThemeId))
-            {
-                return Resources.GetImagePath() + "dark/list_view_bg.png";
-            }
-            else
-            {
-                return Resources.GetImagePath() + "light/list_view_bg.png";
-            }
-        }
-
         protected override void Dispose(DisposeTypes type)
         {
             if(Disposed)
index 8b4daae045ff114fc55c6ad926bd553efdc2b654..452f79aec2e3e75269d054dd920adec7496b246c 100755 (executable)
@@ -96,7 +96,6 @@ namespace MusicPlayer.Views
                 item.Text = TabNames[i];
                 tabs.AddItem(item);
             }
-            tabs.SelectedItemIndex = 1;
 
             backButton = null;
             moreButton = null;
@@ -179,20 +178,9 @@ namespace MusicPlayer.Views
             {
                 if (value)
                 {
-                    ButtonStyle buttonStyle = new ButtonStyle()
-                    {
-                        Icon = new ImageViewStyle()
-                        {
-                            ResourceUrl = Resources.GetImagePath() + "search_icon.png",
-                        },
-                        IsSelectable = false,
-                        IsEnabled = true,
-                    };
-                    searchButton = new Button(buttonStyle)
+                    searchButton = new Button("SearchButton")
                     {
                         ThemeChangeSensitive = true,
-                        Size2D = new Size2D(96, 60),
-                        BackgroundImage = Resources.GetImagePath() + "search_button_bg.png",
                         Margin = new Extents(24, 0, 0, 0),
                     };
                     topView.Add(searchButton);
index 4e15ed2b1662af8c3812c2edf6171f7206c707da..4dace262989f4bf2c2164f735ded926073562331 100755 (executable)
@@ -211,7 +211,14 @@ namespace MusicPlayer.Views
                 OnDeleteClicked();
             };
 
-            moreMenu.Items = new MenuItem[] { share, delete };
+            var details = new MenuItem { Text = "Details" };
+            details.Clicked += (object o, ClickedEventArgs e) =>
+            {
+                moreMenu?.Dismiss();
+                viewModel.ShowDetailView();
+            };
+
+            moreMenu.Items = new MenuItem[] { share, delete, details };
             moreMenu.Post();
         }
 
index c7b7c91385e2b6571069968f3c1b9837b0093ad5..91443bb2ec98cb5d42ec0c4d7c97e23a9e9d408c 100755 (executable)
@@ -20,7 +20,8 @@ namespace MusicPlayer.Views
             this.viewModel = viewModel;
             collectionView = new CollectionView()
             {
-                BackgroundImage = GetBackgroundImagePath(ThemeManager.PlatformThemeId),
+                ThemeChangeSensitive = true,
+                StyleName = "PlayingListBackground",
                 ItemsSource = this.viewModel.TrackListVM,
                 ItemsLayouter = new LinearLayouter(),
                 ItemTemplate = new DataTemplate(() =>
@@ -58,18 +59,5 @@ namespace MusicPlayer.Views
         {
             collectionView.ItemsSource = viewModel.TrackListVM;
         }
-
-        private string GetBackgroundImagePath(string platformThemeId)
-        {
-            if (platformThemeId.Equals(AppConstants.DarkPlatformThemeId))
-            {
-                return Resources.GetImagePath() + "dark/list_view_bg.png";
-            }
-            else
-            {
-                return Resources.GetImagePath() + "light/list_view_bg.png";
-            }
-        }
-
     }
 }
index 2e1c2ac9db80c8b8d2ddb208f6d2015c4a20892f..bb56cb8957d0e4e9c1df86ae0d55ebfe0bbd91c2 100755 (executable)
@@ -105,7 +105,7 @@ namespace MusicPlayer.Views
                 IsSelectable = false,
             };
 
-            createNewPlaylistButton = new Button(buttonStyle)
+            createNewPlaylistButton = new Button("PlaylistCreate")
             {
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = 108,
@@ -115,13 +115,14 @@ namespace MusicPlayer.Views
                 IsSelectable = false,
                 ItemAlignment = LinearLayout.Alignment.CenterVertical,
             };
+            createNewPlaylistButton.TextAlignment = HorizontalAlignment.Begin;
             createNewPlaylistButton.BindingContext = viewModel;
             createNewPlaylistButton.SetBinding(Button.IsEnabledProperty, "CanCreatePlaylist");
             selectPlaylistContentArea.Add(createNewPlaylistButton);
             View itemSeperator = new View()
             {
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 1,
+                HeightSpecification = 2,
                 BackgroundColor = UIColors.ItemSeperator,
                 Margin = new Extents(64, 64, 0, 0),
             };
@@ -158,6 +159,8 @@ namespace MusicPlayer.Views
         {
             collectionView = new CollectionView()
             {
+                ThemeChangeSensitive = true,
+                StyleName = "ListBackground",
                 Size2D = new Size2D(1184, 108),
                 ItemsLayouter = new LinearLayouter(),
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
@@ -177,13 +180,15 @@ namespace MusicPlayer.Views
             FlexLayout.SetFlexShrink(collectionView, 1);
             collectionView.ItemTemplate = new DataTemplate(() =>
             {
-                DefaultLinearItem layout = new DefaultLinearItem();
+                DefaultLinearItem layout = new DefaultLinearItem("LinearItem");
                 layout.WidthSpecification = LayoutParamPolicies.MatchParent;
                 layout.HeightSpecification = 108;
+                layout.Seperator.BackgroundColor = UIColors.ItemSeperator;
                 layout.Seperator.Padding = new Extents(0, 0, 0, 0);
                 layout.Seperator.Margin = new Extents(0, 0, 0, 0);
                 layout.Seperator.WidthSpecification = LayoutParamPolicies.MatchParent;
                 layout.Label.SetBinding(TextLabel.TextProperty, "PlaylistName");
+                layout.Label.FontStyle = UIFontStyles.NormalLight;
                 layout.Padding = new Extents(0, 0, 0, 0);
                 layout.Margin = new Extents(0, 0, 0, 0);
                 return layout;
@@ -295,9 +300,9 @@ namespace MusicPlayer.Views
             AddInputArea();
             View itemSeperator = new View()
             {
+                BackgroundColor = UIColors.ItemSeperator,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = 1,
-                BackgroundColor = UIColors.HEX001447,
             };
             createPlaylistContentArea.Add(itemSeperator);
             underText = new TextLabel("ItemLabel")
@@ -329,11 +334,12 @@ namespace MusicPlayer.Views
             };
             textField = new TextField()
             {
+                ThemeChangeSensitive = true,
+                StyleName = "TextField",
+                PixelSize = 32,
                 Size2D = new Size2D(928, 48),
-                BackgroundColor = Color.White,
                 Position2D = new Position2D(0, 0),
                 Margin = new Extents(0, 48, 0, 0),
-                TextColor = UIColors.HEX001447,
                 FontStyle = UIFontStyles.NormalLight,
                 MaxLength = 65,
             };
index 7b1789605f89626beefffaa6487b591542f1e0ab..424483a49c165dd3f924c7732f9992e51a2db9ab 100755 (executable)
@@ -183,8 +183,9 @@ namespace MusicPlayer.Views
         {
             collectionView = new CollectionView()
             {
+                ThemeChangeSensitive = true,
+                StyleName = "ListBackground",
                 Size2D = new Size2D(1792, 108),
-                BackgroundImage = Resources.GetImagePath() + "list_view_bg.png",
                 Padding = new Extents(0, 0, 0, 0),
                 ItemsLayouter = new LinearLayouter(),
                 ItemTemplate = new DataTemplate(() =>
index a07be4ff6e98006e0fa22880911a399e99bc60ec..d8612128544aa7efd1724b32e17eadcb2c20da7f 100755 (executable)
@@ -82,7 +82,6 @@ namespace MusicPlayer.Views
                 Text = url,
                 Position2D = new Position2D(x, y),
                 IsEnabled = false,
-                IsSelectable = true,
             };
             return button;
         }
@@ -271,9 +270,10 @@ namespace MusicPlayer.Views
         {
             CollectionView collectionView = new CollectionView()
             {
+                ThemeChangeSensitive = true,
+                StyleName = "ListBackground",
                 Size2D = new Size2D(1792, 108),
                 Margin = new Extents(LayoutPadding, LayoutPadding, 0, 0),
-                BackgroundImage = Resources.GetImagePath() + "list_view_bg.png",
                 ItemsLayouter = new LinearLayouter(),
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 HeightSpecification = LayoutParamPolicies.WrapContent,
diff --git a/music-player/Views/TrackDetailView.cs b/music-player/Views/TrackDetailView.cs
new file mode 100755 (executable)
index 0000000..840d413
--- /dev/null
@@ -0,0 +1,207 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Components;
+using Tizen.NUI.BaseComponents;
+using MusicPlayer.Common;
+using MusicPlayer.ViewModels;
+
+namespace MusicPlayer.Views
+{
+    class TrackDetailView : Navigator
+    {
+        private ContentPage contentPage;
+        private ScrollableBase scrollableBase;
+        private TrackDetailViewModel viewModel;
+        private View itemRootView;
+        public TrackDetailView(TrackDetailViewModel viewModel) : base()
+        {
+            this.viewModel = viewModel;
+            WidthResizePolicy = ResizePolicyType.FillToParent;
+            HeightResizePolicy = ResizePolicyType.FillToParent;
+            Window.Instance.Add(this);
+            AddContentPage();
+            AddDetailInfo();
+            Popped += OnPoped;
+            BackKeyPressed += OnBackKeyPressed;
+        }
+
+        private void OnBackKeyPressed(object sender, EventArgs e)
+        {
+            this.Pop();
+        }
+
+        protected override void Dispose(DisposeTypes type)
+        {
+            if(Disposed)
+            {
+                return;
+            }
+            if(type == DisposeTypes.Explicit)
+            {
+                BackKeyPressed -= OnBackKeyPressed;
+                RecursivelyDisposeChildren(itemRootView);
+                scrollableBase.RemoveAllChildren(true);
+                scrollableBase.Dispose();
+                scrollableBase = null;
+                itemRootView = null;
+                if(contentPage.IsOnWindow)
+                {
+                    View parent = contentPage.GetParent() as View;
+                    parent?.Remove(contentPage);
+                }
+                contentPage.Dispose();
+                contentPage = null;
+            }
+            base.Dispose(type);
+        }
+
+        private void RecursivelyDisposeChildren(View view)
+        {
+            while(view.ChildCount > 0)
+            {
+                View child = view.GetChildAt(0);
+                RecursivelyDisposeChildren(child);
+                view.Remove(child);
+                child.Dispose();
+                child = null;
+            }
+        }
+
+        private void OnPoped(object sender, PoppedEventArgs e)
+        {
+            if(PageCount <= 0)
+            {
+                RemoveDetailsPage();
+            }
+        }
+
+        private void RemoveDetailsPage()
+        {
+            Window.Instance.Remove(this);
+            Dispose(DisposeTypes.Explicit);
+        }
+
+        private ScrollableBase CreateScrollView()
+        {
+            scrollableBase = new ScrollableBase()
+            {
+                ThemeChangeSensitive = true,
+                StyleName = "ListBackground",
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                HeightSpecification = 836,
+                Margin = new Extents(64, 64, 0, 0),
+                ScrollingDirection = ScrollableBase.Direction.Vertical,
+            };
+            return scrollableBase;
+        }
+
+        private View AddDummyMiniController()
+        {
+            View view = new View()
+            {
+                WidthSpecification = LayoutParamPolicies.MatchParent,
+                HeightSpecification = 124,
+                BackgroundColor = Color.Magenta,
+            };
+            return view;
+        }
+
+        private View CreateContent()
+        {
+            View view = new View()
+            {
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                HeightResizePolicy = ResizePolicyType.FillToParent,
+                Layout = new LinearLayout()
+                {
+                    LinearOrientation = LinearLayout.Orientation.Vertical,
+                },
+            };
+            view.Add(CreateScrollView());
+            //view.Add(AddDummyMiniController());
+            return view;
+        }
+
+        private void AddContentPage()
+        {
+            contentPage = new ContentPage()
+            {
+                AppBar = new AppBar()
+                {
+                    Title = "Details",
+                },
+                Content = CreateContent(),
+            };
+            base.PushWithTransition(contentPage);
+        }
+
+        private View CreateDetailLayout(string title, string propertyName)
+        {
+            View view = new View()
+            {
+                BackgroundColor = Color.Transparent,
+                Size2D = new Size2D(1664, 108),
+                BindingContext = viewModel.Model,
+            };
+
+            TextLabel titleLabel = new TextLabel()
+            {
+                ThemeChangeSensitive = true,
+                StyleName = "DetailTitle",
+                FontStyle = UIFontStyles.NormalLight,
+                Text = title,
+            };
+            view.Add(titleLabel);
+
+            TextLabel subtitle = new TextLabel()
+            {
+                ThemeChangeSensitive = true,
+                StyleName = "DetailSubTitle",
+                FontStyle = UIFontStyles.AllNormal,
+            };
+            subtitle.SetBinding(TextLabel.TextProperty, propertyName);
+            view.Add(subtitle);
+
+            View itemSaperator = new View()
+            {
+                BackgroundColor = UIColors.HEXC3CAD2,
+                Size2D = new Size2D(1664, 1),
+                Position2D = new Position2D(0, 107),
+            };
+            view.Add(itemSaperator);
+
+            return view;
+        }
+
+        private void AddItem(View item, int x, int y)
+        {
+            item.Position2D = new Position2D(x, y);
+            itemRootView.Add(item);
+        }
+
+        private void AddDetailInfo()
+        {
+            itemRootView = new View()
+            {
+                BackgroundColor = Color.Transparent,
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                HeightResizePolicy = ResizePolicyType.FitToChildren,
+            };
+            scrollableBase.Add(itemRootView);
+            AddItem(CreateDetailLayout("Title", "TrackTitle"), 64, 0);
+            AddItem(CreateDetailLayout("Artist", "ArtistName"), 64, 108);
+            AddItem(CreateDetailLayout("Album", "AlbumName"), 64, 216);
+            AddItem(CreateDetailLayout("Length", "Duration"), 64, 324);
+            AddItem(CreateDetailLayout("Date of Recording", "DateOfRecording"), 64, 432);
+            AddItem(CreateDetailLayout("Track Number", "TrackNumber"), 64, 540);
+            AddItem(CreateDetailLayout("Format", "Format"), 64, 648);
+            AddItem(CreateDetailLayout("Bit Depth", "BitDepth"), 64, 756);
+            AddItem(CreateDetailLayout("Sample Rate", "SampleRate"), 64, 864);
+            AddItem(CreateDetailLayout("Size", "TrackSize"), 64, 972);
+            AddItem(CreateDetailLayout("Location", "Location"), 64, 1080);
+        }
+    }
+}
diff --git a/music-player/res/images/dark/search_button_bg.png b/music-player/res/images/dark/search_button_bg.png
new file mode 100755 (executable)
index 0000000..d7457a2
Binary files /dev/null and b/music-player/res/images/dark/search_button_bg.png differ
diff --git a/music-player/res/images/search_button_bg.png b/music-player/res/images/search_button_bg.png
deleted file mode 100755 (executable)
index b969e8a..0000000
Binary files a/music-player/res/images/search_button_bg.png and /dev/null differ
diff --git a/music-player/res/images/search_icon.png b/music-player/res/images/search_icon.png
deleted file mode 100755 (executable)
index bb06301..0000000
Binary files a/music-player/res/images/search_icon.png and /dev/null differ
index 288b548b9e7f8b68f65020c74254b0b0e3b1805d..580761c3bcb9e00c585f6343821b6b2502306b5d 100755 (executable)
@@ -9,6 +9,8 @@ Id="DarkTheme">
   <ViewStyle x:Key="InputLine" BackgroundColor="#FFFFFF" />
   <ViewStyle x:Key="SearchBox" BackgroundImage="*Resource*/images/dark/search_box_bg.png" />
   <ViewStyle x:Key="SelectAllBg" BackgroundImage="*Resource*/images/dark/selectall_bg.png" />
+  <ViewStyle x:Key="ListBackground" BackgroundImage="*Resource*/images/dark/list_view_bg.png" />
+  <ViewStyle x:Key="PlayingListBackground" BackgroundImage="*Resource*/images/dark/playing_list_bg.png" />
 
   <TextFieldStyle x:Key="TextField" TextColor ="#FFFFFF" />
 
@@ -183,11 +185,11 @@ Id="DarkTheme">
     </c:ButtonStyle.Text>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="TextButton" Size="260, 64" IsSelectable="false" BackgroundColor="Transparent" >
+  <c:ButtonStyle x:Key="TextButton" Size="260, 64" BackgroundColor="Transparent" >
     <c:ButtonStyle.Text>
       <TextLabelStyle FontFamily="BreezeSans" PixelSize="28">
         <TextLabelStyle.TextColor>
-          <Selector x:TypeArguments="Color" Normal="#FFFFFF" Selected="#1473E6" Disabled="#B2B7BE" />
+          <Selector x:TypeArguments="Color" Normal="#FFFFFF" Pressed="#1473E6" Disabled="#B2B7BE" />
         </TextLabelStyle.TextColor>
       </TextLabelStyle>
     </c:ButtonStyle.Text>
@@ -213,11 +215,38 @@ Id="DarkTheme">
 
   <c:TabStyle x:Key="Tabs" BackgroundColor="#000209">
     <c:TabStyle.Text>
-      <TextLabelStyle TextColor="#FFFFFF" FontFamily="BreezeSans" PixelSize="28"/>
+      <TextLabelStyle TextColor="#FFFFFF" ThemeChangeSensitive="true" FontFamily="BreezeSans" PixelSize="28"/>
     </c:TabStyle.Text>
     <c:TabStyle.UnderLine>
       <ViewStyle BackgroundColor="#FFFFFF" SizeHeight="8"/>
     </c:TabStyle.UnderLine>
   </c:TabStyle>
 
+  <c:ButtonStyle x:Key="SearchButton" Size="96, 60" IsSelectable="false" IsEnabled="true" BackgroundImage="*Resource*/images/dark/search_button_bg.png">
+    <c:ButtonStyle.Icon>
+      <ImageViewStyle>
+        <ImageViewStyle.ResourceUrl>*Resource*/images/dark/search_icon.png</ImageViewStyle.ResourceUrl>
+      </ImageViewStyle>
+    </c:ButtonStyle.Icon>
+  </c:ButtonStyle>
+
+  <c:DefaultLinearItemStyle x:Key="LinearItem" BackgroundColor="Transparent">
+    <c:DefaultLinearItemStyle.Label>
+      <TextLabelStyle TextColor="#FFFFFF" ThemeChangeSensitive="true" FontFamily="BreezeSans" PixelSize="32"/>
+    </c:DefaultLinearItemStyle.Label>
+  </c:DefaultLinearItemStyle>
+
+  <c:ButtonStyle x:Key="PlaylistCreate" BackgroundColor="Transparent" >
+    <c:ButtonStyle.Text>
+      <TextLabelStyle FontFamily="BreezeSans" PixelSize="32" Text="+ Create new playlist">
+        <TextLabelStyle.TextColor>
+          <Selector x:TypeArguments="Color" Normal="#FFFFFF" Pressed="#1473E6" Disabled="#C3CAD2" />
+        </TextLabelStyle.TextColor>
+      </TextLabelStyle>
+    </c:ButtonStyle.Text>
+  </c:ButtonStyle>
+
+  <TextLabelStyle x:Key="DetailTitle" Position="0, 16" Size="1664, 108" TextColor="#FFFFFF" FontFamily="BreezeSans" PixelSize="32"/>
+  <TextLabelStyle x:Key="DetailSubTitle" Position="0, 56" Size="1664, 108" TextColor="#FFFFFF" FontFamily="BreezeSans" PixelSize="28"/>
+
 </Theme>
\ No newline at end of file
index 807249bfc16916e9c224f8fe4b46a811d6e0bbd7..d42a9c7cd0c800b33d66635cc9525de861608d6d 100755 (executable)
@@ -9,6 +9,8 @@ Id="LightTheme">
   <ViewStyle x:Key="InputLine" BackgroundColor="#0A0E4A" />
   <ViewStyle x:Key="SearchBox" BackgroundImage="*Resource*/images/light/search_box_bg.png" />
   <ViewStyle x:Key="SelectAllBg" BackgroundImage="*Resource*/images/light/selectall_bg.png" />
+  <ViewStyle x:Key="ListBackground" BackgroundImage="*Resource*/images/light/list_view_bg.png" />
+  <ViewStyle x:Key="PlayingListBackground" BackgroundImage="*Resource*/images/light/playing_list_bg.png" />
 
   <TextFieldStyle x:Key="TextField" TextColor ="#001447" />
 
@@ -183,11 +185,11 @@ Id="LightTheme">
     </c:ButtonStyle.Text>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="TextButton" Size="260, 64" IsSelectable="false" BackgroundColor="Transparent" >
+  <c:ButtonStyle x:Key="TextButton" Size="260, 64" BackgroundColor="Transparent" >
     <c:ButtonStyle.Text>
       <TextLabelStyle FontFamily="BreezeSans" PixelSize="28">
         <TextLabelStyle.TextColor>
-          <Selector x:TypeArguments="Color" Normal="#000C2B" Selected="#1473E6" Disabled="#B2B7BE" />
+          <Selector x:TypeArguments="Color" Normal="#000C2B" Pressed="#1473E6" Disabled="#B2B7BE" />
         </TextLabelStyle.TextColor>
       </TextLabelStyle>
     </c:ButtonStyle.Text>
@@ -213,11 +215,38 @@ Id="LightTheme">
 
   <c:TabStyle x:Key="Tabs" BackgroundColor="White">
     <c:TabStyle.Text>
-      <TextLabelStyle TextColor="#000C2B" FontFamily="BreezeSans" PixelSize="28"/>
+      <TextLabelStyle TextColor="#000C2B" ThemeChangeSensitive="true" FontFamily="BreezeSans" PixelSize="28"/>
     </c:TabStyle.Text>
     <c:TabStyle.UnderLine>
       <ViewStyle BackgroundColor="#0A0E4A" SizeHeight="8"/>
     </c:TabStyle.UnderLine>
   </c:TabStyle>
 
+  <c:ButtonStyle x:Key="SearchButton" Size="96, 60" IsSelectable="false" IsEnabled="true" BackgroundImage="*Resource*/images/light/search_button_bg.png">
+    <c:ButtonStyle.Icon>
+      <ImageViewStyle>
+        <ImageViewStyle.ResourceUrl>*Resource*/images/light/search_icon.png</ImageViewStyle.ResourceUrl>
+      </ImageViewStyle>
+    </c:ButtonStyle.Icon>
+  </c:ButtonStyle>
+
+  <c:DefaultLinearItemStyle x:Key="LinearItem" BackgroundColor="Transparent">
+    <c:DefaultLinearItemStyle.Label>
+      <TextLabelStyle TextColor="#001447" ThemeChangeSensitive="true" FontFamily="BreezeSans" PixelSize="32"/>
+    </c:DefaultLinearItemStyle.Label>
+  </c:DefaultLinearItemStyle>
+
+  <c:ButtonStyle x:Key="PlaylistCreate" BackgroundColor="Transparent" >
+    <c:ButtonStyle.Text>
+      <TextLabelStyle FontFamily="BreezeSans" PixelSize="32" Text="+ Create new playlist">
+        <TextLabelStyle.TextColor>
+          <Selector x:TypeArguments="Color" Normal="#001447" Pressed="#1473E6" Disabled="#C3CAD2" />
+        </TextLabelStyle.TextColor>
+      </TextLabelStyle>
+    </c:ButtonStyle.Text>
+  </c:ButtonStyle>
+
+  <TextLabelStyle x:Key="DetailTitle" Position="0, 16" Size="1664, 108" TextColor="#001447" FontFamily="BreezeSans" PixelSize="32"/>
+  <TextLabelStyle x:Key="DetailSubTitle" Position="0, 56" Size="1664, 108" TextColor="#001447" FontFamily="BreezeSans" PixelSize="28"/>
+
 </Theme>
\ No newline at end of file