Fixed MiniPlayer Layout for HD resolution 01/274801/1 submit/tizen/20220509.161301
authorShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Mon, 9 May 2022 15:57:26 +0000 (21:27 +0530)
committerShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Mon, 9 May 2022 15:57:26 +0000 (21:27 +0530)
Change-Id: I1f58fa2dab7c2b41dd69e0ac26399667cc54053b
Signed-off-by: Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
music-player/Views/MiniPlayer.cs
music-player/music-player.csproj
packaging/org.tizen.MusicPlayer-1.0.0.tpk

index 3c3344972442e1dbff5f4c5469e4b09f62ace618..4c597ff81ff2e0580cd46aff95f88baafce0e0c4 100755 (executable)
@@ -19,6 +19,7 @@ namespace MusicPlayer.Views
         private TextLabel titleLabel;
         private TextLabel artistLabel;
 
+        private View leftView;
         private View controlsView;
         private View sliderView;
         private MultiStateButton playButton;
@@ -58,10 +59,11 @@ namespace MusicPlayer.Views
             };
             if(DeviceInfo.IsPortrait)
             {
-                baseView.Padding = new Extents(33, 33, 24, 8).SpToPx();
+                baseView.Padding = new Extents(32, 32, 24, 8).SpToPx();
                 baseView.HeightSpecification = 108.SpToPx();
             }
             Add(baseView);
+            AddLeftView();
             AddTrackDetails();
             AddControlElements();
             AddSliderElements();
@@ -78,19 +80,35 @@ namespace MusicPlayer.Views
             Add(separator);
         }
 
+        private void AddLeftView()
+        {
+            leftView = new View()
+            {
+                Layout = new LinearLayout()
+                {
+                    LinearOrientation = LinearLayout.Orientation.Horizontal,
+                    VerticalAlignment = VerticalAlignment.Center,
+                },
+                BackgroundColor = Color.Transparent,
+                HeightSpecification = 76.SpToPx(),
+                WidthSpecification = DeviceInfo.IsPortrait ? Window.Instance.Size.Width - 64 : (int)((Window.Instance.Size.Width - 128) * 0.65f),
+            };
+            baseView.Add(leftView);
+        }
+
         private void AddTrackDetails()
         {
             trackInfo = new View()
             {
+                HeightSpecification = LayoutParamPolicies.MatchParent,
+                WidthSpecification = (int)(leftView.SizeWidth * 0.6),
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Horizontal,
                 },
                 BackgroundColor = Color.Transparent,
             };
-            trackInfo.WidthSpecification = (DeviceInfo.IsPortrait ? 536 : 622).SpToPx();
-            trackInfo.HeightSpecification = 76.SpToPx();
-            baseView.Add(trackInfo);
+            leftView.Add(trackInfo);
             AddThumbnail();
             AddTrackTextLabels();
         }
@@ -105,17 +123,9 @@ namespace MusicPlayer.Views
                     LinearOrientation = LinearLayout.Orientation.Vertical,
                 },
                 HeightSpecification = 76.SpToPx(),
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                Margin = (DeviceInfo.IsPortrait ? new Extents(24, 0, 0, 0) : new Extents(30, 0, 0, 0)).SpToPx(),
             };
-            if(DeviceInfo.IsPortrait)
-            {
-                trackTextView.WidthSpecification = 436.SpToPx();
-                trackTextView.Margin = new Extents(24, 0, 0, 0);
-            }
-            else
-            {
-                trackTextView.WidthSpecification = 516.SpToPx();
-                trackTextView.Margin = new Extents(30, 0, 0, 0);
-            }
             trackInfo.Add(trackTextView);
             AddTrackName();
             AddArtistName();
@@ -176,18 +186,18 @@ namespace MusicPlayer.Views
         {
             controlsView = new View()
             {
-                WidthSpecification = 304.SpToPx(),
+                WidthSpecification = (int)(leftView.SizeWidth * 0.4),
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Horizontal,
-                    HorizontalAlignment = HorizontalAlignment.Begin,
+                    HorizontalAlignment = HorizontalAlignment.Center,
                     VerticalAlignment = VerticalAlignment.Center,
-                    CellPadding = new Size2D(80, 0).SpToPx(),
+                    CellPadding = (DeviceInfo.IsPortrait ? new Size2D(20, 0) : new Size2D(50, 0)).SpToPx(),
                 },
-                Margin = new Extents(120, 120, 0, 0).SpToPx(),
+                Margin = new Extents(10, 10, 0, 0).SpToPx(),
                 BackgroundColor = Color.Transparent,
             };
-            baseView.Add(controlsView);
+            leftView.Add(controlsView);
             AddPreviousButton();
             AddPlayButton();
             AddNextButton();
@@ -308,10 +318,10 @@ namespace MusicPlayer.Views
                     Padding = new Extents(33, 33, 0, 8).SpToPx(),
                 };
                 sliderView.SizeHeight = 61.SpToPx();
-                base.Add(sliderView);
+                Add(sliderView);
                 currentTime.WidthSpecification = 72.SpToPx();
                 sliderView.Add(currentTime);
-                playbackSlider.WidthSpecification = 872.SpToPx();
+                playbackSlider.WidthSpecification = Window.Instance.Size.Width - 208.SpToPx();
                 sliderView.Add(playbackSlider);
                 totalTime.WidthSpecification = 72.SpToPx();
                 sliderView.Add(totalTime);
@@ -353,9 +363,9 @@ namespace MusicPlayer.Views
                 ThemeChangeSensitive = true,
                 MinValue = 0.0f,
                 MaxValue = 1.0f,
-                WidthSpecification = 626.SpToPx(),
+                WidthSpecification = (int)((Window.Instance.Size.Width - 128) * 0.35),
                 HeightSpecification = SliderHeight.SpToPx(),
-                ThumbSize = new Tizen.NUI.Size(30, 30).SpToPx(),
+                ThumbSize = new Size(30, 30).SpToPx(),
                 Direction = Slider.DirectionType.Horizontal,
             };
             playbackSlider.SetBinding(Slider.CurrentValueProperty, "ElapsedTime");
index 800fd7ba9a11533f60ddc25ed7239f4286f8581d..bc2f29ff4e41f0e0c8562374516dd402317e06db 100755 (executable)
@@ -20,7 +20,7 @@
 \r
   <ItemGroup>\r
     <PackageReference Include="Tizen.NET" Version="10.0.0.17173" />\r
-    <PackageReference Include="Tizen.NET.Sdk" Version="1.1.7" />\r
+    <PackageReference Include="Tizen.NET.Sdk" Version="1.1.8" />\r
   </ItemGroup>\r
 \r
 </Project>\r
index 7cb082ccf3005bbe49e25b248d98a2c51fd059ea..4ba9244ab1fa4fde4c44f8a5b391126d1cfa602d 100755 (executable)
Binary files a/packaging/org.tizen.MusicPlayer-1.0.0.tpk and b/packaging/org.tizen.MusicPlayer-1.0.0.tpk differ