From: Mobaswirul Islam/NC eXperience Group /SRBD/Engineer/Samsung Electronics Date: Tue, 20 Aug 2024 12:24:11 +0000 (+0600) Subject: Fixed window cut issue of PlayerView X-Git-Tag: accepted/tizen/unified/x/20240923.124445~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F316382%2F1;p=profile%2Fiot%2Fapps%2Fdotnet%2Fmusic-player.git Fixed window cut issue of PlayerView [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 --- diff --git a/music-player/Views/PlayerView.cs b/music-player/Views/PlayerView.cs index 7815942..1cab4b3 100755 --- a/music-player/Views/PlayerView.cs +++ b/music-player/Views/PlayerView.cs @@ -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() diff --git a/packaging/org.tizen.MusicPlayer-1.0.1.tpk b/packaging/org.tizen.MusicPlayer-1.0.1.tpk index 5b9a082..7645f40 100644 Binary files a/packaging/org.tizen.MusicPlayer-1.0.1.tpk and b/packaging/org.tizen.MusicPlayer-1.0.1.tpk differ