From: aman.jeph Date: Mon, 4 Apr 2022 12:24:35 +0000 (+0530) Subject: Adding SpToPx in all the Views X-Git-Tag: submit/tizen/20220405.085546~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78896c19966ccebac5da6a29045d87f24ff7aa25;p=profile%2Fiot%2Fapps%2Fdotnet%2Fmusic-player.git Adding SpToPx in all the Views Change-Id: Ibd5a465bfb1d8ca3cd17f11ffe09fb9ab26b7e52 Signed-off-by: aman.jeph --- diff --git a/.gitignore b/.gitignore index 8a7dca8..7730530 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ music-player/.vs/ music-player/bin/ music-player/obj/ +music-player/music-player.csproj.user diff --git a/music-player/MusicPlayer.cs b/music-player/MusicPlayer.cs index 92fdad5..06e2463 100755 --- a/music-player/MusicPlayer.cs +++ b/music-player/MusicPlayer.cs @@ -25,6 +25,7 @@ namespace MusicPlayer window.BackgroundColor = Color.White; Size2D size = window.Size; Tizen.Log.Info(AppConstants.LogTag, "Window Size: " + size.Width + "x" + size.Height); + Tizen.Log.Info(AppConstants.LogTag, "Scaled DPI: " + GraphicsTypeManager.Instance.ScaledDpi + ", Scale Factor" + GraphicsTypeManager.Instance.ScalingFactor); ViewManager manager = new ViewManager(Window.Instance); } diff --git a/music-player/Views/AlbumDetailLayout.cs b/music-player/Views/AlbumDetailLayout.cs index f83da8b..820337a 100755 --- a/music-player/Views/AlbumDetailLayout.cs +++ b/music-player/Views/AlbumDetailLayout.cs @@ -33,11 +33,11 @@ namespace MusicPlayer.Views { OnInitialize(); WidthSpecification = LayoutParamPolicies.MatchParent; - HeightSpecification = 108.DpToPx(); + HeightSpecification = 108.SpToPx(); Layout = new RelativeLayout() { - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }; BackgroundColor = Color.Transparent; @@ -54,8 +54,8 @@ namespace MusicPlayer.Views { textView = new View() { - HeightSpecification = 76.DpToPx(), - WidthSpecification = (DeviceInfo.IsPortrait ? 748 : 564).DpToPx(), + HeightSpecification = 76.SpToPx(), + WidthSpecification = (DeviceInfo.IsPortrait ? 748 : 564).SpToPx(), BackgroundColor = Color.Transparent, Layout = new LinearLayout() { @@ -77,8 +77,8 @@ namespace MusicPlayer.Views titleLabel = new TextLabel() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 40.DpToPx(), - PixelSize = 32.DpToPx(), + HeightSpecification = 40.SpToPx(), + PixelSize = 32.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -93,8 +93,8 @@ namespace MusicPlayer.Views subtitleLabel = new TextLabel() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 36.DpToPx(), - PixelSize = 28.DpToPx(), + HeightSpecification = 36.SpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -108,14 +108,14 @@ namespace MusicPlayer.Views { additionalLabel = new TextLabel() { - WidthSpecification = 108.DpToPx(), - HeightSpecification = 36.DpToPx(), - PixelSize = 28.DpToPx(), + WidthSpecification = 108.SpToPx(), + HeightSpecification = 36.SpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.End, FontStyle = UIFontStyles.AllNormal, - Margin = new Extents(32, 0, 0, 0).DpToPx(), + Margin = new Extents(32, 0, 0, 0).SpToPx(), Ellipsis = true, }; Add(additionalLabel); @@ -129,7 +129,7 @@ namespace MusicPlayer.Views itemSeperator = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 2.DpToPx(), + HeightSpecification = 2.SpToPx(), BackgroundColor = UIColors.ItemSeperator, }; Add(itemSeperator); diff --git a/music-player/Views/AlbumDetailView.cs b/music-player/Views/AlbumDetailView.cs index 134f174..e5bbdad 100755 --- a/music-player/Views/AlbumDetailView.cs +++ b/music-player/Views/AlbumDetailView.cs @@ -146,7 +146,7 @@ namespace MusicPlayer.Views albumArtIcon = new ImageView() { BackgroundColor = UIColors.HEXEEEFF1, - Size2D = new Size2D(AlbumArtSize, AlbumArtSize).DpToPx(), + Size2D = new Size2D(AlbumArtSize, AlbumArtSize).SpToPx(), }; albumArtIcon.BindingContext = viewModel; albumArtIcon.SetBinding(ImageView.ResourceUrlProperty, "AlbumArtPath"); @@ -158,10 +158,10 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - WidthSpecification = (DeviceInfo.IsPortrait ? 508 : 640).DpToPx(), - HeightSpecification = 48.DpToPx(), - PixelSize = 36.DpToPx(), - Margin = new Extents(0, 0, 32, 14).DpToPx(), + WidthSpecification = (DeviceInfo.IsPortrait ? 508 : 640).SpToPx(), + HeightSpecification = 48.SpToPx(), + PixelSize = 36.SpToPx(), + Margin = new Extents(0, 0, 32, 14).SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -175,9 +175,9 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - WidthSpecification = (DeviceInfo.IsPortrait ? 508 : 640).DpToPx(), - HeightSpecification = 36.DpToPx(), - PixelSize = 28.DpToPx(), + WidthSpecification = (DeviceInfo.IsPortrait ? 508 : 640).SpToPx(), + HeightSpecification = 36.SpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, diff --git a/music-player/Views/AlbumView.cs b/music-player/Views/AlbumView.cs index e5cd4bb..c1bfa2f 100755 --- a/music-player/Views/AlbumView.cs +++ b/music-player/Views/AlbumView.cs @@ -37,7 +37,7 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 28.DpToPx(), + PixelSize = 28.SpToPx(), Text = "ALBUM COUNT", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, diff --git a/music-player/Views/ArtistDetailGroupLayout.cs b/music-player/Views/ArtistDetailGroupLayout.cs index e07bf5b..6c8ee56 100755 --- a/music-player/Views/ArtistDetailGroupLayout.cs +++ b/music-player/Views/ArtistDetailGroupLayout.cs @@ -17,11 +17,11 @@ namespace MusicPlayer.Views { OnInitialize(); WidthSpecification = LayoutParamPolicies.MatchParent; - HeightSpecification = 108.DpToPx(); + HeightSpecification = 108.SpToPx(); Layout = new RelativeLayout() { - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }; BackgroundColor = Color.Transparent; @@ -34,8 +34,8 @@ namespace MusicPlayer.Views { ImageView icon = new ImageView() { - WidthSpecification = IconSize.DpToPx(), - HeightSpecification = IconSize.DpToPx(), + WidthSpecification = IconSize.SpToPx(), + HeightSpecification = IconSize.SpToPx(), }; Add(icon); RelativeLayout.SetVerticalAlignment(icon, RelativeLayout.Alignment.Center); @@ -49,7 +49,7 @@ namespace MusicPlayer.Views View itemSeperator = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 2.DpToPx(), + HeightSpecification = 2.SpToPx(), BackgroundColor = UIColors.ItemSeperator, }; Add(itemSeperator); @@ -62,13 +62,13 @@ namespace MusicPlayer.Views TextLabel titleLabel = new TextLabel() { StyleName = "ItemLabel", - HeightSpecification = 40.DpToPx(), - PixelSize = 32.DpToPx(), + HeightSpecification = 40.SpToPx(), + PixelSize = 32.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, FontStyle = UIFontStyles.NormalLight, - Margin = new Extents(32, 0, 0, 0).DpToPx(), + Margin = new Extents(32, 0, 0, 0).SpToPx(), Ellipsis = true, }; Add(titleLabel); diff --git a/music-player/Views/ArtistDetailItemLayout.cs b/music-player/Views/ArtistDetailItemLayout.cs index f1f3ff2..c2c8f82 100755 --- a/music-player/Views/ArtistDetailItemLayout.cs +++ b/music-player/Views/ArtistDetailItemLayout.cs @@ -31,11 +31,11 @@ namespace MusicPlayer.Views { OnInitialize(); WidthSpecification = LayoutParamPolicies.MatchParent; - HeightSpecification = 108.DpToPx(); + HeightSpecification = 108.SpToPx(); Layout = new RelativeLayout() { - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }; BackgroundColor = Color.Transparent; @@ -51,7 +51,7 @@ namespace MusicPlayer.Views itemSeperator = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 2.DpToPx(), + HeightSpecification = 2.SpToPx(), BackgroundColor = UIColors.ItemSeperator, }; Add(itemSeperator); @@ -62,8 +62,8 @@ namespace MusicPlayer.Views { titleLabel = new TextLabel() { - HeightSpecification = 40.DpToPx(), - PixelSize = 32.DpToPx(), + HeightSpecification = 40.SpToPx(), + PixelSize = 32.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -82,14 +82,14 @@ namespace MusicPlayer.Views { extraLabel = new TextLabel() { - WidthSpecification = 160.DpToPx(), - HeightSpecification = 36.DpToPx(), - PixelSize = 28.DpToPx(), + WidthSpecification = 160.SpToPx(), + HeightSpecification = 36.SpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.End, FontStyle = UIFontStyles.AllNormal, - Margin = new Extents(32, 0, 0, 0).DpToPx(), + Margin = new Extents(32, 0, 0, 0).SpToPx(), Ellipsis = true, }; Add(extraLabel); diff --git a/music-player/Views/ArtistView.cs b/music-player/Views/ArtistView.cs index c498cb3..7e39110 100755 --- a/music-player/Views/ArtistView.cs +++ b/music-player/Views/ArtistView.cs @@ -39,7 +39,7 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 28.DpToPx(), + PixelSize = 28.SpToPx(), Text = "ARTIST COUNT", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, diff --git a/music-player/Views/BaseContentView.cs b/music-player/Views/BaseContentView.cs index fd4f821..e6cd965 100755 --- a/music-player/Views/BaseContentView.cs +++ b/music-player/Views/BaseContentView.cs @@ -38,7 +38,7 @@ namespace MusicPlayer.Views Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }, }; base.Add(contentViewContainer); @@ -47,10 +47,10 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 60.DpToPx(), + HeightSpecification = 60.SpToPx(), Layout = new RelativeLayout() { - Padding = new Extents(0, 0, 6, 6).DpToPx(), + Padding = new Extents(0, 0, 6, 6).SpToPx(), }, }; contentViewContainer.Add(titleView); @@ -140,13 +140,13 @@ namespace MusicPlayer.Views Direction = FlexLayout.FlexDirection.Column, ItemsAlignment = FlexLayout.AlignmentType.Center, Justification = FlexLayout.FlexJustification.FlexStart, - Padding = (DeviceInfo.IsPortrait ? new Extents(0, 0, 343, 0) : new Extents(0, 0, 24, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(0, 0, 343, 0) : new Extents(0, 0, 24, 0)).SpToPx(), } }; noItemsAnimation = new LottieAnimationView() { URL = Resources.GetLottiePath() + "no_items_folder.json", - Size2D = new Size2D(700, 560).DpToPx(), + Size2D = new Size2D(700, 560).SpToPx(), LoopCount = -1, BackgroundColor = Color.Transparent, }; @@ -154,12 +154,12 @@ namespace MusicPlayer.Views TextLabel textLabel = new TextLabel() { StyleName = "TitleText", - Size2D = new Size2D(234, 36).DpToPx(), + Size2D = new Size2D(234, 36).SpToPx(), Text = "No items in folder", - PixelSize = 28.DpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Center, - Margin = new Extents(0, 0, 8, 0).DpToPx(), + Margin = new Extents(0, 0, 8, 0).SpToPx(), }; noItemView.Add(textLabel); } diff --git a/music-player/Views/BaseSubContentView.cs b/music-player/Views/BaseSubContentView.cs index 26e053a..db4327a 100755 --- a/music-player/Views/BaseSubContentView.cs +++ b/music-player/Views/BaseSubContentView.cs @@ -22,7 +22,7 @@ namespace MusicPlayer.Views public event EventHandler SubContentOperationViewAdd; - public BaseSubContentView():base() + public BaseSubContentView() : base() { WidthResizePolicy = ResizePolicyType.FillToParent; HeightResizePolicy = ResizePolicyType.FillToParent; @@ -35,7 +35,7 @@ namespace MusicPlayer.Views { LinearOrientation = LinearLayout.Orientation.Vertical, VerticalAlignment = VerticalAlignment.Top, - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx() + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx() }, BackgroundColor = Color.Transparent, WidthResizePolicy = ResizePolicyType.FillToParent, @@ -46,10 +46,10 @@ namespace MusicPlayer.Views topView = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 60.DpToPx(), + HeightSpecification = 60.SpToPx(), Layout = new RelativeLayout() { - Padding = new Extents(0, 0, 6, 6).DpToPx(), + Padding = new Extents(0, 0, 6, 6).SpToPx(), }, }; listContainer.Add(topView); @@ -58,7 +58,7 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 28.DpToPx(), + PixelSize = 28.SpToPx(), HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, FontFamily = "BreezeSans", @@ -86,7 +86,7 @@ namespace MusicPlayer.Views playAllWithShuffle = new Button("ShuffleButton") { ThemeChangeSensitive = true, - Margin = new Extents(32, 40, 0, 0).DpToPx(), + Margin = new Extents(32, 40, 0, 0).SpToPx(), }; topView.Add(playAllWithShuffle); playAllWithShuffle.Clicked += (object sender, ClickedEventArgs e) => @@ -137,13 +137,13 @@ namespace MusicPlayer.Views Direction = FlexLayout.FlexDirection.Column, ItemsAlignment = FlexLayout.AlignmentType.Center, Justification = FlexLayout.FlexJustification.FlexStart, - Padding = (DeviceInfo.IsPortrait ? new Extents(0, 0, 343, 0) : new Extents(0, 0, 24, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(0, 0, 343, 0) : new Extents(0, 0, 24, 0)).SpToPx(), } }; noItemsAnimation = new LottieAnimationView() { URL = Resources.GetLottiePath() + "no_items_folder.json", - Size2D = new Size2D(700, 560).DpToPx(), + Size2D = new Size2D(700, 560).SpToPx(), LoopCount = -1, BackgroundColor = Color.Transparent, }; @@ -151,12 +151,12 @@ namespace MusicPlayer.Views TextLabel textLabel = new TextLabel() { StyleName = "TitleText", - Size2D = new Size2D(234, 36).DpToPx(), + Size2D = new Size2D(234, 36).SpToPx(), Text = "No items in folder", - PixelSize = 28.DpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Center, - Margin = new Extents(0, 0, 8, 0).DpToPx(), + Margin = new Extents(0, 0, 8, 0).SpToPx(), }; noItemView.Add(textLabel); listContainer.Add(noItemView); diff --git a/music-player/Views/BaseView.cs b/music-player/Views/BaseView.cs index a3b223e..66f472a 100755 --- a/music-player/Views/BaseView.cs +++ b/music-player/Views/BaseView.cs @@ -42,10 +42,10 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 120.DpToPx(), + HeightSpecification = 120.SpToPx(), Layout = new RelativeLayout() { - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 30, 30) : new Extents(64, 64, 30, 30)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 30, 30) : new Extents(64, 64, 30, 30)).SpToPx(), }, }; base.Add(topView); @@ -56,7 +56,7 @@ namespace MusicPlayer.Views StyleName = "PageLabel", ThemeChangeSensitive = true, Text = "Music", - PixelSize = 40.DpToPx(), + PixelSize = 40.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -84,9 +84,9 @@ namespace MusicPlayer.Views tabs = new Tab("Tabs") { ThemeChangeSensitive = true, - Size2D = new Size2D(Window.Instance.Size.Width, 84).DpToPx(), + Size2D = new Size2D(Window.Instance.Size.Width, 84).SpToPx(), WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 84.DpToPx(), + HeightSpecification = 84.SpToPx(), }; base.Add(tabs); for(int i = 0; i<4; ++i) @@ -125,8 +125,8 @@ namespace MusicPlayer.Views backButton = new Button("BackButton") { ThemeChangeSensitive = true, - Size2D = new Size2D(48, 48).DpToPx(), - Margin = new Extents(0, 24, 6, 6).DpToPx(), + Size2D = new Size2D(48, 48).SpToPx(), + Margin = new Extents(0, 24, 6, 6).SpToPx(), }; backButton.Clicked += OnBackButtonClicked; @@ -160,7 +160,7 @@ namespace MusicPlayer.Views moreButton = new Button("MoreButton") { ThemeChangeSensitive = true, - Margin = new Extents(32, 0, 6, 6).DpToPx(), + Margin = new Extents(32, 0, 6, 6).SpToPx(), }; topView.Add(moreButton); RelativeLayout.SetLeftRelativeOffset(moreButton, 1.0f); @@ -182,7 +182,7 @@ namespace MusicPlayer.Views searchButton = new Button("SearchButton") { ThemeChangeSensitive = true, - Margin = new Extents(24, 0, 0, 0).DpToPx(), + Margin = new Extents(24, 0, 0, 0).SpToPx(), }; topView.Add(searchButton); RelativeLayout.SetRightTarget(searchButton, moreButton); diff --git a/music-player/Views/ListItemLayout.cs b/music-player/Views/ListItemLayout.cs index 285cebd..22e61a1 100755 --- a/music-player/Views/ListItemLayout.cs +++ b/music-player/Views/ListItemLayout.cs @@ -58,17 +58,17 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus); OnInitialize(); AnimationRequired = animationRequired; WidthSpecification = LayoutParamPolicies.MatchParent; - HeightSpecification = height.DpToPx(); + HeightSpecification = height.SpToPx(); BackgroundColor = Color.Transparent; Layout = new RelativeLayout() { - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }; icon = new ImageView() { - WidthSpecification = IconSize.DpToPx(), - HeightSpecification = IconSize.DpToPx(), + WidthSpecification = IconSize.SpToPx(), + HeightSpecification = IconSize.SpToPx(), }; Add(icon); RelativeLayout.SetVerticalAlignment(icon, RelativeLayout.Alignment.Center); @@ -78,13 +78,13 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus); textView = new View() { BackgroundColor = Color.Transparent, - HeightSpecification = 76.DpToPx(), + HeightSpecification = 76.SpToPx(), Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Top, - Margin = new Extents(32, 0, 0, 0).DpToPx(), + Margin = new Extents(32, 0, 0, 0).SpToPx(), } }; Add(textView); @@ -97,8 +97,8 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus); titleLabel = new TextLabel() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 40.DpToPx(), - PixelSize = 32.DpToPx(), + HeightSpecification = 40.SpToPx(), + PixelSize = 32.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -110,8 +110,8 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus); subtitleLabel = new TextLabel() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 36.DpToPx(), - PixelSize = 28.DpToPx(), + HeightSpecification = 36.SpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -124,7 +124,7 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus); itemSeperator = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = SeperatorHeight.DpToPx(), + HeightSpecification = SeperatorHeight.SpToPx(), BackgroundColor = UIColors.ItemSeperator, }; Add(itemSeperator); diff --git a/music-player/Views/LyricsView.cs b/music-player/Views/LyricsView.cs index 900e3d3..818c648 100755 --- a/music-player/Views/LyricsView.cs +++ b/music-player/Views/LyricsView.cs @@ -34,7 +34,7 @@ namespace MusicPlayer.Views Direction = FlexLayout.FlexDirection.Column, Alignment = FlexLayout.AlignmentType.Center, Justification = FlexLayout.FlexJustification.Center, - Margin = new Extents(24, 24, 0, 46).DpToPx(), + Margin = new Extents(24, 24, 0, 46).SpToPx(), }; isAnimating = false; AddThumbnail(); @@ -125,7 +125,7 @@ namespace MusicPlayer.Views { Direction = FlexLayout.FlexDirection.Column, ItemsAlignment = FlexLayout.AlignmentType.Center, - Padding = new Extents(40, 40, 40, 40).DpToPx(), + Padding = new Extents(40, 40, 40, 40).SpToPx(), }, }; FlexLayout.SetFlexPositionType(lyricsScrollBaseView, FlexLayout.PositionType.Absolute); diff --git a/music-player/Views/MiniPlayer.cs b/music-player/Views/MiniPlayer.cs index 4a30dae..e9b5b32 100755 --- a/music-player/Views/MiniPlayer.cs +++ b/music-player/Views/MiniPlayer.cs @@ -37,7 +37,7 @@ namespace MusicPlayer.Views StyleName = "MiniPlayer"; ThemeChangeSensitive = true; WidthSpecification = LayoutParamPolicies.MatchParent; - HeightSpecification = (DeviceInfo.IsPortrait ? 170 : 124).DpToPx(); + HeightSpecification = (DeviceInfo.IsPortrait ? 170 : 124).SpToPx(); Layout = new LinearLayout() { @@ -47,19 +47,19 @@ namespace MusicPlayer.Views baseView = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 123.DpToPx(), + HeightSpecification = 123.SpToPx(), BackgroundColor = Color.Transparent, Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal, VerticalAlignment = VerticalAlignment.Center, }, - Padding = new Extents(64, 64, 24, 19).DpToPx(), + Padding = new Extents(64, 64, 24, 19).SpToPx(), }; if(DeviceInfo.IsPortrait) { - baseView.Padding = new Extents(33, 33, 24, 8).DpToPx(); - baseView.HeightSpecification = 108.DpToPx(); + baseView.Padding = new Extents(33, 33, 24, 8).SpToPx(); + baseView.HeightSpecification = 108.SpToPx(); } Add(baseView); AddTrackDetails(); @@ -72,7 +72,7 @@ namespace MusicPlayer.Views View separator = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 1.DpToPx(), + HeightSpecification = 1.SpToPx(), StyleName = "InputLine", }; Add(separator); @@ -88,8 +88,8 @@ namespace MusicPlayer.Views }, BackgroundColor = Color.Transparent, }; - trackInfo.WidthSpecification = (DeviceInfo.IsPortrait ? 536 : 622).DpToPx(); - trackInfo.HeightSpecification = 76.DpToPx(); + trackInfo.WidthSpecification = (DeviceInfo.IsPortrait ? 536 : 622).SpToPx(); + trackInfo.HeightSpecification = 76.SpToPx(); baseView.Add(trackInfo); AddThumbnail(); AddTrackTextLabels(); @@ -104,16 +104,16 @@ namespace MusicPlayer.Views { LinearOrientation = LinearLayout.Orientation.Vertical, }, - HeightSpecification = 76.DpToPx(), + HeightSpecification = 76.SpToPx(), }; if(DeviceInfo.IsPortrait) { - trackTextView.WidthSpecification = 436.DpToPx(); + trackTextView.WidthSpecification = 436.SpToPx(); trackTextView.Margin = new Extents(24, 0, 0, 0); } else { - trackTextView.WidthSpecification = 516.DpToPx(); + trackTextView.WidthSpecification = 516.SpToPx(); trackTextView.Margin = new Extents(30, 0, 0, 0); } trackInfo.Add(trackTextView); @@ -126,7 +126,7 @@ namespace MusicPlayer.Views thumbnail = new ImageView() { BackgroundColor = UIColors.HEXEEEFF1, - Size2D = new Size2D(76, 76).DpToPx(), + Size2D = new Size2D(76, 76).SpToPx(), }; thumbnail.SetBinding(ImageView.ResourceUrlProperty, "ThumbnailPath"); thumbnail.TouchEvent += (object source, TouchEventArgs e) => @@ -144,8 +144,8 @@ namespace MusicPlayer.Views StyleName = "TitleText", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 48.DpToPx(), - PixelSize = 36.DpToPx(), + HeightSpecification = 48.SpToPx(), + PixelSize = 36.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -162,8 +162,8 @@ namespace MusicPlayer.Views StyleName = "TitleText", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 28.DpToPx(), - PixelSize = 22.DpToPx(), + HeightSpecification = 28.SpToPx(), + PixelSize = 22.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -176,15 +176,15 @@ namespace MusicPlayer.Views { controlsView = new View() { - WidthSpecification = 304.DpToPx(), + WidthSpecification = 304.SpToPx(), Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, - CellPadding = new Size2D(80, 0).DpToPx(), + CellPadding = new Size2D(80, 0).SpToPx(), }, - Margin = new Extents(120, 120, 0, 0).DpToPx(), + Margin = new Extents(120, 120, 0, 0).SpToPx(), BackgroundColor = Color.Transparent, }; baseView.Add(controlsView); @@ -212,7 +212,7 @@ namespace MusicPlayer.Views { playButton = new MultiStateButton() { - Size2D = new Size2D(48, 48).DpToPx(), + Size2D = new Size2D(48, 48).SpToPx(), BackgroundColor = Color.Transparent, IconResources = new Dictionary>() { @@ -304,23 +304,23 @@ namespace MusicPlayer.Views { LinearOrientation = LinearLayout.Orientation.Horizontal, VerticalAlignment = VerticalAlignment.Center, - Padding = new Extents(33, 33, 0, 8).DpToPx(), + Padding = new Extents(33, 33, 0, 8).SpToPx(), }; - sliderView.SizeHeight = 61.DpToPx(); + sliderView.SizeHeight = 61.SpToPx(); base.Add(sliderView); - currentTime.WidthSpecification = 72.DpToPx(); + currentTime.WidthSpecification = 72.SpToPx(); sliderView.Add(currentTime); - playbackSlider.WidthSpecification = 872.DpToPx(); + playbackSlider.WidthSpecification = 872.SpToPx(); sliderView.Add(playbackSlider); - totalTime.WidthSpecification = 72.DpToPx(); + totalTime.WidthSpecification = 72.SpToPx(); sliderView.Add(totalTime); } else { - sliderView.SizeHeight = 24.DpToPx(); + sliderView.SizeHeight = 24.SpToPx(); baseView.Add(playbackSlider); sliderView.Layout = new RelativeLayout(); - sliderView.Position2D = new Position2D(0, SliderHeight).DpToPx(); + sliderView.Position2D = new Position2D(0, SliderHeight).SpToPx(); playbackSlider.Add(sliderView); sliderView.Add(currentTime); RelativeLayout.SetHorizontalAlignment(currentTime, RelativeLayout.Alignment.Start); @@ -352,9 +352,9 @@ namespace MusicPlayer.Views ThemeChangeSensitive = true, MinValue = 0.0f, MaxValue = 1.0f, - WidthSpecification = 626.DpToPx(), - HeightSpecification = SliderHeight.DpToPx(), - ThumbSize = new Tizen.NUI.Size(30, 30).DpToPx(), + WidthSpecification = 626.SpToPx(), + HeightSpecification = SliderHeight.SpToPx(), + ThumbSize = new Tizen.NUI.Size(30, 30).SpToPx(), Direction = Slider.DirectionType.Horizontal, }; playbackSlider.SetBinding(Slider.CurrentValueProperty, "ElapsedTime"); @@ -367,8 +367,8 @@ namespace MusicPlayer.Views { StyleName = "TitleText", ThemeChangeSensitive = true, - Size2D = new Size2D(180, 24).DpToPx(), - PixelSize = 18.DpToPx(), + Size2D = new Size2D(180, 24).SpToPx(), + PixelSize = 18.SpToPx(), FontFamily = "BreezeSans", Text = "00::00:00", HorizontalAlignment = HorizontalAlignment.Begin, @@ -382,8 +382,8 @@ namespace MusicPlayer.Views { StyleName = "TitleText", ThemeChangeSensitive = true, - Size2D = new Size2D(180, 24).DpToPx(), - PixelSize = 18.DpToPx(), + Size2D = new Size2D(180, 24).SpToPx(), + PixelSize = 18.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.End, Text = "59:59:59", diff --git a/music-player/Views/PlayerView.cs b/music-player/Views/PlayerView.cs index ce69e7d..47d1ee7 100755 --- a/music-player/Views/PlayerView.cs +++ b/music-player/Views/PlayerView.cs @@ -85,7 +85,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)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }, }; Add(playerContentView); @@ -165,12 +165,12 @@ namespace MusicPlayer.Views if (viewState == PlayerViewState.AlbumArt) { leftView.Add(topRightView); - topRightView.HeightSpecification = 48.DpToPx(); + topRightView.HeightSpecification = 48.SpToPx(); } } else { - leftView.Layout.Padding = (new Extents(0, 64, 0, 0)).DpToPx(); + leftView.Layout.Padding = (new Extents(0, 64, 0, 0)).SpToPx(); } AddLyricsView(); } @@ -193,7 +193,7 @@ namespace MusicPlayer.Views if (DeviceInfo.IsPortrait == false || viewState == PlayerViewState.TrackList) { rightView.Add(topRightView); - topRightView.HeightSpecification = 200.DpToPx(); + topRightView.HeightSpecification = 200.SpToPx(); AddThumbnail(); } AddControlView(); @@ -238,7 +238,7 @@ namespace MusicPlayer.Views { Layout = new RelativeLayout(), WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 120.DpToPx(), + HeightSpecification = 120.SpToPx(), MaximumSize = new Size2D(Window.Instance.WindowSize.Width, (int)(Window.Instance.WindowSize.Height*0.111f)) }; playerContentView.Add(topView); @@ -323,8 +323,8 @@ namespace MusicPlayer.Views StyleName = "LabelText", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 48.DpToPx(), - PixelSize = 40.DpToPx(), + HeightSpecification = 48.SpToPx(), + PixelSize = 40.SpToPx(), FontFamily = "BreezeSans", FontStyle = UIFontStyles.AllNormal, Text = "Delete", @@ -341,14 +341,14 @@ namespace MusicPlayer.Views StyleName = "LabelText", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 40.DpToPx(), - PixelSize = 32.DpToPx(), + HeightSpecification = 40.SpToPx(), + PixelSize = 32.SpToPx(), FontFamily = "BreezeSans", FontStyle = UIFontStyles.NormalLight, Text = "This track will be deleted.", HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, - Margin = new Extents(0, 0, 40, 64).DpToPx(), + Margin = new Extents(0, 0, 40, 64).SpToPx(), }; return titleLabel; } @@ -358,7 +358,7 @@ namespace MusicPlayer.Views View buttonArea = new View() { BackgroundColor = Color.Transparent, - HeightSpecification = 96.DpToPx(), + HeightSpecification = 96.SpToPx(), WidthSpecification = LayoutParamPolicies.MatchParent, Layout = new RelativeLayout() }; @@ -380,8 +380,8 @@ namespace MusicPlayer.Views Button deleteButton = new Button() { - WidthSpecification = 336.DpToPx(), - HeightSpecification = 96.DpToPx(), + WidthSpecification = 336.SpToPx(), + HeightSpecification = 96.SpToPx(), Text = "Delete", }; buttonArea.Add(deleteButton); @@ -393,12 +393,12 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, StyleName = "Dialogs", - WidthSpecification = (DeviceInfo.IsPortrait ? 952 : 1184).DpToPx(), - HeightSpecification = 368.DpToPx(), + WidthSpecification = (DeviceInfo.IsPortrait ? 952 : 1184).SpToPx(), + HeightSpecification = 368.SpToPx(), Layout = new LinearLayout() { - Padding = new Extents(80, 80, 40, 40).DpToPx(), - Margin = new Extents(32, 32, 0, 0).DpToPx(), + Padding = new Extents(80, 80, 40, 40).SpToPx(), + Margin = new Extents(32, 32, 0, 0).SpToPx(), LinearOrientation = LinearLayout.Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Top, @@ -424,12 +424,12 @@ namespace MusicPlayer.Views { controlsView = new View() { - WidthSpecification = 640.DpToPx(), - HeightSpecification = (DeviceInfo.IsPortrait ? ControlViewHeightPortrait : ControlViewHeightLandscape).DpToPx(), + WidthSpecification = 640.SpToPx(), + HeightSpecification = (DeviceInfo.IsPortrait ? ControlViewHeightPortrait : ControlViewHeightLandscape).SpToPx(), Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, - Margin = (new Extents(0, 0, 115, 0)).DpToPx(), + Margin = (new Extents(0, 0, 115, 0)).SpToPx(), } }; rightView.Add(controlsView); @@ -443,8 +443,8 @@ namespace MusicPlayer.Views StyleName = "LabelText", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = TitleLabelHeight.DpToPx(), - PixelSize = 36.DpToPx(), + HeightSpecification = TitleLabelHeight.SpToPx(), + PixelSize = 36.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -461,8 +461,8 @@ namespace MusicPlayer.Views StyleName = "LabelText", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = ArtistLabelHeight.DpToPx(), - PixelSize = 28.DpToPx(), + HeightSpecification = ArtistLabelHeight.SpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -482,8 +482,8 @@ namespace MusicPlayer.Views { shuffleButton = new MultiStateButton() { - Size2D = new Size2D(IconSize, IconSize).DpToPx(), - Margin = new Extents(0, 40, 0, 0).DpToPx(), + Size2D = new Size2D(IconSize, IconSize).SpToPx(), + Margin = new Extents(0, 40, 0, 0).SpToPx(), IconResources = new Dictionary>() { { @@ -558,7 +558,7 @@ namespace MusicPlayer.Views { playButton = new MultiStateButton() { - Size2D = new Size2D(IconSize, IconSize).DpToPx(), + Size2D = new Size2D(IconSize, IconSize).SpToPx(), BackgroundColor = Color.Transparent, IconResources = new Dictionary>() { @@ -642,8 +642,8 @@ namespace MusicPlayer.Views { repeatButton = new MultiStateButton() { - Size2D = new Size2D(IconSize, IconSize).DpToPx(), - Margin = new Extents(40, 0, 0, 0).DpToPx(), + Size2D = new Size2D(IconSize, IconSize).SpToPx(), + Margin = new Extents(40, 0, 0, 0).SpToPx(), IconResources = new Dictionary>() { { @@ -717,14 +717,14 @@ namespace MusicPlayer.Views playbackButtonsView = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 48.DpToPx(), + HeightSpecification = 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)).DpToPx(), - CellPadding = new Size2D(80, 0).DpToPx(), + Margin = (DeviceInfo.IsPortrait ? new Extents(0, 0, 140, 104) : new Extents(0, 0, 100, 92)).SpToPx(), + CellPadding = new Size2D(80, 0).SpToPx(), }, }; controlsView.Add(playbackButtonsView); @@ -776,8 +776,8 @@ namespace MusicPlayer.Views volumeSlider = new Slider("Slider") { ThemeChangeSensitive = true, - Size2D = new Size2D(496, 48).DpToPx(), - ThumbSize = new Tizen.NUI.Size(36, 36).DpToPx(), + Size2D = new Size2D(496, 48).SpToPx(), + ThumbSize = new Tizen.NUI.Size(36, 36).SpToPx(), Direction = Slider.DirectionType.Horizontal, MinValue = 0, MaxValue = AudioManager.VolumeController.MaxLevel[AudioVolumeType.Media], @@ -794,10 +794,10 @@ namespace MusicPlayer.Views volumeSliderView = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 48.DpToPx(), + HeightSpecification = 48.SpToPx(), Layout = new LinearLayout() { - CellPadding = (new Size2D(24, 0)).DpToPx(), + CellPadding = (new Size2D(24, 0)).SpToPx(), LinearOrientation = LinearLayout.Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -840,8 +840,8 @@ namespace MusicPlayer.Views MinValue = 0.0f, MaxValue = 1.0f, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 44.DpToPx(), - ThumbSize = new Tizen.NUI.Size(36, 36).DpToPx(), + HeightSpecification = 44.SpToPx(), + ThumbSize = new Tizen.NUI.Size(36, 36).SpToPx(), Direction = Slider.DirectionType.Horizontal, }; playbackSlider.SetBinding(Slider.CurrentValueProperty, "ElapsedTime"); @@ -855,8 +855,8 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - Size2D = new Size2D(400, 32).DpToPx(), - PixelSize = 24.DpToPx(), + Size2D = new Size2D(400, 32).SpToPx(), + PixelSize = 24.SpToPx(), FontFamily = "BreezeSans", Text = "00::00:00", HorizontalAlignment = HorizontalAlignment.Begin, @@ -873,8 +873,8 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - Size2D = new Size2D(400, 32).DpToPx(), - PixelSize = 24.DpToPx(), + Size2D = new Size2D(400, 32).SpToPx(), + PixelSize = 24.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.End, Text = "59:59:59", @@ -890,7 +890,7 @@ namespace MusicPlayer.Views sliderView = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 84.DpToPx(), + HeightSpecification = 84.SpToPx(), Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, @@ -910,10 +910,10 @@ namespace MusicPlayer.Views playbackSliderTextView = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 32.DpToPx(), + HeightSpecification = 32.SpToPx(), Layout = new RelativeLayout() { - Margin = (new Extents(0, 0, 8, 0)).DpToPx(), + Margin = (new Extents(0, 0, 8, 0)).SpToPx(), }, }; sliderView.Add(playbackSliderTextView); @@ -932,12 +932,12 @@ namespace MusicPlayer.Views LinearOrientation = LinearLayout.Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.End, VerticalAlignment = VerticalAlignment.Top, - CellPadding = new Size2D(92, 0).DpToPx(), + CellPadding = new Size2D(92, 0).SpToPx(), }, }; if (DeviceInfo.IsPortrait) { - topRightView.Margin = new Extents(0, 46, 0, 0).DpToPx(); + topRightView.Margin = new Extents(0, 46, 0, 0).SpToPx(); } } @@ -945,12 +945,12 @@ namespace MusicPlayer.Views { actionButtonView = new View() { - WidthSpecification = 224.DpToPx(), - HeightSpecification = 48.DpToPx(), + WidthSpecification = 224.SpToPx(), + HeightSpecification = 48.SpToPx(), Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal, - CellPadding = new Size2D(40, 0).DpToPx(), + CellPadding = new Size2D(40, 0).SpToPx(), }, BackgroundColor = Color.Transparent, }; @@ -975,7 +975,7 @@ namespace MusicPlayer.Views favouriteButton = new MultiStateButton() { - Size2D = new Size2D(IconSize, IconSize).DpToPx(), + Size2D = new Size2D(IconSize, IconSize).SpToPx(), IconResources = new Dictionary>() { { @@ -1039,25 +1039,25 @@ namespace MusicPlayer.Views playerContentView.Remove(sliderView); if (DeviceInfo.IsPortrait) { - sliderView.Margin = new Extents(32, 32, 0, 0).DpToPx(); + sliderView.Margin = new Extents(32, 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.DpToPx(); + topRightView.HeightSpecification = 200.SpToPx(); AddThumbnail(); topRightView.Add(actionButtonView); rightView.Add(topRightView); - controlsView.Margin = new Extents(0, 0, 40, 0).DpToPx(); + controlsView.Margin = new Extents(0, 0, 40, 0).SpToPx(); rightView.Add(controlsView); } else { - leftView.Padding = new Extents(0, 64, 0, 64).DpToPx(); - sliderView.Margin = new Extents(0, 0, 84, 0).DpToPx(); - sliderView.WidthSpecification = 640.DpToPx(); + leftView.Padding = new Extents(0, 64, 0, 64).SpToPx(); + sliderView.Margin = new Extents(0, 0, 84, 0).SpToPx(); + sliderView.WidthSpecification = 640.SpToPx(); } rightView.Add(sliderView); AddPlayingListView(); @@ -1072,20 +1072,20 @@ namespace MusicPlayer.Views rightView.Remove(sliderView); if (DeviceInfo.IsPortrait) { - controlsView.Margin = new Extents(0, 0, 115, 0).DpToPx(); - sliderView.Margin = new Extents(0, 0, 0, 0).DpToPx(); + 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.DpToPx(); + topRightView.HeightSpecification = 48.SpToPx(); leftView.Add(topRightView); } else { - leftView.Padding = new Extents(0, 64, 0, 0).DpToPx(); - sliderView.Margin = new Extents(0, 0, 0, 0).DpToPx(); + leftView.Padding = new Extents(0, 64, 0, 0).SpToPx(); + sliderView.Margin = new Extents(0, 0, 0, 0).SpToPx(); sliderView.WidthSpecification = LayoutParamPolicies.MatchParent; } playerContentView.Add(sliderView); @@ -1120,7 +1120,7 @@ namespace MusicPlayer.Views thumb = new ImageView() { BackgroundColor = Color.Cyan, - Size2D = new Size2D(200, 200).DpToPx(), + Size2D = new Size2D(200, 200).SpToPx(), BoxShadow = new Shadow(6.0f, Color.Black, new Vector2(0, 3)), }; thumb.SetBinding(ImageView.ResourceUrlProperty, "ThumbnailPath"); diff --git a/music-player/Views/PlaylistSelectorView.cs b/music-player/Views/PlaylistSelectorView.cs index 2961655..4221781 100755 --- a/music-player/Views/PlaylistSelectorView.cs +++ b/music-player/Views/PlaylistSelectorView.cs @@ -49,12 +49,12 @@ namespace MusicPlayer.Views AddSelectPlaylistCancelButton(); selectPlaylistDialog = new AlertDialog() { - Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 660).DpToPx(), + Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 660).SpToPx(), Title = "Add to playlist", Content = selectPlaylistContentArea, Actions = new List { selectPlaylistCancelButton }, - Padding = new Extents(0, 0, 0, 0).DpToPx(), - Margin = new Extents(32, 32, 0, 0).DpToPx(), + Padding = new Extents(0, 0, 0, 0).SpToPx(), + Margin = new Extents(32, 32, 0, 0).SpToPx(), }; TextLabel textLabel = (TextLabel)selectPlaylistDialog.TitleContent; textLabel.FontStyle = UIFontStyles.AllNormal; @@ -72,7 +72,7 @@ namespace MusicPlayer.Views selectPlaylistContentArea = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 340.DpToPx(), + HeightSpecification = 340.SpToPx(), BackgroundColor = Color.Transparent, Layout = new FlexLayout() { @@ -95,9 +95,9 @@ namespace MusicPlayer.Views createNewPlaylistButton = new Button("PlaylistCreate") { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 108.DpToPx(), + HeightSpecification = 108.SpToPx(), TextAlignment = HorizontalAlignment.Begin, - Padding = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), IsEnabled = true, IsSelectable = false, ItemAlignment = LinearLayout.Alignment.CenterVertical, @@ -109,9 +109,9 @@ namespace MusicPlayer.Views View itemSeperator = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 2.DpToPx(), + HeightSpecification = 2.SpToPx(), BackgroundColor = UIColors.ItemSeperator, - Margin = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Margin = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }; selectPlaylistContentArea.Add(itemSeperator); createNewPlaylistButton.Clicked += CreateNewPlaylistButtonClicked; @@ -124,12 +124,12 @@ namespace MusicPlayer.Views AddCreatePlaylistButtons(); createPlaylistDialog = new AlertDialog() { - Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 465).DpToPx(), + Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 465).SpToPx(), Title = "Create playlist", Content = createPlaylistContentArea, Actions = new List { createPlaylistCancelButton, createPlaylistCreateButton }, - Padding = new Extents(0, 0, 0, 0).DpToPx(), - Margin = new Extents(32, 32, 0, 0).DpToPx(), + Padding = new Extents(0, 0, 0, 0).SpToPx(), + Margin = new Extents(32, 32, 0, 0).SpToPx(), }; TextLabel textLabel = (TextLabel)selectPlaylistDialog.TitleContent; textLabel.FontStyle = UIFontStyles.AllNormal; @@ -148,7 +148,7 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, StyleName = "ListBackground", - Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 108).DpToPx(), + Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 108).SpToPx(), ItemsLayouter = new LinearLayouter(), ScrollingDirection = ScrollableBase.Direction.Vertical, HeightSpecification = LayoutParamPolicies.WrapContent, @@ -170,16 +170,16 @@ namespace MusicPlayer.Views DefaultLinearItem layout = new DefaultLinearItem("LinearItem") { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 108.DpToPx(), + HeightSpecification = 108.SpToPx(), }; layout.Seperator.BackgroundColor = UIColors.ItemSeperator; - layout.Seperator.Padding = new Extents(0, 0, 0, 0).DpToPx(); - layout.Seperator.Margin = new Extents(0, 0, 0, 0).DpToPx(); + layout.Seperator.Padding = new Extents(0, 0, 0, 0).SpToPx(); + layout.Seperator.Margin = new Extents(0, 0, 0, 0).SpToPx(); layout.Seperator.WidthSpecification = LayoutParamPolicies.MatchParent; layout.Label.SetBinding(TextLabel.TextProperty, "PlaylistName"); layout.Label.FontStyle = UIFontStyles.NormalLight; - layout.Padding = new Extents(0, 0, 0, 0).DpToPx(); - layout.Margin = new Extents(0, 0, 0, 0).DpToPx(); + layout.Padding = new Extents(0, 0, 0, 0).SpToPx(); + layout.Margin = new Extents(0, 0, 0, 0).SpToPx(); return layout; }); collectionView.ItemsSource = viewModel.ListViewModel; @@ -224,14 +224,14 @@ namespace MusicPlayer.Views StyleName = "ItemLabel", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 108.DpToPx(), - PixelSize = 32.DpToPx(), + HeightSpecification = 108.SpToPx(), + PixelSize = 32.SpToPx(), Text = "No playlists available", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, FontFamily = "BreezeSans", FontStyle = UIFontStyles.NormalLight, - Padding = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }; selectPlaylistContentArea.Add(noListText); } @@ -239,7 +239,7 @@ namespace MusicPlayer.Views { selectPlaylistCancelButton = new Button() { - Size2D = new Size2D(336, 96).DpToPx(), + Size2D = new Size2D(336, 96).SpToPx(), Text = "Cancel", }; selectPlaylistCancelButton.TextLabel.FontStyle = UIFontStyles.AllNormal; @@ -264,14 +264,14 @@ namespace MusicPlayer.Views createPlaylistContentArea = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 169.DpToPx(), + HeightSpecification = 169.SpToPx(), BackgroundColor = Color.Transparent, Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Column, ItemsAlignment = FlexLayout.AlignmentType.FlexStart, Justification = FlexLayout.FlexJustification.FlexStart, - Padding = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(80, 80, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }, }; TextLabel textLabel = new TextLabel() @@ -279,14 +279,14 @@ namespace MusicPlayer.Views StyleName = "TitleText", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 40.DpToPx(), - PixelSize = 32.DpToPx(), + HeightSpecification = 40.SpToPx(), + PixelSize = 32.SpToPx(), Text = "Add playlist name.", HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, FontFamily = "BreezeSans", FontStyle = UIFontStyles.NormalLight, - Margin = new Extents(0, 0, 0, 24).DpToPx(), + Margin = new Extents(0, 0, 0, 24).SpToPx(), }; createPlaylistContentArea.Add(textLabel); AddInputArea(); @@ -294,7 +294,7 @@ namespace MusicPlayer.Views { BackgroundColor = UIColors.ItemSeperator, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 1.DpToPx(), + HeightSpecification = 1.SpToPx(), }; createPlaylistContentArea.Add(itemSeperator); underText = new TextLabel() @@ -302,8 +302,8 @@ namespace MusicPlayer.Views StyleName = "ItemLabel", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 32.DpToPx(), - PixelSize = 24.DpToPx(), + HeightSpecification = 32.SpToPx(), + PixelSize = 24.SpToPx(), Text = "Can't enter more than 64 characters.", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -317,7 +317,7 @@ namespace MusicPlayer.Views { inputArea = new View() { - Size2D = new Size2D((DeviceInfo.IsPortrait ? 856 : 1024), 48).DpToPx(), + Size2D = new Size2D((DeviceInfo.IsPortrait ? 856 : 1024), 48).SpToPx(), Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Row, @@ -329,10 +329,10 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, StyleName = "TextField", - PixelSize = 32.DpToPx(), - Size2D = new Size2D((DeviceInfo.IsPortrait ? 808 : 928), 48).DpToPx(), - Position2D = new Position2D(0, 0).DpToPx(), - Margin = new Extents(0, (ushort)(DeviceInfo.IsPortrait ? 0 : 48), 0, 0).DpToPx(), + PixelSize = 32.SpToPx(), + Size2D = new Size2D((DeviceInfo.IsPortrait ? 808 : 928), 48).SpToPx(), + Position2D = new Position2D(0, 0).SpToPx(), + Margin = new Extents(0, (ushort)(DeviceInfo.IsPortrait ? 0 : 48), 0, 0).SpToPx(), FontStyle = UIFontStyles.NormalLight, MaxLength = 65, }; @@ -342,7 +342,7 @@ namespace MusicPlayer.Views crossButton = new Button("ClearButton") { ThemeChangeSensitive = true, - Position2D = new Position2D((DeviceInfo.IsPortrait ? 808 : 976), 6).DpToPx(), + Position2D = new Position2D((DeviceInfo.IsPortrait ? 808 : 976), 6).SpToPx(), }; crossButton.Clicked += (object o, ClickedEventArgs e) => { @@ -391,7 +391,7 @@ namespace MusicPlayer.Views createPlaylistCreateButton = new Button() { - Size2D = new Size2D(336, 96).DpToPx(), + Size2D = new Size2D(336, 96).SpToPx(), Text = "Create", }; createPlaylistCreateButton.TextLabel.FontStyle = UIFontStyles.AllNormal; diff --git a/music-player/Views/PlaylistView.cs b/music-player/Views/PlaylistView.cs index 57d191d..920afb3 100755 --- a/music-player/Views/PlaylistView.cs +++ b/music-player/Views/PlaylistView.cs @@ -38,7 +38,7 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 28.DpToPx(), + PixelSize = 28.SpToPx(), Text = "Playlist COUNT", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -56,7 +56,7 @@ namespace MusicPlayer.Views playlistCreateButton = new Button("PlaylistAdd") { ThemeChangeSensitive = true, - Margin = new Extents(40, 0, 0, 0).DpToPx(), + Margin = new Extents(40, 0, 0, 0).SpToPx(), }; playlistCreateButton.BindingContext = viewModel; playlistCreateButton.SetBinding(Button.IsEnabledProperty, "CanCreatePlaylist"); @@ -121,7 +121,7 @@ namespace MusicPlayer.Views Name = "AlertDialogTitle", StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 40.DpToPx(), + PixelSize = 40.SpToPx(), FontFamily = "BreezeSans", FontStyle = UIFontStyles.AllNormal, Text = "Create playlist", @@ -139,12 +139,12 @@ namespace MusicPlayer.Views Name = "AlertDialogContentMessage", StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 32.DpToPx(), + PixelSize = 32.SpToPx(), FontFamily = "BreezeSans", FontStyle = UIFontStyles.NormalLight, Text = "Add playlist name", WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 40.DpToPx(), + HeightSpecification = 40.SpToPx(), HorizontalAlignment = HorizontalAlignment.Center, }; return contentLabel; @@ -158,7 +158,7 @@ namespace MusicPlayer.Views PlaceholderText = "Enter Playlist Name", Text = DefaultPlaylistName, HorizontalAlignment = HorizontalAlignment.Begin, - PixelSize = 32.DpToPx(), + PixelSize = 32.SpToPx(), }; return inputTextField; } @@ -169,7 +169,7 @@ namespace MusicPlayer.Views { Name = "AlertDialogClearButton", ThemeChangeSensitive = true, - Margin = new Extents(48, 0, 0, 0).DpToPx(), + Margin = new Extents(48, 0, 0, 0).SpToPx(), }; return clearButton; } @@ -181,8 +181,8 @@ namespace MusicPlayer.Views Name = "AlertDialogInputArea", BackgroundColor = Color.Transparent, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 48.DpToPx(), - Margin = new Extents(0, 0, 24, 0).DpToPx(), + HeightSpecification = 48.SpToPx(), + Margin = new Extents(0, 0, 24, 0).SpToPx(), Layout = new RelativeLayout() }; return inputArea; @@ -194,14 +194,14 @@ namespace MusicPlayer.Views { Name = "AlertDialogContent", WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 116.DpToPx(), + HeightSpecification = 116.SpToPx(), BackgroundColor = Color.Transparent, Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Top, - Margin = new Extents(0, 0, 40, 24).DpToPx(), + Margin = new Extents(0, 0, 40, 24).SpToPx(), } }; return contentArea; @@ -222,7 +222,7 @@ namespace MusicPlayer.Views { Button createButton = new Button() { - Size2D = new Size2D(336, 96).DpToPx(), + Size2D = new Size2D(336, 96).SpToPx(), Name = "AlertDialogCreateButton", Text = "Create", }; @@ -269,7 +269,7 @@ namespace MusicPlayer.Views { Name = "InputLineView", StyleName = "InputLine", - HeightSpecification = 2.DpToPx(), + HeightSpecification = 2.SpToPx(), WidthSpecification = LayoutParamPolicies.MatchParent, }; return view; @@ -280,11 +280,11 @@ namespace MusicPlayer.Views View buttonArea = new View() { BackgroundColor = Color.Transparent, - HeightSpecification = 96.DpToPx(), + HeightSpecification = 96.SpToPx(), WidthSpecification = LayoutParamPolicies.MatchParent, Layout = new RelativeLayout() { - Margin = new Extents(0, 0, 64, 0).DpToPx(), + Margin = new Extents(0, 0, 64, 0).SpToPx(), } }; return buttonArea; @@ -340,12 +340,12 @@ namespace MusicPlayer.Views StyleName = "Dialogs", //FixMe : Here WidthSpecification in portrait mode should be 1016 but that cause the // AlertDialog to fill Full width of window but keeping width 952 is showing correclty - WidthSpecification = (DeviceInfo.IsPortrait ? 952 : 1184).DpToPx(), - HeightSpecification = 466.DpToPx(), + WidthSpecification = (DeviceInfo.IsPortrait ? 952 : 1184).SpToPx(), + HeightSpecification = 466.SpToPx(), Layout = new LinearLayout() { - Padding = new Extents(80, 80, 40, 40).DpToPx(), - Margin = new Extents(32, 32, 0, 0).DpToPx(), + Padding = new Extents(80, 80, 40, 40).SpToPx(), + Margin = new Extents(32, 32, 0, 0).SpToPx(), LinearOrientation = LinearLayout.Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Top, diff --git a/music-player/Views/SearchView.cs b/music-player/Views/SearchView.cs index 434d11c..3177690 100755 --- a/music-player/Views/SearchView.cs +++ b/music-player/Views/SearchView.cs @@ -42,7 +42,7 @@ namespace MusicPlayer.Views Direction = FlexLayout.FlexDirection.Column, ItemsAlignment = FlexLayout.AlignmentType.FlexStart, Justification = FlexLayout.FlexJustification.FlexStart, - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }; AddTopView(); AddTopViewElements(); @@ -65,7 +65,7 @@ namespace MusicPlayer.Views { BackgroundColor = Color.Transparent, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 120.DpToPx(), + HeightSpecification = 120.SpToPx(), Layout = new RelativeLayout(), }; base.Add(topView); @@ -76,8 +76,8 @@ namespace MusicPlayer.Views backButton = new Button("BackButton") { ThemeChangeSensitive = true, - Size2D = new Size2D(48, 48).DpToPx(), - Margin = new Extents(0, 24, 0, 0).DpToPx(), + Size2D = new Size2D(48, 48).SpToPx(), + Margin = new Extents(0, 24, 0, 0).SpToPx(), }; topView.Add(backButton); RelativeLayout.SetLeftTarget(backButton, topView); @@ -90,11 +90,11 @@ namespace MusicPlayer.Views { StyleName = "PageLabel", ThemeChangeSensitive = true, - HeightSpecification = 48.DpToPx(), + HeightSpecification = 48.SpToPx(), Text = "Search", - PixelSize = 36.DpToPx(), + PixelSize = 36.SpToPx(), FontFamily = "BreezeSans", - Margin = new Extents(0, 32, 0, 0).DpToPx(), + Margin = new Extents(0, 32, 0, 0).SpToPx(), VerticalAlignment = VerticalAlignment.Center, FontStyle = UIFontStyles.NormalLight, }; @@ -111,8 +111,8 @@ namespace MusicPlayer.Views { StyleName = "SearchBox", ThemeChangeSensitive = true, - Size2D = new Size2D(648, 60).DpToPx(), - Margin = new Extents(0, 32, 0, 0).DpToPx(), + Size2D = new Size2D(648, 60).SpToPx(), + Margin = new Extents(0, 32, 0, 0).SpToPx(), Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Row, @@ -125,19 +125,19 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, Name = "searchbutton", - Margin = new Extents(24, 0, 10, 10).DpToPx(), - Position2D = new Position2D(24, 10).DpToPx(), + Margin = new Extents(24, 0, 10, 10).SpToPx(), + Position2D = new Position2D(24, 10).SpToPx(), }; textField = new TextField() { StyleName = "TextField", ThemeChangeSensitive = true, Name ="Textfield", - Size2D = new Size2D(460, 40).DpToPx(), + Size2D = new Size2D(460, 40).SpToPx(), BackgroundColor = Color.Transparent, - Position2D = new Position2D(88, 10).DpToPx(), - Margin = new Extents(24, 0, 10, 10).DpToPx(), - PixelSize = 32.DpToPx(), + Position2D = new Position2D(88, 10).SpToPx(), + Margin = new Extents(24, 0, 10, 10).SpToPx(), + PixelSize = 32.SpToPx(), PlaceholderText = "Type Here", PlaceholderTextFocused = "Search music", }; @@ -147,8 +147,8 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, Name = "crossButton", - Margin = new Extents(24, 0, 6, 6).DpToPx(), - Position2D = new Position2D(572, 6).DpToPx(), + Margin = new Extents(24, 0, 6, 6).SpToPx(), + Position2D = new Position2D(572, 6).SpToPx(), }; crossButton.Clicked += CrossButtonClicked; @@ -289,13 +289,13 @@ namespace MusicPlayer.Views Direction = FlexLayout.FlexDirection.Column, ItemsAlignment = FlexLayout.AlignmentType.Center, Justification = FlexLayout.FlexJustification.FlexStart, - Padding = (DeviceInfo.IsPortrait ? new Extents(0, 0, 482, 0) : new Extents(0, 0, 40, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(0, 0, 482, 0) : new Extents(0, 0, 40, 0)).SpToPx(), } }; noItemsAnimation = new LottieAnimationView() { URL = Resources.GetLottiePath() + "search_no_result.json", - Size2D = new Size2D(264, 292).DpToPx(), + Size2D = new Size2D(264, 292).SpToPx(), LoopCount = -1, BackgroundColor = Color.Transparent, }; @@ -304,12 +304,12 @@ namespace MusicPlayer.Views { StyleName = "TitleText", WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 36.DpToPx(), + HeightSpecification = 36.SpToPx(), Text = "No results found", - PixelSize = 28.DpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Center, - Margin = new Extents(0, 0, 32, 0).DpToPx(), + Margin = new Extents(0, 0, 32, 0).SpToPx(), }; noItemView.Add(textLabel); } diff --git a/music-player/Views/SelectListLayout.cs b/music-player/Views/SelectListLayout.cs index ec3757d..e034f28 100755 --- a/music-player/Views/SelectListLayout.cs +++ b/music-player/Views/SelectListLayout.cs @@ -21,17 +21,17 @@ namespace MusicPlayer.Views { OnInitialize(); WidthSpecification = LayoutParamPolicies.MatchParent; - HeightSpecification = 108.DpToPx(); + HeightSpecification = 108.SpToPx(); Layout = new RelativeLayout() { - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }; BackgroundColor = Color.Transparent; checkBox = new CheckBox("CheckBox"); checkBox.Icon.Opacity = 1.0f; - checkBox.Icon.Size = new Size2D(BoxSize, BoxSize).DpToPx(); + checkBox.Icon.Size = new Size2D(BoxSize, BoxSize).SpToPx(); Add(checkBox); RelativeLayout.SetVerticalAlignment(checkBox, RelativeLayout.Alignment.Center); RelativeLayout.SetHorizontalAlignment(checkBox, RelativeLayout.Alignment.Start); @@ -39,9 +39,9 @@ namespace MusicPlayer.Views icon = new ImageView() { - WidthSpecification = IconSize.DpToPx(), - HeightSpecification = IconSize.DpToPx(), - Margin = new Extents(32, 0, 0, 0).DpToPx(), + WidthSpecification = IconSize.SpToPx(), + HeightSpecification = IconSize.SpToPx(), + Margin = new Extents(32, 0, 0, 0).SpToPx(), }; Add(icon); RelativeLayout.SetLeftTarget(icon, checkBox); @@ -51,13 +51,13 @@ namespace MusicPlayer.Views textView = new View() { BackgroundColor = Color.Transparent, - HeightSpecification = 76.DpToPx(), + HeightSpecification = 76.SpToPx(), Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Top, - Margin = new Extents(32, 0, 0, 0).DpToPx(), + Margin = new Extents(32, 0, 0, 0).SpToPx(), } }; Add(textView); @@ -71,8 +71,8 @@ namespace MusicPlayer.Views { StyleName = "ItemLabel", WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 40.DpToPx(), - PixelSize = 32.DpToPx(), + HeightSpecification = 40.SpToPx(), + PixelSize = 32.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -85,8 +85,8 @@ namespace MusicPlayer.Views { StyleName = "ItemLabel", WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 36.DpToPx(), - PixelSize = 28.DpToPx(), + HeightSpecification = 36.SpToPx(), + PixelSize = 28.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -98,7 +98,7 @@ namespace MusicPlayer.Views itemSeperator = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 2.DpToPx(), + HeightSpecification = 2.SpToPx(), BackgroundColor = UIColors.ItemSeperator, }; Add(itemSeperator); diff --git a/music-player/Views/SelectorView.cs b/music-player/Views/SelectorView.cs index 1c92dec..3e0ff2a 100755 --- a/music-player/Views/SelectorView.cs +++ b/music-player/Views/SelectorView.cs @@ -49,7 +49,7 @@ namespace MusicPlayer.Views Direction = FlexLayout.FlexDirection.Column, ItemsAlignment = FlexLayout.AlignmentType.FlexStart, Justification = FlexLayout.FlexJustification.FlexStart, - Padding = (DeviceInfo.IsPortrait ? new Extents(PortraitPadding ,PortraitPadding, 0, 0) : new Extents(LayoutPadding, LayoutPadding, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(PortraitPadding ,PortraitPadding, 0, 0) : new Extents(LayoutPadding, LayoutPadding, 0, 0)).SpToPx(), }; topView = AddTopView(); @@ -87,7 +87,7 @@ namespace MusicPlayer.Views { BackgroundColor = Color.Transparent, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 120.DpToPx(), + HeightSpecification = 120.SpToPx(), Layout = new RelativeLayout(), }; base.Add(topView); @@ -99,8 +99,8 @@ namespace MusicPlayer.Views selectedCountLabel = new TextLabel() { StyleName = "TitleText", - HeightSpecification = 48.DpToPx(), - PixelSize = 36.DpToPx(), + HeightSpecification = 48.SpToPx(), + PixelSize = 36.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -119,7 +119,7 @@ namespace MusicPlayer.Views private void AddButtons() { doneButton = CreateButton("Done"); - doneButton.Margin = new Extents(40, 0, 0, 0).DpToPx(); + doneButton.Margin = new Extents(40, 0, 0, 0).SpToPx(); topView.Add(doneButton); doneButton.Clicked += (object o, ClickedEventArgs args) => { @@ -132,7 +132,7 @@ namespace MusicPlayer.Views RelativeLayout.SetVerticalAlignment(doneButton, RelativeLayout.Alignment.Center); cancelButton = CreateButton("Cancel"); - cancelButton.Margin = new Extents(40, 0, 0, 0).DpToPx(); + cancelButton.Margin = new Extents(40, 0, 0, 0).SpToPx(); cancelButton.IsEnabled = true; topView.Add(cancelButton); cancelButton.Clicked += (object o, ClickedEventArgs args) => @@ -213,14 +213,14 @@ namespace MusicPlayer.Views StyleName = "SelectAllBg", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 108.DpToPx(), - Margin = new Extents(0, 0, 0, 40).DpToPx(), + HeightSpecification = 108.SpToPx(), + Margin = new Extents(0, 0, 0, 40).SpToPx(), Layout = new LinearLayout { LinearOrientation= LinearLayout.Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, - Padding = (DeviceInfo.IsPortrait ? new Extents(PortraitPadding, PortraitPadding, 34, 34) : new Extents(LayoutPadding, LayoutPadding, 34, 34)).DpToPx() + Padding = (DeviceInfo.IsPortrait ? new Extents(PortraitPadding, PortraitPadding, 34, 34) : new Extents(LayoutPadding, LayoutPadding, 34, 34)).SpToPx() }, }; base.Add(selAllView); @@ -231,8 +231,8 @@ namespace MusicPlayer.Views { selAllButton = new CheckBox() { - Size2D = new Size2D(36, 36).DpToPx(), - Margin = new Extents(0, 32, 2, 2).DpToPx(), + Size2D = new Size2D(36, 36).SpToPx(), + Margin = new Extents(0, 32, 2, 2).SpToPx(), }; selAllView.Add(selAllButton); selAllButton.Clicked += OnSelAllClicked; @@ -241,8 +241,8 @@ namespace MusicPlayer.Views { StyleName ="LabelText", Text = "Select All", - HeightSpecification = 40.DpToPx(), - PixelSize = 32.DpToPx(), + HeightSpecification = 40.SpToPx(), + PixelSize = 32.SpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, diff --git a/music-player/Views/TrackDetailView.cs b/music-player/Views/TrackDetailView.cs index 6fd92f6..0515245 100755 --- a/music-player/Views/TrackDetailView.cs +++ b/music-player/Views/TrackDetailView.cs @@ -95,7 +95,7 @@ namespace MusicPlayer.Views BackgroundColor = Color.Transparent, WidthSpecification = LayoutParamPolicies.MatchParent, HeightSpecification = LayoutParamPolicies.MatchParent, - Margin = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 64) : new Extents(64, 64, 0, 32)).DpToPx(), + Margin = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 64) : new Extents(64, 64, 0, 32)).SpToPx(), ScrollingDirection = ScrollableBase.Direction.Vertical, Layout = new LinearLayout(), }; @@ -123,14 +123,14 @@ namespace MusicPlayer.Views navigationContent = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 120.DpToPx(), + HeightSpecification = 120.SpToPx(), BackgroundColor = Color.Transparent, Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Horizontal, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, - CellPadding = new Size2D(24, 0).DpToPx() + CellPadding = new Size2D(24, 0).SpToPx() }, }; backButton = new Button("BackButton"); @@ -145,7 +145,7 @@ namespace MusicPlayer.Views StyleName = "PageLabel", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, - PixelSize = 40.DpToPx(), + PixelSize = 40.SpToPx(), FontFamily = "BreezeSans", FontStyle = UIFontStyles.AllNormal, Text = "Details", @@ -163,7 +163,7 @@ namespace MusicPlayer.Views { BackgroundColor = Color.Transparent, NavigationContent = CreateNavigationContent(), - Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Padding = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), }, Content = CreateContent(), }; @@ -176,24 +176,24 @@ namespace MusicPlayer.Views { BackgroundColor = Color.Transparent, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 108.DpToPx(), + HeightSpecification = 108.SpToPx(), BindingContext = viewModel.Model, Layout = new RelativeLayout() { - Margin = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).DpToPx(), + Margin = (DeviceInfo.IsPortrait ? new Extents(32, 32, 0, 0) : new Extents(64, 64, 0, 0)).SpToPx(), } }; View textArea = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 76.DpToPx(), + HeightSpecification = 76.SpToPx(), Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Top, - Margin = new Extents(0, 0, 16, 16).DpToPx(), + Margin = new Extents(0, 0, 16, 16).SpToPx(), }, }; view.Add(textArea); @@ -203,7 +203,7 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 40.DpToPx(), + HeightSpecification = 40.SpToPx(), StyleName = "DetailTitle", FontStyle = UIFontStyles.NormalLight, Text = title, @@ -216,7 +216,7 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 36.DpToPx(), + HeightSpecification = 36.SpToPx(), StyleName = "DetailSubTitle", FontStyle = UIFontStyles.AllNormal, HorizontalAlignment = HorizontalAlignment.Begin, @@ -229,7 +229,7 @@ namespace MusicPlayer.Views { BackgroundColor = UIColors.HEXC3CAD2, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 2.DpToPx(), + HeightSpecification = 2.SpToPx(), }; view.Add(itemSeparator); RelativeLayout.SetVerticalAlignment(itemSeparator, RelativeLayout.Alignment.End); diff --git a/music-player/Views/TrackView.cs b/music-player/Views/TrackView.cs index 762dfb3..d06a227 100755 --- a/music-player/Views/TrackView.cs +++ b/music-player/Views/TrackView.cs @@ -42,7 +42,7 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 28.DpToPx(), + PixelSize = 28.SpToPx(), Text = "TRACK COUNT", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -72,7 +72,7 @@ namespace MusicPlayer.Views playAllWithShuffle = new Button("ShuffleButton") { ThemeChangeSensitive = true, - Margin = new Extents(32, 40, 0, 0).DpToPx(), + Margin = new Extents(32, 40, 0, 0).SpToPx(), }; titleView.Add(playAllWithShuffle); playAllWithShuffle.Clicked += (object sender, ClickedEventArgs e) => diff --git a/music-player/Views/Utils/ErrorPopup.cs b/music-player/Views/Utils/ErrorPopup.cs index 846bf42..8da2cc0 100755 --- a/music-player/Views/Utils/ErrorPopup.cs +++ b/music-player/Views/Utils/ErrorPopup.cs @@ -15,11 +15,11 @@ namespace MusicPlayer.Views.Utils AddOkButton(); errorDialog = new AlertDialog() { - Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 368).DpToPx(), + Size2D = new Size2D((DeviceInfo.IsPortrait ? 1016 : 1184), 368).SpToPx(), Title = "Unable to play track", Message = "", Actions = new List { okButton }, - Margin = new Extents(32, 32, 0, 0).DpToPx(), + Margin = new Extents(32, 32, 0, 0).SpToPx(), }; TextLabel textLabel = (TextLabel)errorDialog.TitleContent; diff --git a/music-player/Views/ViewManager.cs b/music-player/Views/ViewManager.cs index ce6ef12..0508d55 100755 --- a/music-player/Views/ViewManager.cs +++ b/music-player/Views/ViewManager.cs @@ -16,7 +16,6 @@ namespace MusicPlayer.Views private readonly ViewLibrary viewLibrary; private View rootView; private BaseView baseView; - private View miniPlayer; private static readonly string[] TabNames = new string[] { "Playlists", diff --git a/music-player/res/themes/dark.xaml b/music-player/res/themes/dark.xaml index 64aee73..0b0febc 100755 --- a/music-player/res/themes/dark.xaml +++ b/music-player/res/themes/dark.xaml @@ -15,13 +15,13 @@ Id="DarkTheme"> - + - + - + @@ -31,7 +31,7 @@ Id="DarkTheme"> - + @@ -41,7 +41,7 @@ Id="DarkTheme"> - + @@ -51,7 +51,7 @@ Id="DarkTheme"> - + @@ -61,7 +61,7 @@ Id="DarkTheme"> - + @@ -71,7 +71,7 @@ Id="DarkTheme"> - + @@ -81,7 +81,7 @@ Id="DarkTheme"> - + @@ -91,7 +91,7 @@ Id="DarkTheme"> - + @@ -101,7 +101,7 @@ Id="DarkTheme"> - + @@ -111,7 +111,7 @@ Id="DarkTheme"> - + *Resource*/images/empty_track.png @@ -131,7 +131,7 @@ Id="DarkTheme"> - + @@ -141,7 +141,7 @@ Id="DarkTheme"> - + @@ -151,7 +151,7 @@ Id="DarkTheme"> - + *Resource*/images/dark/search_icon.png @@ -159,11 +159,11 @@ Id="DarkTheme"> - + *Resource*/images/dark/left_sound_icon.png - + *Resource*/images/dark/right_sound_icon.png @@ -179,16 +179,16 @@ Id="DarkTheme"> - + *Resource*/images/dark/cancel_button_bg.png - + - + - + @@ -196,7 +196,7 @@ Id="DarkTheme"> - + *Resource*/images/dark/cross_button.png @@ -204,7 +204,7 @@ Id="DarkTheme"> - + @@ -216,14 +216,14 @@ Id="DarkTheme"> - + - + - + *Resource*/images/dark/search_icon.png @@ -233,13 +233,13 @@ Id="DarkTheme"> - + - + @@ -247,8 +247,8 @@ Id="DarkTheme"> - - + + diff --git a/music-player/res/themes/light.xaml b/music-player/res/themes/light.xaml index 44c3451..17dee37 100755 --- a/music-player/res/themes/light.xaml +++ b/music-player/res/themes/light.xaml @@ -15,13 +15,13 @@ Id="LightTheme"> - + - + - + @@ -31,7 +31,7 @@ Id="LightTheme"> - + @@ -41,7 +41,7 @@ Id="LightTheme"> - + @@ -51,7 +51,7 @@ Id="LightTheme"> - + @@ -61,7 +61,7 @@ Id="LightTheme"> - + @@ -71,7 +71,7 @@ Id="LightTheme"> - + @@ -81,7 +81,7 @@ Id="LightTheme"> - + @@ -91,7 +91,7 @@ Id="LightTheme"> - + @@ -101,7 +101,7 @@ Id="LightTheme"> - + @@ -111,7 +111,7 @@ Id="LightTheme"> - + *Resource*/images/empty_track.png @@ -131,7 +131,7 @@ Id="LightTheme"> - + @@ -141,7 +141,7 @@ Id="LightTheme"> - + @@ -151,7 +151,7 @@ Id="LightTheme"> - + *Resource*/images/light/search_icon.png @@ -159,11 +159,11 @@ Id="LightTheme"> - + *Resource*/images/light/left_sound_icon.png - + *Resource*/images/light/right_sound_icon.png @@ -179,16 +179,16 @@ Id="LightTheme"> - + *Resource*/images/light/cancel_button_bg.png - + - + - + @@ -196,7 +196,7 @@ Id="LightTheme"> - + *Resource*/images/light/cross_button.png @@ -204,7 +204,7 @@ Id="LightTheme"> - + @@ -216,14 +216,14 @@ Id="LightTheme"> - + - + - + *Resource*/images/light/search_icon.png @@ -233,13 +233,13 @@ Id="LightTheme"> - + - + @@ -247,8 +247,8 @@ Id="LightTheme"> - - + +