1. Fixed click issue of Play/Pause Icon 18/271718/3
authorshivamv <shivam.v2@samsung.com>
Fri, 25 Feb 2022 08:56:06 +0000 (14:26 +0530)
committershivamv <shivam.v2@samsung.com>
Fri, 25 Feb 2022 10:02:14 +0000 (15:32 +0530)
2. Fixed Favorite List Updation Issue
3. Added scalable UI featues to PlaylistSelectorView

Change-Id: Ib70c7a54220fd464b5e1b750da965798273af728
Signed-off-by: shivamv <shivam.v2@samsung.com>
13 files changed:
music-player/ViewModels/PlaylistDetailViewModel.cs
music-player/ViewModels/TrackViewModel.cs
music-player/Views/ListItemLayout.cs
music-player/Views/LyricsView.cs
music-player/Views/PlaylistDetailView.cs
music-player/Views/PlaylistSelectorView.cs
music-player/Views/PlaylistView.cs
music-player/Views/SelectListLayout.cs
music-player/Views/Utils/ErrorPopup.cs
music-player/music-player.csproj
music-player/res/themes/dark.xaml
music-player/res/themes/light.xaml
packaging/org.tizen.MusicPlayer-1.0.0.tpk

index 4ce3281296abe6417768737429bfa2e24b0ea9c7..f07fc22259c7f8b404f6ad684a405c9a966a47a9 100755 (executable)
@@ -16,10 +16,10 @@ namespace MusicPlayer.ViewModels
             playlist = PlaylistManager.Instance.GetPlaylist(playlistId);
             PlaylistId = playlistId;
             PlaylistName = playlist.Name;
-            IsNotDefaultPlaylist = true;
+            IsDefaultPlaylist = false;
             if(PlaylistName == AppConstants.RecentlyAddedPlaylist || PlaylistName == AppConstants.FavouritePlaylist)
             {
-                IsNotDefaultPlaylist = false;
+                IsDefaultPlaylist = true;
             }
             listViewModel = new ListViewModel<Track>();
             UpdatePlaylistDetails();
@@ -73,12 +73,12 @@ namespace MusicPlayer.ViewModels
             }
         }
 
-        private bool isNotDefaultPlaylist;
+        private bool isDefaultPlaylist;
 
-        public bool IsNotDefaultPlaylist
+        public bool IsDefaultPlaylist
         {
-            get => isNotDefaultPlaylist;
-            set => isNotDefaultPlaylist = value;
+            get => isDefaultPlaylist;
+            set => isDefaultPlaylist = value;
         }
 
         public Track PlayingTrack { get; set; }
