Fixed window cut issue of PlayerView 82/316382/1
authorMobaswirul Islam/NC eXperience Group /SRBD/Engineer/Samsung Electronics <mobaswirul.i@samsung.com>
Tue, 20 Aug 2024 12:24:11 +0000 (18:24 +0600)
committerMobaswirul Islam/NC eXperience Group /SRBD/Engineer/Samsung Electronics <mobaswirul.i@samsung.com>
Tue, 20 Aug 2024 12:24:11 +0000 (18:24 +0600)
[Problem] [TNINE-4170] Some part of the ongoing music playing window is out of display

[Cause & Measure]
 Cause   : Using Linear Layout with fixed padding.
 Measure : Used FlexLayout with SpaceBetween Justification Property.

Change-Id: I509556f78f0b579f1f234bd86b967bb9d2b562ac
Signed-off-by: Mobaswirul Islam/NC eXperience Group /SRBD/Engineer/Samsung Electronics <mobaswirul.i@samsung.com>
music-player/Views/PlayerView.cs
packaging/org.tizen.MusicPlayer-1.0.1.tpk

index 7815942e6baaf62159fee8deb6429276bd23523b..1cab4b320e680b8d04fd4e7c7692d577323b38ec 100755 (executable)
@@ -31,6 +31,8 @@ namespace MusicPlayer.Views
         private Button moreButton;
 
         private View controlsView;
+        private View controlsTop;
+        private View controlsBottom;
         private View sliderView;
         private View playbackButtonsView;
         private MultiStateButton playButton;
@@ -69,6 +71,7 @@ namespace MusicPlayer.Views
             StyleName = "AppBackground";
             WidthResizePolicy = ResizePolicyType.FillToParent;
             HeightResizePolicy = ResizePolicyType.FillToParent;
+            BackgroundColor = Color.Transparent;
             AddPlayerBackground();
             AddRightViewBackground();
             playerContentView = new View()
@@ -434,14 +437,15 @@ namespace MusicPlayer.Views
         {
             controlsView = new View()
             {
-                WidthSpecification = ModifySize(640).SpToPx(),
-                HeightSpecification = ModifySize(400).SpToPx(),
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                HeightResizePolicy = ResizePolicyType.FillToParent,
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
                     Margin = new Extents(0, 0, (ushort)ModifySize(40), 0).SpToPx(),
                 }
             };
+
             rightView.Add(controlsView);
             AddControlElements();
             rightView.BindingContextChanged += OnControlsViewContextChanged;
@@ -482,7 +486,7 @@ namespace MusicPlayer.Views
                 VerticalAlignment = VerticalAlignment.Center,
                 Ellipsis = true,
             };
-            controlsView.Add(titleLabel);
+            controlsTop.Add(titleLabel);
             titleLabel.SetBinding(TextLabel.TextProperty, "TrackName");
         }
 
@@ -500,14 +504,26 @@ namespace MusicPlayer.Views
                 VerticalAlignment = VerticalAlignment.Center,
                 Ellipsis = true,
             };
-            controlsView.Add(artistLabel);
+            controlsTop.Add(artistLabel);
             artistLabel.SetBinding(TextLabel.TextProperty, "TrackArtist");
         }
 
         private void AddTextControlElements()
         {
+            controlsTop = new View()
+            {
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                HeightResizePolicy = ResizePolicyType.FillToParent,
+                SizeModeFactor = new Vector3(0.6f, 0.6f, 0.6f),
+                Layout = new LinearLayout
+                {
+                    LinearOrientation = LinearLayout.Orientation.Vertical,
+                    VerticalAlignment = VerticalAlignment.Center,
+                },
+            };
             AddTitleLabel();
             AddArtistLabel();
+            controlsView.Add(controlsTop);
         }
 
         private void AddShuffleButton()
@@ -759,18 +775,17 @@ namespace MusicPlayer.Views
         {
             playbackButtonsView = new View()
             {
-                WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = ModifySize(48).SpToPx(),
-                Layout = new LinearLayout()
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                MaximumSize = new Size2D(600, 80).SpToPx(),
+                HeightSpecification = ModifySize(80).SpToPx(),
+                Layout = new FlexLayout()
                 {
-                    LinearOrientation = LinearLayout.Orientation.Horizontal,
-                    HorizontalAlignment = HorizontalAlignment.Begin,
-                    VerticalAlignment = VerticalAlignment.Center,
-                    Margin = new Extents(0, 0, (ushort)ModifySize(100), (ushort)ModifySize(92)).SpToPx(),
-                    CellPadding = new Size2D(ModifySize(80), 0).SpToPx(),
-                },
+                    Direction = FlexLayout.FlexDirection.Row,
+                    Justification = FlexLayout.FlexJustification.SpaceBetween,
+                    Alignment = FlexLayout.AlignmentType.FlexEnd,
+                }
             };
-            controlsView.Add(playbackButtonsView);
+            controlsBottom.Add(playbackButtonsView);
             AddShuffleButton();
             AddPreviousButton();
             AddPlayButton();
@@ -823,7 +838,8 @@ namespace MusicPlayer.Views
             volumeSlider = new Slider("Slider")
             {
                 ThemeChangeSensitive = true,
-                Size2D = new Size2D(ModifySize(496), ModifySize(48)).SpToPx(),
+                SizeHeight = ModifySize(48).SpToPx(),
+                WidthResizePolicy = ResizePolicyType.FillToParent,
                 ThumbSize = new Tizen.NUI.Size(ModifySize(36), ModifySize(36)).SpToPx(),
                 Direction = Slider.DirectionType.Horizontal,
                 MinValue = 0,
@@ -850,7 +866,7 @@ namespace MusicPlayer.Views
                     VerticalAlignment = VerticalAlignment.Center,
                 },
             };
-            controlsView.Add(volumeSliderView);
+            controlsBottom.Add(volumeSliderView);
             AddLeftVolumeIcon();
             AddVolumeSlider();
             AddRightVolumeIcon();
@@ -859,8 +875,18 @@ namespace MusicPlayer.Views
         private void AddControlElements()
         {
             AddTextControlElements();
+            controlsBottom = new View()
+            {
+                WidthResizePolicy = ResizePolicyType.FillToParent,
+                SizeHeight = 150.SpToPx(),
+                Layout = new LinearLayout()
+                {
+                    LinearOrientation = LinearLayout.Orientation.Vertical,
+                }
+            };
             AddButtonControlElements();
             AddVolumeSliderElements();
+            controlsView.Add(controlsBottom);
         }
 
         private void AddPlaybackSliderEventHandler()
index 5b9a08270024ed4d327411adb45256361451e576..7645f40b5b5aef5c0f27ec81c94c21ae287aa96b 100644 (file)
Binary files a/packaging/org.tizen.MusicPlayer-1.0.1.tpk and b/packaging/org.tizen.MusicPlayer-1.0.1.tpk differ