Fixed PlayerView Layout for HD resolution, SearchView crash 86/274986/2 accepted/tizen/unified/20220524.050345 submit/tizen/20220513.103126
authorShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Fri, 13 May 2022 04:57:04 +0000 (10:27 +0530)
committerShivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
Fri, 13 May 2022 09:58:08 +0000 (15:28 +0530)
Change-Id: Ic886d0f8572ad016694ca4ae987fc49041ec1947
Signed-off-by: Shivam Varshney/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics <shivam.v2@samsung.com>
music-player/Views/AlbumDetailView.cs
music-player/Views/LyricsView.cs
music-player/Views/PlayerView.cs
music-player/Views/SearchView.cs
music-player/res/themes/dark.xaml
music-player/res/themes/light.xaml
packaging/org.tizen.MusicPlayer-1.0.0.tpk

index 50dc5ba100fd7764e675f3cfd22cc4a5e653be1d..b336977ee9d361c81f5b98553b185dda5ebe2c05 100755 (executable)
@@ -10,8 +10,6 @@ namespace MusicPlayer.Views
 {\r
     class AlbumDetailView : BaseSubContentView\r
     {\r
-        private const int AlbumArtSize = 520;\r
-\r
         private View albumInfoView;\r
         private ImageView albumArtIcon;\r
         private TextLabel albumNameLabel;\r
@@ -143,10 +141,11 @@ namespace MusicPlayer.Views
 \r
         private void AddAlbumArt()\r
         {\r
+            int albumArtSize = (int)((DeviceInfo.IsPortrait ? Window.Instance.Size.Height : Window.Instance.Size.Width) * 0.27f);\r
             albumArtIcon = new ImageView()\r
             {\r
                 BackgroundColor = UIColors.HEXEEEFF1,\r
-                Size2D = new Size2D(AlbumArtSize, AlbumArtSize).SpToPx(),\r
+                Size2D = new Size2D(albumArtSize, albumArtSize),\r
             };\r
             albumArtIcon.BindingContext = viewModel;\r
             albumArtIcon.SetBinding(ImageView.ResourceUrlProperty, "AlbumArtPath");\r
index 091192b207c70248d6ca859458273cc3f727cc70..c48653685d42860ed9588f6551a1ed4bf832dc62 100755 (executable)
@@ -10,9 +10,6 @@ namespace MusicPlayer.Views
 {
     class LyricsView : View
     {
-        private const int ViewSize = 784;
-        private const int LyricsViewMargin = 40;
-        private const int LyricsViewSize = 704;
 
         private readonly LyricsViewModel lyricsViewModel;
 
@@ -27,8 +24,8 @@ namespace MusicPlayer.Views
         {
             this.lyricsViewModel = lyricsViewModel;
             BindingContext = lyricsViewModel.lyricsModel;
-            WidthSpecification = 784.SpToPx();
-            HeightSpecification = 784.SpToPx();
+            WidthSpecification = (int)((DeviceInfo.IsPortrait ? Window.Instance.Size.Height : Window.Instance.Size.Width) * 0.4f);
+            HeightSpecification = WidthSpecification;
             Layout = new FlexLayout()
             {
                 Direction = FlexLayout.FlexDirection.Column,
index 4563ac70a2f186d973fbba4cf94936e7ac565b9a..044075daafb0640a5fafa6ea25ea6a5a4d3fe086 100755 (executable)
@@ -19,10 +19,6 @@ namespace MusicPlayer.Views
             TrackList,
         }
         private const int IconButtonSize = 48;
-        private const int ControlViewHeightLandscape = 386;
-        private const int ControlViewHeightPortrait = 438;
-        private const int TitleLabelHeight = 48;
-        private const int ArtistLabelHeight = 36;
 
         private View playerBackgroundView;
         private View playerContentView;
@@ -85,7 +81,7 @@ namespace MusicPlayer.Views
                     Direction = FlexLayout.FlexDirection.Column,
                     Justification = FlexLayout.FlexJustification.FlexStart,
                     ItemsAlignment = FlexLayout.AlignmentType.Center,
-                    Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(),
+                    Padding = (DeviceInfo.IsPortrait ? new Extents((ushort)ModifySize(32), (ushort)ModifySize(32), 0, 0) : new Extents((ushort)ModifySize(64), (ushort)ModifySize(64), 0, 0)).SpToPx(),
                 },
             };
             Add(playerContentView);
@@ -160,17 +156,17 @@ namespace MusicPlayer.Views
                 Weight = 0.5f,
             };
             contentView.Add(leftView);
-            if(DeviceInfo.IsPortrait)
+            if (DeviceInfo.IsPortrait)
             {
                 if (viewState == PlayerViewState.AlbumArt)
                 {
                     leftView.Add(topRightView);
-                    topRightView.HeightSpecification = 48.SpToPx();
+                    topRightView.HeightSpecification = ModifySize(48).SpToPx();
                 }
             }
             else
             {
-                leftView.Layout.Padding = (new Extents(0, 64, 0, 0)).SpToPx();
+                leftView.Layout.Padding = new Extents(0, (ushort)ModifySize(64), 0, 0).SpToPx();
             }
             AddLyricsView();
         }
@@ -193,7 +189,7 @@ namespace MusicPlayer.Views
             if (DeviceInfo.IsPortrait == false || viewState == PlayerViewState.TrackList)
             {
                 rightView.Add(topRightView);
-                topRightView.HeightSpecification = 200.SpToPx();
+                topRightView.HeightSpecification = ModifySize(200).SpToPx();
                 AddThumbnail();
             }
             AddControlView();
@@ -238,8 +234,8 @@ namespace MusicPlayer.Views
             {
                 Layout = new RelativeLayout(),
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 120.SpToPx(),
-                MaximumSize = new Size2D(Window.Instance.WindowSize.Width, (int)(Window.Instance.WindowSize.Height*0.111f))
+                HeightSpecification = ModifySize(120).SpToPx(),
+                MaximumSize = new Size2D(Window.Instance.WindowSize.Width, (int)(Window.Instance.WindowSize.Height * 0.111f))
             };
             playerContentView.Add(topView);
             FlexLayout.SetFlexGrow(topView, 0);
@@ -248,6 +244,10 @@ namespace MusicPlayer.Views
             {
                 ThemeChangeSensitive = true,
             };
+            backButton.SizeWidth = ModifySize(48).SpToPx();
+            backButton.SizeHeight = ModifySize(48).SpToPx();
+            backButton.Icon.SizeWidth = ModifySize(48).SpToPx();
+            backButton.Icon.SizeHeight = ModifySize(48).SpToPx();
             topView.Add(backButton);
             RelativeLayout.SetHorizontalAlignment(backButton, RelativeLayout.Alignment.Start);
             RelativeLayout.SetVerticalAlignment(backButton, RelativeLayout.Alignment.Center);
@@ -261,6 +261,10 @@ namespace MusicPlayer.Views
             {
                 ThemeChangeSensitive = true,
             };
+            moreButton.SizeWidth = ModifySize(48).SpToPx();
+            moreButton.SizeHeight = ModifySize(48).SpToPx();
+            moreButton.Icon.SizeWidth = ModifySize(48).SpToPx();
+            moreButton.Icon.SizeHeight = ModifySize(48).SpToPx();
             topView.Add(moreButton);
             RelativeLayout.SetLeftRelativeOffset(moreButton, 1.0f);
             RelativeLayout.SetRightRelativeOffset(moreButton, 1.0f);
@@ -429,12 +433,12 @@ namespace MusicPlayer.Views
         {
             controlsView = new View()
             {
-                WidthSpecification = 640.SpToPx(),
-                HeightSpecification = (DeviceInfo.IsPortrait ? ControlViewHeightPortrait : ControlViewHeightLandscape).SpToPx(),
+                WidthSpecification = ModifySize(640).SpToPx(),
+                HeightSpecification = ModifySize(400).SpToPx(),
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
-                    Margin = (new Extents(0, 0, 115, 0)).SpToPx(),
+                    Margin = new Extents(0, 0, (ushort)ModifySize(40), 0).SpToPx(),
                 }
             };
             rightView.Add(controlsView);
@@ -470,8 +474,8 @@ namespace MusicPlayer.Views
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = TitleLabelHeight.SpToPx(),
-                PixelSize = 36.SpToPx(),
+                HeightSpecification = ModifySize(48).SpToPx(),
+                PixelSize = ModifySize(36).SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
@@ -488,8 +492,8 @@ namespace MusicPlayer.Views
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = ArtistLabelHeight.SpToPx(),
-                PixelSize = 28.SpToPx(),
+                HeightSpecification = ModifySize(36).SpToPx(),
+                PixelSize = ModifySize(28).SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center,
@@ -509,9 +513,9 @@ namespace MusicPlayer.Views
         {
             shuffleButton = new MultiStateButton()
             {
-                Size2D = new Size2D(IconButtonSize, IconButtonSize).SpToPx(),
-                IconSize = new Tizen.NUI.Size(IconButtonSize, IconButtonSize).SpToPx(),
-                Margin = new Extents(0, 40, 0, 0).SpToPx(),
+                Size2D = new Size2D(ModifySize(IconButtonSize), ModifySize(IconButtonSize)).SpToPx(),
+                IconSize = new Tizen.NUI.Size(ModifySize(IconButtonSize), ModifySize(IconButtonSize)).SpToPx(),
+                Margin = new Extents(0, (ushort)ModifySize(40), 0, 0).SpToPx(),
                 IconResources = new Dictionary<ThemeType, Dictionary<string, StringSelector>>()
                 {
                     {
@@ -577,6 +581,10 @@ namespace MusicPlayer.Views
             {
                 viewModel.PrevButtonClicked();
             };
+            prevButton.SizeWidth = ModifySize(48).SpToPx();
+            prevButton.SizeHeight = ModifySize(48).SpToPx();
+            prevButton.Icon.SizeWidth = ModifySize(48).SpToPx();
+            prevButton.Icon.SizeHeight = ModifySize(48).SpToPx();
             playbackButtonsView.Add(prevButton);
             prevButton.BindingContext = viewModel;
             prevButton.SetBinding(IsEnabledProperty, "HasPreviousTrack");
@@ -586,8 +594,8 @@ namespace MusicPlayer.Views
         {
             playButton = new MultiStateButton()
             {
-                Size2D = new Size2D(IconButtonSize, IconButtonSize).SpToPx(),
-                IconSize = new Tizen.NUI.Size(IconButtonSize, IconButtonSize).SpToPx(),
+                Size2D = new Size2D(ModifySize(IconButtonSize), ModifySize(IconButtonSize)).SpToPx(),
+                IconSize = new Tizen.NUI.Size(ModifySize(IconButtonSize), ModifySize(IconButtonSize)).SpToPx(),
                 BackgroundColor = Color.Transparent,
                 IconResources = new Dictionary<ThemeType, Dictionary<string, StringSelector>>()
                 {
@@ -662,6 +670,10 @@ namespace MusicPlayer.Views
             {
                 viewModel.NextButtonClicked();
             };
+            nextButton.SizeWidth = ModifySize(48).SpToPx();
+            nextButton.SizeHeight = ModifySize(48).SpToPx();
+            nextButton.Icon.SizeWidth = ModifySize(48).SpToPx();
+            nextButton.Icon.SizeHeight = ModifySize(48).SpToPx();
             playbackButtonsView.Add(nextButton);
             nextButton.BindingContext = viewModel;
             nextButton.SetBinding(IsEnabledProperty, "HasNextTrack");
@@ -671,9 +683,9 @@ namespace MusicPlayer.Views
         {
             repeatButton = new MultiStateButton()
             {
-                Size2D = new Size2D(IconButtonSize, IconButtonSize).SpToPx(),
-                IconSize = new Tizen.NUI.Size(IconButtonSize, IconButtonSize).SpToPx(),
-                Margin = new Extents(40, 0, 0, 0).SpToPx(),
+                Size2D = new Size2D(ModifySize(IconButtonSize), ModifySize(IconButtonSize)).SpToPx(),
+                IconSize = new Tizen.NUI.Size(ModifySize(IconButtonSize), ModifySize(IconButtonSize)).SpToPx(),
+                Margin = new Extents((ushort)ModifySize(40), 0, 0, 0).SpToPx(),
                 IconResources = new Dictionary<ThemeType, Dictionary<string, StringSelector>>()
                 {
                     {
@@ -747,14 +759,14 @@ namespace MusicPlayer.Views
             playbackButtonsView = new View()
             {
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = ModifySize(48).SpToPx(),
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Horizontal,
                     HorizontalAlignment = HorizontalAlignment.Begin,
                     VerticalAlignment = VerticalAlignment.Center,
-                    Margin = (DeviceInfo.IsPortrait ? new Extents(0, 0, 140, 104) : new Extents(0, 0, 100, 92)).SpToPx(),
-                    CellPadding = new Size2D(80, 0).SpToPx(),
+                    Margin = new Extents(0, 0, (ushort)ModifySize(100), (ushort)ModifySize(92)).SpToPx(),
+                    CellPadding = new Size2D(ModifySize(80), 0).SpToPx(),
                 },
             };
             controlsView.Add(playbackButtonsView);
@@ -772,6 +784,8 @@ namespace MusicPlayer.Views
                 ThemeChangeSensitive = true,
                 StyleName = "LeftVolume",
             };
+            leftVolumeIcon.SizeWidth = ModifySize(48).SpToPx();
+            leftVolumeIcon.SizeHeight = ModifySize(48).SpToPx();
             volumeSliderView.Add(leftVolumeIcon);
         }
 
@@ -782,6 +796,8 @@ namespace MusicPlayer.Views
                 ThemeChangeSensitive = true,
                 StyleName = "RightVolume",
             };
+            rightVolumeIcon.SizeWidth = ModifySize(48).SpToPx();
+            rightVolumeIcon.SizeHeight = ModifySize(48).SpToPx();
             volumeSliderView.Add(rightVolumeIcon);
         }
 
@@ -806,8 +822,8 @@ namespace MusicPlayer.Views
             volumeSlider = new Slider("Slider")
             {
                 ThemeChangeSensitive = true,
-                Size2D = new Size2D(496, 48).SpToPx(),
-                ThumbSize = new Tizen.NUI.Size(36, 36).SpToPx(),
+                Size2D = new Size2D(ModifySize(496), ModifySize(48)).SpToPx(),
+                ThumbSize = new Tizen.NUI.Size(ModifySize(36), ModifySize(36)).SpToPx(),
                 Direction = Slider.DirectionType.Horizontal,
                 MinValue = 0,
                 MaxValue = AudioManager.VolumeController.MaxLevel[AudioVolumeType.Media],
@@ -824,10 +840,10 @@ namespace MusicPlayer.Views
             volumeSliderView = new View()
             {
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = ModifySize(48).SpToPx(),
                 Layout = new LinearLayout()
                 {
-                    CellPadding = (new Size2D(24, 0)).SpToPx(),
+                    CellPadding = new Size2D(ModifySize(24), 0).SpToPx(),
                     LinearOrientation = LinearLayout.Orientation.Horizontal,
                     HorizontalAlignment = HorizontalAlignment.Begin,
                     VerticalAlignment = VerticalAlignment.Center,
@@ -870,8 +886,8 @@ namespace MusicPlayer.Views
                 MinValue = 0.0f,
                 MaxValue = 1.0f,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 44.SpToPx(),
-                ThumbSize = new Tizen.NUI.Size(36, 36).SpToPx(),
+                HeightSpecification = ModifySize(44).SpToPx(),
+                ThumbSize = new Tizen.NUI.Size(ModifySize(36), ModifySize(36)).SpToPx(),
                 Direction = Slider.DirectionType.Horizontal,
             };
             sliderView.Add(playbackSlider);
@@ -885,8 +901,8 @@ namespace MusicPlayer.Views
             {
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
-                Size2D = new Size2D(400, 32).SpToPx(),
-                PixelSize = 24.SpToPx(),
+                Size2D = new Size2D(ModifySize(400), ModifySize(32)).SpToPx(),
+                PixelSize = ModifySize(24).SpToPx(),
                 FontFamily = "BreezeSans",
                 Text = "00::00:00",
                 HorizontalAlignment = HorizontalAlignment.Begin,
@@ -903,8 +919,8 @@ namespace MusicPlayer.Views
             {
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
-                Size2D = new Size2D(400, 32).SpToPx(),
-                PixelSize = 24.SpToPx(),
+                Size2D = new Size2D(ModifySize(400), ModifySize(32)).SpToPx(),
+                PixelSize = ModifySize(24).SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.End,
                 Text = "59:59:59",
@@ -920,7 +936,7 @@ namespace MusicPlayer.Views
             sliderView = new View()
             {
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 84.SpToPx(),
+                HeightSpecification = ModifySize(84).SpToPx(),
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
@@ -940,10 +956,10 @@ namespace MusicPlayer.Views
             playbackSliderTextView = new View()
             {
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 32.SpToPx(),
+                HeightSpecification = ModifySize(32).SpToPx(),
                 Layout = new RelativeLayout()
                 {
-                    Margin = (new Extents(0, 0, 8, 0)).SpToPx(),
+                    Margin = new Extents(0, 0, (ushort)ModifySize(8), 0).SpToPx(),
                 },
             };
             sliderView.Add(playbackSliderTextView);
@@ -962,12 +978,12 @@ namespace MusicPlayer.Views
                     LinearOrientation = LinearLayout.Orientation.Horizontal,
                     HorizontalAlignment = HorizontalAlignment.End,
                     VerticalAlignment = VerticalAlignment.Top,
-                    CellPadding = new Size2D(92, 0).SpToPx(),
+                    CellPadding = new Size2D(ModifySize(92), 0).SpToPx(),
                 },
             };
             if (DeviceInfo.IsPortrait)
             {
-                topRightView.Margin = new Extents(0, 46, 0, 0).SpToPx();
+                topRightView.Margin = new Extents(0, (ushort)ModifySize(46), 0, 0).SpToPx();
             }
         }
 
@@ -975,12 +991,12 @@ namespace MusicPlayer.Views
         {
             actionButtonView = new View()
             {
-                WidthSpecification = 224.SpToPx(),
-                HeightSpecification = 48.SpToPx(),
+                WidthSpecification = ModifySize(224).SpToPx(),
+                HeightSpecification = ModifySize(48).SpToPx(),
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Horizontal,
-                    CellPadding = new Size2D(40, 0).SpToPx(),
+                    CellPadding = new Size2D(ModifySize(40), 0).SpToPx(),
                 },
                 BackgroundColor = Color.Transparent,
             };
@@ -990,6 +1006,10 @@ namespace MusicPlayer.Views
             {
                 ThemeChangeSensitive = true,
             };
+            listButton.SizeWidth = ModifySize(48).SpToPx();
+            listButton.SizeHeight = ModifySize(48).SpToPx();
+            listButton.Icon.SizeWidth = ModifySize(48).SpToPx();
+            listButton.Icon.SizeHeight = ModifySize(48).SpToPx();
             listButton.Clicked += OnListButtonClicked;
             actionButtonView.Add(listButton);
 
@@ -997,6 +1017,10 @@ namespace MusicPlayer.Views
             {
                 ThemeChangeSensitive = true,
             };
+            playlistButton.SizeWidth = ModifySize(48).SpToPx();
+            playlistButton.SizeHeight = ModifySize(48).SpToPx();
+            playlistButton.Icon.SizeWidth = ModifySize(48).SpToPx();
+            playlistButton.Icon.SizeHeight = ModifySize(48).SpToPx();
             actionButtonView.Add(playlistButton);
             playlistButton.Clicked += (object o, ClickedEventArgs e) =>
             {
@@ -1005,8 +1029,8 @@ namespace MusicPlayer.Views
 
             favouriteButton = new MultiStateButton()
             {
-                Size2D = new Size2D(IconButtonSize, IconButtonSize).SpToPx(),
-                IconSize = new Tizen.NUI.Size(IconButtonSize, IconButtonSize).SpToPx(),
+                Size2D = new Size2D(ModifySize(IconButtonSize), ModifySize(IconButtonSize)).SpToPx(),
+                IconSize = new Tizen.NUI.Size(ModifySize(IconButtonSize), ModifySize(IconButtonSize)).SpToPx(),
                 IconResources = new Dictionary<ThemeType, Dictionary<string, StringSelector>>()
                 {
                     {
@@ -1076,25 +1100,24 @@ namespace MusicPlayer.Views
                 playerContentView.Remove(sliderView);
                 if (DeviceInfo.IsPortrait)
                 {
-                    sliderView.Margin = new Extents(32, 32, 0, 0).SpToPx();
+                    sliderView.Margin = new Extents((ushort)ModifySize(32), (ushort)ModifySize(32), 0, 0).SpToPx();
                     rightView.Remove(controlsView);
                     contentView.Remove(rightView);
                     contentView.Remove(leftView);
                     contentView.Add(rightView);
                     contentView.Add(leftView);
                     topRightView.Remove(actionButtonView);
-                    topRightView.HeightSpecification = 200.SpToPx();
+                    topRightView.HeightSpecification = ModifySize(200).SpToPx();
                     AddThumbnail();
                     topRightView.Add(actionButtonView);
                     rightView.Add(topRightView);
-                    controlsView.Margin = new Extents(0, 0, 40, 0).SpToPx();
                     rightView.Add(controlsView);
                 }
                 else
                 {
-                    leftView.Padding = new Extents(0, 64, 0, 64).SpToPx();
-                    sliderView.Margin = new Extents(0, 0, 84, 0).SpToPx();
-                    sliderView.WidthSpecification = 640.SpToPx();
+                    leftView.Padding = new Extents(0, (ushort)ModifySize(64), 0, (ushort)ModifySize(64)).SpToPx();
+                    sliderView.Margin = new Extents(0, 0, (ushort)ModifySize(84), 0).SpToPx();
+                    sliderView.WidthSpecification = ModifySize(640).SpToPx();
                 }
                 rightView.Add(sliderView);
                 AddPlayingListView();
@@ -1109,19 +1132,18 @@ namespace MusicPlayer.Views
                 rightView.Remove(sliderView);
                 if (DeviceInfo.IsPortrait)
                 {
-                    controlsView.Margin = new Extents(0, 0, 115, 0).SpToPx();
                     sliderView.Margin = new Extents(0, 0, 0, 0).SpToPx();
                     contentView.Remove(leftView);
                     contentView.Remove(rightView);
                     contentView.Add(leftView);
                     contentView.Add(rightView);
                     topRightView.Remove(thumb);
-                    topRightView.HeightSpecification = 48.SpToPx();
+                    topRightView.HeightSpecification = ModifySize(48).SpToPx();
                     leftView.Add(topRightView);
                 }
                 else
                 {
-                    leftView.Padding = new Extents(0, 64, 0, 0).SpToPx();
+                    leftView.Padding = new Extents(0, (ushort)ModifySize(64), 0, 0).SpToPx();
                     sliderView.Margin = new Extents(0, 0, 0, 0).SpToPx();
                     sliderView.WidthSpecification = LayoutParamPolicies.MatchParent;
                 }
@@ -1157,14 +1179,24 @@ namespace MusicPlayer.Views
             thumb = new ImageView()
             {
                 BackgroundColor = Color.Cyan,
-                Size2D = new Size2D(200, 200).SpToPx(),
-                BoxShadow = new Shadow(6.0f, Color.Black, new Vector2(0, 3)),
+                Size2D = new Size2D(ModifySize(200), ModifySize(200)).SpToPx(),
+                BoxShadow = new Shadow(6.0f, Color.Black, new Vector2(0, ModifySize(3))),
             };
             topRightView.Add(thumb);
             thumb.SetBinding(ImageView.ResourceUrlProperty, "ThumbnailPath");
             thumb.Hide();
         }
 
+        private int ModifySize(int value)
+        {
+            int res = DeviceInfo.IsPortrait ? Window.Instance.Size.Width : Window.Instance.Size.Height;
+            if (res <= 750.SpToPx())
+            {
+                value = (int)(value / 1.5f);
+            }
+            return value;
+        }
+
         private void AddPlayingListView()
         {
             if (currentListView == null)
index 31776901fc853c9276b603176eb64524a30eb136..78b62307b0f47765b5da7299e269f9d5457cc040 100755 (executable)
@@ -13,6 +13,8 @@ namespace MusicPlayer.Views
 {
     class SearchView : View
     {
+        private const int DisposeTimerInterval = 100;
+
         private CollectionView collectionView;
         private View topView;
         private bool noItemFound;
@@ -23,6 +25,7 @@ namespace MusicPlayer.Views
         private Button crossButton;
         private View searchBox;
         private TextLabel searchLabel;
+        private Timer disposeTimer;
 
         private readonly SearchViewModel viewModel;
 
@@ -52,6 +55,8 @@ namespace MusicPlayer.Views
             TouchEvent += (object source, TouchEventArgs e) => false;
             Window.Instance.Add(this);
             BackKeyPressed += OnBackKeyPressed;
+            disposeTimer = new Timer(DisposeTimerInterval);
+            disposeTimer.Tick += OnTimerTick;
         }
 
         private void OnBackKeyPressed(object sender, EventArgs e)
@@ -59,6 +64,13 @@ namespace MusicPlayer.Views
             DeleteSearchView();
         }
 
+        private bool OnTimerTick(object source, Timer.TickEventArgs e)
+        {
+            Tizen.Log.Debug(AppConstants.LogTag, "Deleting the Search view");
+            DeleteSearchView();
+            return false;
+        }
+
         private void AddTopView()
         {
             topView = new View()
@@ -259,7 +271,8 @@ namespace MusicPlayer.Views
                     Track currentTrack = searchModel.TrackDetail;
                     viewModel.PlayTrack(currentTrack);
                 }
-                DeleteSearchView();
+                // Starting the dispose timer as we can't delete the search view directly.
+                disposeTimer.Start();
             }
         }
 
@@ -394,6 +407,9 @@ namespace MusicPlayer.Views
                     noItemView.Dispose();
                     noItemView = null;
                 }
+
+                disposeTimer.Dispose();
+                disposeTimer = null;
             }
 
             base.Dispose(type);
index fd6f6b5768e65831c820d3aae303629fdb9a8919..eae8943177b0d0cff9cc5ae8a78b175033802a1b 100755 (executable)
@@ -41,7 +41,7 @@ Id="DarkTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="ShuffleButton" Size="48sp, 48sp" Position="0sp, 196sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+  <c:ButtonStyle x:Key="ShuffleButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
     <c:ButtonStyle.Icon>
       <ImageViewStyle Size="48sp, 48sp">
         <ImageViewStyle.ResourceUrl>
@@ -51,7 +51,7 @@ Id="DarkTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="RepeatButton" Size="48sp, 48sp" Position="592sp, 196sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+  <c:ButtonStyle x:Key="RepeatButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
     <c:ButtonStyle.Icon>
       <ImageViewStyle Size="48sp, 48sp">
         <ImageViewStyle.ResourceUrl>
@@ -61,7 +61,7 @@ Id="DarkTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="ListButton" Size="48sp, 48sp" Position="0sp, 0sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+  <c:ButtonStyle x:Key="ListButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
     <c:ButtonStyle.Icon>
       <ImageViewStyle Size="48sp, 48sp">
         <ImageViewStyle.ResourceUrl>
@@ -71,7 +71,7 @@ Id="DarkTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="PlaylistButton" Size="48sp, 48sp" Position="88sp, 0sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+  <c:ButtonStyle x:Key="PlaylistButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
     <c:ButtonStyle.Icon>
       <ImageViewStyle Size="48sp, 48sp">
         <ImageViewStyle.ResourceUrl>
@@ -81,7 +81,7 @@ Id="DarkTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="FavouriteButton" Size="48sp, 48sp" Position="176sp, 0sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+  <c:ButtonStyle x:Key="FavouriteButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
     <c:ButtonStyle.Icon>
       <ImageViewStyle Size="48sp, 48sp">
         <ImageViewStyle.ResourceUrl>
@@ -159,11 +159,11 @@ Id="DarkTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <ImageViewStyle x:Key="LeftVolume" Size="48sp, 48sp" Position="0sp, 336sp">
+  <ImageViewStyle x:Key="LeftVolume" Size="48sp, 48sp" >
     <ImageViewStyle.ResourceUrl>*Resource*/images/dark/left_sound_icon.png</ImageViewStyle.ResourceUrl>
   </ImageViewStyle>
 
-  <ImageViewStyle x:Key="RightVolume" Size="48sp, 48sp" Position="592sp, 336sp">
+  <ImageViewStyle x:Key="RightVolume" Size="48sp, 48sp" >
     <ImageViewStyle.ResourceUrl>*Resource*/images/dark/right_sound_icon.png</ImageViewStyle.ResourceUrl>
   </ImageViewStyle>
 
index 96a382357764bfdca7ba80fa7cba0e210d0c4950..b295b59f57ce31eb24f7d8dee7d4ea6a55207b7b 100755 (executable)
@@ -51,7 +51,7 @@ Id="LightTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="RepeatButton" Size="48sp, 48sp" Position="592sp, 196sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+  <c:ButtonStyle x:Key="RepeatButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
     <c:ButtonStyle.Icon>
       <ImageViewStyle Size="48sp, 48sp">
         <ImageViewStyle.ResourceUrl>
@@ -61,7 +61,7 @@ Id="LightTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="ListButton" Size="48sp, 48sp" Position="0sp, 0sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+  <c:ButtonStyle x:Key="ListButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
     <c:ButtonStyle.Icon>
       <ImageViewStyle Size="48sp, 48sp">
         <ImageViewStyle.ResourceUrl>
@@ -71,7 +71,7 @@ Id="LightTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="PlaylistButton" Size="48sp, 48sp" Position="88sp, 0sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+  <c:ButtonStyle x:Key="PlaylistButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
     <c:ButtonStyle.Icon>
       <ImageViewStyle Size="48sp, 48sp">
         <ImageViewStyle.ResourceUrl>
@@ -81,7 +81,7 @@ Id="LightTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <c:ButtonStyle x:Key="FavouriteButton" Size="48sp, 48sp" Position="176sp, 0sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
+  <c:ButtonStyle x:Key="FavouriteButton" Size="48sp, 48sp" IsSelectable="false" IsEnabled="true" BackgroundColor="Transparent">
     <c:ButtonStyle.Icon>
       <ImageViewStyle Size="48sp, 48sp">
         <ImageViewStyle.ResourceUrl>
@@ -159,11 +159,11 @@ Id="LightTheme">
     </c:ButtonStyle.Icon>
   </c:ButtonStyle>
 
-  <ImageViewStyle x:Key="LeftVolume" Size="48sp, 48sp" Position="0sp, 336sp">
+  <ImageViewStyle x:Key="LeftVolume" Size="48sp, 48sp" >
     <ImageViewStyle.ResourceUrl>*Resource*/images/light/left_sound_icon.png</ImageViewStyle.ResourceUrl>
   </ImageViewStyle>
 
-  <ImageViewStyle x:Key="RightVolume" Size="48sp, 48sp" Position="592sp, 336sp">
+  <ImageViewStyle x:Key="RightVolume" Size="48sp, 48sp" >
     <ImageViewStyle.ResourceUrl>*Resource*/images/light/right_sound_icon.png</ImageViewStyle.ResourceUrl>
   </ImageViewStyle>
 
index 64a07af24c31cb3ca69cf3d811438cf124e6ac3e..789d9ea362fc525f09caa58e9bd8e04099a377a9 100755 (executable)
Binary files a/packaging/org.tizen.MusicPlayer-1.0.0.tpk and b/packaging/org.tizen.MusicPlayer-1.0.0.tpk differ