@@ -129,7 +129,7 @@ namespace MusicPlayer.ViewModels
         private void UpdatePlaylistDetails()
         {
             // This is required because we delete and recreate default playlists on every database change event
-            if(IsNotDefaultPlaylist)
+            if(IsDefaultPlaylist)
             {
                 Playlist updatedPlaylist = PlaylistManager.Instance.GetPlaylist(PlaylistName);
                 playlist = updatedPlaylist;
@@ -155,6 +155,7 @@ namespace MusicPlayer.ViewModels
                 {
                     if (oldTrackId == item.Id)
                     {
+                        item.PlayingStatus = false;
                         item.IsPlaying = false;
                     }
                     if (currentTrackId == item.Id)
index 39eb881820c73798c83135101d7b7ec6eac8af8f..24690378735257e96b1a6bb090cb1b45a82e63d0 100755 (executable)
@@ -95,6 +95,7 @@ namespace MusicPlayer.ViewModels
         {\r
             if (PlayingTrack != null)\r
             {\r
+                PlayingTrack.PlayingStatus = false;\r
                 PlayingTrack.IsPlaying = false;\r
             }\r
             PlayingTrack = null;\r
index 584248408c5dce6852c9f4a2b210f7f72739b179..e94d88678322a41538472e927bd3b85455838de9 100755 (executable)
@@ -296,8 +296,12 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus);
                 {\r
                     ResourceUrl = Resources.GetImagePath() + "play_icon.png",\r
                 },\r
+                IsEnabled = true,\r
+                IsSelectable = true,\r
             };\r
             playPauseIcon = new Button(buttonStyle);\r
+            playPauseIcon.WidthSpecification = IconSize;\r
+            playPauseIcon.HeightSpecification = IconSize;\r
             playPauseIcon.Clicked += (object sender, ClickedEventArgs e) =>\r
             {\r
                 PlaybackHelper.Instance.ChangePlayingStatus();\r
index 7ecf43a47351ba407e54ce088104de8851b3453c..af95a05f67eee4a522dcb3139520ec3c7ed5e110 100755 (executable)
@@ -26,7 +26,7 @@ namespace MusicPlayer.Views
         {
             this.lyricsViewModel = lyricsViewModel;
             BindingContext = lyricsViewModel.lyricsModel;
-            Size2D = new Size2D(ViewSize, ViewSize);
+            Size2D = new Size2D(ViewSize, ViewSize).DpToPx();
             isAnimating = false;
             AddThumbnail();
             AddLyricsView();
@@ -108,8 +108,8 @@ namespace MusicPlayer.Views
         {
             scrollView = new ScrollableBase()
             {
-                Position2D = new Position2D(LyricsViewMargin, LyricsViewMargin),
-                Size2D = new Size2D(LyricsViewSize, LyricsViewSize),
+                Position2D = new Position2D(LyricsViewMargin, LyricsViewMargin).DpToPx(),
+                Size2D = new Size2D(LyricsViewSize, LyricsViewSize).DpToPx(),
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 BackgroundColor = Color.Transparent,
             };
@@ -123,7 +123,7 @@ namespace MusicPlayer.Views
                 TextColor = Color.White,
                 MultiLine = true,
                 LineWrapMode = LineWrapMode.Word,
-                PointSize = 25.0f,
+                PointSize = 25.DpToPx(),
                 HorizontalAlignment = HorizontalAlignment.Center,
             };
             lyricsLabel.BindingContext = lyricsViewModel.lyricsModel;
index aa84874f5d7216becd4b84a6d9e2d61de6062bf0..e2f3bd5dac94ef7389742c5d4425fba081287cb8 100755 (executable)
@@ -70,7 +70,7 @@ namespace MusicPlayer.Views
                 share.Clicked += OnShareClick;
                 menuItemList.Add(share);
             }
-            if (viewModel.IsNotDefaultPlaylist)
+            if (viewModel.IsDefaultPlaylist == false)
             {
                 var add = new MenuItem { Text = "Add" };
                 add.Clicked += OnAddClick;
index cd29472a619692d11d9b4c9a6110261521573e97..c954f3e7e28cfd4eb39994012e382f98ba78cfd4 100755 (executable)
@@ -49,12 +49,12 @@ namespace MusicPlayer.Views
             AddSelectPlaylistCancelButton();
             selectPlaylistDialog = new AlertDialog()
             {
-                Size2D = new Size2D(1184, 660).DpToPx(),
+                Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 660).DpToPx(),
                 Title = "Add to playlist",
                 Content = selectPlaylistContentArea,
                 Actions = new List<View> { selectPlaylistCancelButton },
                 Padding = new Extents(0, 0, 0, 0).DpToPx(),
-                Margin = new Extents(0, 0, 0, 0).DpToPx(),
+                Margin = new Extents(32, 32, 0, 0).DpToPx(),
             };
             TextLabel textLabel = (TextLabel)selectPlaylistDialog.TitleContent;
             textLabel.FontStyle = UIFontStyles.AllNormal;
@@ -97,7 +97,7 @@ namespace MusicPlayer.Views
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = 108.DpToPx(),
                 TextAlignment = HorizontalAlignment.Begin,
-                Padding = new Extents(64, 64, 0, 0).DpToPx(),
+                Padding = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(),
                 IsEnabled = true,
                 IsSelectable = false,
                 ItemAlignment = LinearLayout.Alignment.CenterVertical,
@@ -111,7 +111,7 @@ namespace MusicPlayer.Views
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = 2.DpToPx(),
                 BackgroundColor = UIColors.ItemSeperator,
-                Margin = new Extents(64, 64, 0, 0).DpToPx(),
+                Margin = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(),
             };
             selectPlaylistContentArea.Add(itemSeperator);
             createNewPlaylistButton.Clicked += CreateNewPlaylistButtonClicked;
@@ -124,12 +124,12 @@ namespace MusicPlayer.Views
             AddCreatePlaylistButtons();
             createPlaylistDialog = new AlertDialog()
             {
-                Size2D = new Size2D(1184, 465).DpToPx(),
+                Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 465).DpToPx(),
                 Title = "Create playlist",
                 Content = createPlaylistContentArea,
                 Actions = new List<View> { createPlaylistCancelButton, createPlaylistCreateButton },
                 Padding = new Extents(0, 0, 0, 0).DpToPx(),
-                Margin = new Extents(0, 0, 0, 0).DpToPx(),
+                Margin = new Extents(32, 32, 0, 0).DpToPx(),
             };
             TextLabel textLabel = (TextLabel)selectPlaylistDialog.TitleContent;
             textLabel.FontStyle = UIFontStyles.AllNormal;
@@ -148,7 +148,7 @@ namespace MusicPlayer.Views
             {
                 ThemeChangeSensitive = true,
                 StyleName = "ListBackground",
-                Size2D = new Size2D(1184, 108).DpToPx(),
+                Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 108).DpToPx(),
                 ItemsLayouter = new LinearLayouter(),
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 HeightSpecification = LayoutParamPolicies.WrapContent,
@@ -231,7 +231,7 @@ namespace MusicPlayer.Views
                 VerticalAlignment = VerticalAlignment.Center,
                 FontFamily = "BreezeSans",
                 FontStyle = UIFontStyles.NormalLight,
-                Padding = new Extents(64, 64, 0, 0).DpToPx(),
+                Padding = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(),
             };
             selectPlaylistContentArea.Add(noListText);
         }
@@ -271,12 +271,12 @@ namespace MusicPlayer.Views
                     Direction = FlexLayout.FlexDirection.Column,
                     ItemsAlignment = FlexLayout.AlignmentType.FlexStart,
                     Justification = FlexLayout.FlexJustification.FlexStart,
-                    Padding = new Extents(64, 64, 0, 0).DpToPx(),
+                    Padding = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(),
                 },
             };
             TextLabel textLabel = new TextLabel()
             {
-                StyleName = "ItemLabel",
+                StyleName = "TitleText",
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 HeightSpecification = 40.DpToPx(),
@@ -317,7 +317,7 @@ namespace MusicPlayer.Views
         {
             inputArea = new View()
             {
-                Size2D = new Size2D(1024, 48).DpToPx(),
+                Size2D = new Size2D((DeviceInfo.IsPortrait ? 856 : 1024), 48).DpToPx(),
                 Layout = new FlexLayout()
                 {
                     Direction = FlexLayout.FlexDirection.Row,
@@ -330,9 +330,9 @@ namespace MusicPlayer.Views
                 ThemeChangeSensitive = true,
                 StyleName = "TextField",
                 PixelSize = 32.DpToPx(),
-                Size2D = new Size2D(928, 48).DpToPx(),
+                Size2D = new Size2D((DeviceInfo.IsPortrait ? 808 : 928), 48).DpToPx(),
                 Position2D = new Position2D(0, 0).DpToPx(),
-                Margin = new Extents(0, 48, 0, 0).DpToPx(),
+                Margin = new Extents(0, (ushort)(DeviceInfo.IsPortrait ? 0 : 48), 0, 0).DpToPx(),
                 FontStyle = UIFontStyles.NormalLight,
                 MaxLength = 65,
             };
@@ -342,7 +342,7 @@ namespace MusicPlayer.Views
             crossButton = new Button("ClearButton")
             {
                 ThemeChangeSensitive = true,
-                Position2D = new Position2D(976, 6).DpToPx(),
+                Position2D = new Position2D((DeviceInfo.IsPortrait ? 808 : 976), 6).DpToPx(),
             };
             crossButton.Clicked += (object o, ClickedEventArgs e) =>
             {
index b4657cdd7c0a7236ed5003021e442cd3f412e354..504423ed510f3bc4f766610a93d1cb7ddc9c6986 100755 (executable)
@@ -267,7 +267,7 @@ namespace MusicPlayer.Views
             {
                 Name = "InputLineView",
                 StyleName = "InputLine",
-                HeightSpecification = 2,
+                HeightSpecification = 2.DpToPx(),
                 WidthSpecification = LayoutParamPolicies.MatchParent,
             };
             return view;
index c76adabdcc7a121e4bc092d61cda2bff0f1f894e..c83fb9fceb7c308107b56a00e6acf9c8dc99f45e 100755 (executable)
@@ -35,12 +35,6 @@ namespace MusicPlayer.Views
             // to show the rounded rect of the bg
             BackgroundColor = Color.Transparent;
 
-            StringSelector iconURL = new StringSelector()
-            {
-                Disabled = Resources.GetImagePath() + "check_off.png",
-                DisabledSelected = Resources.GetImagePath() + "check_on.png",
-            };
-
             checkBox = new CheckBox("CheckBox")
             {
                 Position2D = new Position2D(x, BoxSize).DpToPx(),
index 4858578329ef736e43ba4e3a313100e455a59943..846bf4213f3b3f08449fea7fc3c0f9308ba4f444 100755 (executable)
@@ -15,10 +15,11 @@ namespace MusicPlayer.Views.Utils
             AddOkButton();
             errorDialog = new AlertDialog()
             {
-                Size2D = new Size2D(1184, 368),
+                Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 368).DpToPx(),
                 Title = "Unable to play track",
                 Message = "",
                 Actions = new List<View> { okButton },
+                Margin = new Extents(32, 32, 0, 0).DpToPx(),
             };
 
             TextLabel textLabel = (TextLabel)errorDialog.TitleContent;
index 4929997004f46df5e7020d6690b9f0dd350bd964..55b1c15b99b43dec5e2e8a87df23d6552faebc20 100755 (executable)
@@ -19,7 +19,7 @@
   </ItemGroup>\r
 \r
   <ItemGroup>\r
-    <PackageReference Include="Tizen.NET" Version="10.0.0.16872">\r
+    <PackageReference Include="Tizen.NET" Version="10.0.0.16997">\r
       <ExcludeAssets>Runtime</ExcludeAssets>\r
     </PackageReference>\r
     <PackageReference Include="Tizen.NET.Sdk" Version="1.1.7" />\r
index c10e78b7c9b1e7a79ddce41ba2fa35a2c81fe071..0b0213c6a5765140556f8907d8bf35e366554c19 100755 (executable)
@@ -188,7 +188,7 @@ Id="DarkTheme">
 
   <c:ButtonStyle x:Key="TextButton" Size="260dp, 64dp" BackgroundColor="Transparent" >
     <c:ButtonStyle.Text>
-      <TextLabelStyle FontFamily="BreezeSans" PixelSize="28dp">
+      <TextLabelStyle FontFamily="BreezeSans" PixelSize="28dp" VerticalAlignment ="Center" >
         <TextLabelStyle.TextColor>
           <Selector x:TypeArguments="Color" Normal="#FFFFFF" Pressed="#1473E6" Disabled="#B2B7BE" />
         </TextLabelStyle.TextColor>
index 893046b222f4f58d3e1a40449f0d2e21b86e3103..5e2440877808ad3c7b4cce20dc4445682e2eb289 100755 (executable)
@@ -188,7 +188,7 @@ Id="LightTheme">
 
   <c:ButtonStyle x:Key="TextButton" Size="260dp, 64dp" BackgroundColor="Transparent" >
     <c:ButtonStyle.Text>
-      <TextLabelStyle FontFamily="BreezeSans" PixelSize="28dp">
+      <TextLabelStyle FontFamily="BreezeSans" PixelSize="28dp" VerticalAlignment ="Center" >
         <TextLabelStyle.TextColor>
           <Selector x:TypeArguments="Color" Normal="#000C2B" Pressed="#1473E6" Disabled="#B2B7BE" />
         </TextLabelStyle.TextColor>
index 9105d9b156ea8ac873622a9936ffc1a15602bf54..ab90b7469f21aceacc938057f6b825220db79126 100755 (executable)
Binary files a/packaging/org.tizen.MusicPlayer-1.0.0.tpk and b/packaging/org.tizen.MusicPlayer-1.0.0.tpk differ