From: aman.jeph Date: Mon, 31 Jan 2022 11:40:39 +0000 (+0530) Subject: DpToPx changes for Views, Required for Scalable Support X-Git-Tag: submit/tizen/20220405.085546~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=289f7ed9f1d052038ec0d345e20e99c559078a3d;p=profile%2Fiot%2Fapps%2Fdotnet%2Fmusic-player.git DpToPx changes for Views, Required for Scalable Support Change-Id: I3ed713ee57ef4d9230452a4160e5c6c94eb126a7 Signed-off-by: aman.jeph --- diff --git a/music-player/Views/AlbumDetailLayout.cs b/music-player/Views/AlbumDetailLayout.cs index 48fb027..cd6ea48 100755 --- a/music-player/Views/AlbumDetailLayout.cs +++ b/music-player/Views/AlbumDetailLayout.cs @@ -37,10 +37,9 @@ namespace MusicPlayer.Views public AlbumDetailLayout(int width = 832, int height = 108) : base() { base.OnInitialize(); - base.IsCreateByXaml = true; WidthSpecification = width; HeightSpecification = height; - Size2D = new Size2D(width, height); + Size2D = new Size2D(width, height).DpToPx(); // to show the rounded rect of the bg BackgroundColor = Color.Transparent; @@ -56,14 +55,14 @@ namespace MusicPlayer.Views { TextLabel titleLabel = new TextLabel() { - Size2D = new Size2D(596, 40), - PixelSize = 32, + Size2D = new Size2D(596, 40).DpToPx(), + PixelSize = 32.DpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, - Padding=new Extents(LayoutPadding,0,0,0), + Padding = new Extents(LayoutPadding,0,0,0).DpToPx(), FontStyle = UIFontStyles.NormalLight, - Position2D = new Position2D(X , LayoutMargin), + Position2D = new Position2D(X , LayoutMargin).DpToPx(), }; base.Add(titleLabel); return titleLabel; @@ -73,14 +72,14 @@ namespace MusicPlayer.Views { TextLabel subtitleLabel = new TextLabel() { - Size2D= new Size2D(596,36), - PixelSize = 28, + Size2D= new Size2D(596,36).DpToPx(), + PixelSize = 28.DpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, - Padding = new Extents(LayoutPadding, 0, 0, 0), + Padding = new Extents(LayoutPadding, 0, 0, 0).DpToPx(), FontStyle = UIFontStyles.AllNormal, - Position2D = new Position2D(X , LayoutMargin + 40) + Position2D = new Position2D(X, LayoutMargin + 40).DpToPx() }; base.Add(subtitleLabel); return subtitleLabel; @@ -90,13 +89,13 @@ namespace MusicPlayer.Views { TextLabel additionalLabel = new TextLabel() { - Size2D= new Size2D(108,36), - PixelSize = 28, + Size2D= new Size2D(108,36).DpToPx(), + PixelSize = 28.DpToPx(), FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.End, FontStyle = UIFontStyles.AllNormal, - Position2D = new Position2D(width-LayoutPadding-LeftPadding-108, 36) + Position2D = new Position2D(width-LayoutPadding-LeftPadding-108, 36).DpToPx() }; base.Add(additionalLabel); return additionalLabel; @@ -106,9 +105,9 @@ namespace MusicPlayer.Views { View itemSeperator = new View() { - Size2D = new Size2D(width, SeperatorHeight), + Size2D = new Size2D(width, SeperatorHeight).DpToPx(), ExcludeLayouting = true, - Position2D = new Position2D(X , height - SeperatorHeight), + Position2D = new Position2D(X , height - SeperatorHeight).DpToPx(), BackgroundColor = UIColors.ItemSeperator, }; base.Add(itemSeperator); diff --git a/music-player/Views/AlbumView.cs b/music-player/Views/AlbumView.cs index 96d3b68..e5cd4bb 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, + PixelSize = 28.DpToPx(), Text = "ALBUM COUNT", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, diff --git a/music-player/Views/ArtistDetailGroupLayout.cs b/music-player/Views/ArtistDetailGroupLayout.cs index aeefd2f..b3d75f2 100755 --- a/music-player/Views/ArtistDetailGroupLayout.cs +++ b/music-player/Views/ArtistDetailGroupLayout.cs @@ -28,7 +28,7 @@ namespace MusicPlayer.Views Height = height; WidthSpecification = Width; HeightSpecification = Height; - Size2D = new Size2D(Width, Height); + Size2D = new Size2D(Width, Height).DpToPx(); // to show the rounded rect of the bg BackgroundColor = Color.Transparent; ThemeChangeSensitive = true; @@ -43,9 +43,8 @@ namespace MusicPlayer.Views { ImageView icon = new ImageView() { - Size2D = new Size2D(IconSize, IconSize), - IsCreateByXaml = true, - Position2D = new Position2D(x, (Height / 2) - (IconSize / 2)), + Size2D = new Size2D(IconSize, IconSize).DpToPx(), + Position2D = new Position2D(x, (Height / 2) - (IconSize / 2)).DpToPx(), }; base.Add(icon); return icon; @@ -55,9 +54,9 @@ namespace MusicPlayer.Views { View itemSeperator = new View() { - Size2D = new Size2D((Width - (2 * LeftPadding)), SeperatorHeight), + Size2D = new Size2D((Width - (2 * LeftPadding)), SeperatorHeight).DpToPx(), ExcludeLayouting = true, - Position2D = new Position2D(x, Height - SeperatorHeight), + Position2D = new Position2D(x, Height - SeperatorHeight).DpToPx(), BackgroundColor = UIColors.ItemSeperator, }; base.Add(itemSeperator); @@ -70,12 +69,11 @@ namespace MusicPlayer.Views { StyleName = "ItemLabel", ThemeChangeSensitive = true, - Size2D = new Size2D((Width - (2 * LeftPadding) - IconSize - LayoutPadding), 40), - PixelSize = 32, + Size2D = new Size2D((Width - (2 * LeftPadding) - IconSize - LayoutPadding), 40).DpToPx(), + PixelSize = 32.DpToPx(), FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, - IsCreateByXaml = true, - Position2D = new Position2D(x + IconSize + LayoutPadding, 34), + Position2D = new Position2D(x + IconSize + LayoutPadding, 34).DpToPx(), }; base.Add(titleLabel); return titleLabel; diff --git a/music-player/Views/ArtistDetailItemLayout.cs b/music-player/Views/ArtistDetailItemLayout.cs index 884dc45..8ca7839 100755 --- a/music-player/Views/ArtistDetailItemLayout.cs +++ b/music-player/Views/ArtistDetailItemLayout.cs @@ -42,7 +42,7 @@ namespace MusicPlayer.Views Height = height; WidthSpecification = Width; HeightSpecification = Height; - Size2D = new Size2D(Width, Height); + Size2D = new Size2D(Width, Height).DpToPx(); // to show the rounded rect of the bg BackgroundColor = Color.Transparent; @@ -57,9 +57,9 @@ namespace MusicPlayer.Views { View itemSeperator = new View() { - Size2D = new Size2D((Width - (2 * LeftPadding)), SeperatorHeight), + Size2D = new Size2D((Width - (2 * LeftPadding)), SeperatorHeight).DpToPx(), ExcludeLayouting = true, - Position2D = new Position2D(x, Height - SeperatorHeight), + Position2D = new Position2D(x, Height - SeperatorHeight).DpToPx(), BackgroundColor = UIColors.ItemSeperator, }; base.Add(itemSeperator); @@ -70,13 +70,13 @@ namespace MusicPlayer.Views { TextLabel titleLabel = new TextLabel() { - Size2D = new Size2D(1272, 40), - PixelSize = 32, + Size2D = new Size2D(1272, 40).DpToPx(), + PixelSize = 32.DpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, FontStyle = UIFontStyles.NormalLight, - Position2D = new Position2D(x, 34), + Position2D = new Position2D(x, 34).DpToPx(), }; base.Add(titleLabel); return titleLabel; @@ -86,13 +86,13 @@ namespace MusicPlayer.Views { TextLabel extraLabel = new TextLabel() { - Size2D = new Size2D(360, 36), - PixelSize = 28, + Size2D = new Size2D(360, 36).DpToPx(), + PixelSize = 28.DpToPx(), FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.End, FontStyle = UIFontStyles.AllNormal, - Position2D = new Position2D((x + 1272 + LayoutPadding), 36) + Position2D = new Position2D((x + 1272 + LayoutPadding), 36).DpToPx() }; base.Add(extraLabel); return extraLabel; diff --git a/music-player/Views/ArtistView.cs b/music-player/Views/ArtistView.cs index 1e7341a..c498cb3 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, + PixelSize = 28.DpToPx(), Text = "ARTIST COUNT", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, diff --git a/music-player/Views/BaseContentView.cs b/music-player/Views/BaseContentView.cs index edb9cd9..9708f76 100755 --- a/music-player/Views/BaseContentView.cs +++ b/music-player/Views/BaseContentView.cs @@ -35,10 +35,10 @@ namespace MusicPlayer.Views HeightResizePolicy = ResizePolicyType.FillToParent, HeightSpecification = LayoutParamPolicies.MatchParent, WidthSpecification = LayoutParamPolicies.MatchParent, - Layout = new FlexLayout() + Layout = new LinearLayout() { - Direction = FlexLayout.FlexDirection.Column, - Padding = new Extents(64, 64, 0, 0), + LinearOrientation = LinearLayout.Orientation.Vertical, + Padding = new Extents(64, 64, 0, 0).DpToPx(), }, }; base.Add(contentViewContainer); @@ -47,21 +47,19 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 60, + HeightSpecification = 60.DpToPx(), Layout = new RelativeLayout() { - Padding = new Extents(0, 0, 6, 6), + Padding = new Extents(0, 0, 6, 6).DpToPx(), }, }; contentViewContainer.Add(titleView); - FlexLayout.SetFlexGrow(titleView, 0); - FlexLayout.SetFlexShrink(titleView, 0); collectionView = new CollectionView() { ThemeChangeSensitive = true, StyleName = "ListBackground", - Size2D = new Size2D(1792, 108), + Size2D = new Size2D(1792, 108).DpToPx(), Margin = new Extents(0, 0, 0, 2), ItemsLayouter = new LinearLayouter(), ScrollingDirection = ScrollableBase.Direction.Vertical, @@ -78,8 +76,6 @@ namespace MusicPlayer.Views collectionView.HideScrollbar = true; }; contentViewContainer.Add(collectionView); - FlexLayout.SetFlexGrow(collectionView, 1); - FlexLayout.SetFlexShrink(collectionView, 1); subContentViewContainer = new View() { diff --git a/music-player/Views/BaseSubContentView.cs b/music-player/Views/BaseSubContentView.cs index c2c65b0..364a76a 100755 --- a/music-player/Views/BaseSubContentView.cs +++ b/music-player/Views/BaseSubContentView.cs @@ -34,8 +34,8 @@ namespace MusicPlayer.Views Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, - LinearAlignment = LinearLayout.Alignment.Top, - Padding = new Extents(64, 64, 0, 0), + VerticalAlignment = VerticalAlignment.Top, + Padding = new Extents(64, 64, 0, 0).DpToPx(), }, BackgroundColor = Color.Transparent, WidthResizePolicy = ResizePolicyType.FillToParent, @@ -46,10 +46,10 @@ namespace MusicPlayer.Views topView = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 60, + HeightSpecification = 60.DpToPx(), Layout = new RelativeLayout() { - Padding = new Extents(0, 0, 6, 6), + Padding = new Extents(0, 0, 6, 6).DpToPx(), }, }; listContainer.Add(topView); @@ -58,7 +58,7 @@ namespace MusicPlayer.Views { StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 28, + PixelSize = 28.DpToPx(), 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), + Margin = new Extents(32, 40, 0, 0).DpToPx(), }; topView.Add(playAllWithShuffle); playAllWithShuffle.Clicked += (object sender, ClickedEventArgs e) => diff --git a/music-player/Views/BaseView.cs b/music-player/Views/BaseView.cs index bc45261..b1fbfdf 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, + HeightSpecification = 120.DpToPx(), Layout = new RelativeLayout() { - Padding = new Extents(64, 64, 30, 30), + Padding = new Extents(64, 64, 30, 30).DpToPx(), }, }; base.Add(topView); @@ -56,7 +56,7 @@ namespace MusicPlayer.Views StyleName = "PageLabel", ThemeChangeSensitive = true, Text = "Music", - PixelSize = 40, + PixelSize = 40.DpToPx(), 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), + Size2D = new Size2D(Window.Instance.Size.Width, 84).DpToPx(), WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 84, + HeightSpecification = 84.DpToPx(), }; 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), - Margin = new Extents(0, 24, 6, 6), + Size2D = new Size2D(48, 48).DpToPx(), + Margin = new Extents(0, 24, 6, 6).DpToPx(), }; backButton.Clicked += OnBackButtonClicked; @@ -160,7 +160,7 @@ namespace MusicPlayer.Views moreButton = new Button("MoreButton") { ThemeChangeSensitive = true, - Margin = new Extents(32, 0, 6, 6), + Margin = new Extents(32, 0, 6, 6).DpToPx(), }; 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), + Margin = new Extents(24, 0, 0, 0).DpToPx(), }; topView.Add(searchButton); RelativeLayout.SetRightTarget(searchButton, moreButton); diff --git a/music-player/Views/ListItemLayout.cs b/music-player/Views/ListItemLayout.cs index 1fe5f06..5842484 100755 --- a/music-player/Views/ListItemLayout.cs +++ b/music-player/Views/ListItemLayout.cs @@ -66,44 +66,44 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus); AnimationRequired = animationRequired; WidthSpecification = Width; HeightSpecification = Height; - Size2D = new Size2D(Width, Height); + Size2D = new Size2D(Width, Height).DpToPx(); // to show the rounded rect of the bg BackgroundColor = Color.Transparent; icon = new ImageView() { - Size2D = new Size2D(IconSize, IconSize), - Position2D = new Position2D(x, ((Height / 2) - (IconSize / 2))), + Size2D = new Size2D(IconSize, IconSize).DpToPx(), + Position2D = new Position2D(x, ((Height / 2) - (IconSize / 2))).DpToPx(), }; base.Add(icon); itemSeperator = new View() { - Size2D = new Size2D((Width - (2 * LeftPadding)), SeperatorHeight), + Size2D = new Size2D((Width - (2 * LeftPadding)), SeperatorHeight).DpToPx(), ExcludeLayouting = true, - Position2D = new Position2D(x, Height - SeperatorHeight), + Position2D = new Position2D(x, Height - SeperatorHeight).DpToPx(), BackgroundColor = UIColors.ItemSeperator, }; base.Add(itemSeperator); titleLabel = new TextLabel() { - Size2D = new Size2D((Width - (2 * LeftPadding) - IconSize - LayoutPadding), 40), - PixelSize = 32, + Size2D = new Size2D((Width - (2 * LeftPadding) - IconSize - LayoutPadding), 40).DpToPx(), + PixelSize = 32.DpToPx(), FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, - Position2D = new Position2D((x + IconSize + LayoutPadding), LayoutMargin), + Position2D = new Position2D((x + IconSize + LayoutPadding), LayoutMargin).DpToPx(), }; titleLabel.FontStyle = UIFontStyles.NormalLight; base.Add(titleLabel); subtitleLabel = new TextLabel() { - Size2D = new Size2D((Width - (2 * LeftPadding) - IconSize - LayoutPadding), 36), - PixelSize = 28, + Size2D = new Size2D((Width - (2 * LeftPadding) - IconSize - LayoutPadding), 36).DpToPx(), + PixelSize = 28.DpToPx(), FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, - Position2D = new Position2D((x + IconSize + LayoutPadding), LayoutMargin + 40) + Position2D = new Position2D((x + IconSize + LayoutPadding), LayoutMargin + 40).DpToPx(), }; subtitleLabel.FontStyle = UIFontStyles.AllNormal; base.Add(subtitleLabel); @@ -172,10 +172,13 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus); { if(currentValue) { - Tizen.Log.Error(AppConstants.LogTag, "Adding animation/play-pause icon and setting highlight color"); - if(titleLabel != null && subtitleLabel != null) + Tizen.Log.Debug(AppConstants.LogTag, "Adding animation/play-pause icon and setting highlight color"); + if(titleLabel != null) { titleLabel.TextColor = UIColors.HEX1473E6; + } + if(subtitleLabel != null) + { subtitleLabel.TextColor = UIColors.HEX1473E6; } if(AnimationRequired == true && isAnimating == false) @@ -189,7 +192,7 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus); } else { - Tizen.Log.Error(AppConstants.LogTag, "Remove animation/play-pause icon and setting normal color"); + Tizen.Log.Debug(AppConstants.LogTag, "Remove animation/play-pause icon and setting normal color"); UpdateLabelColors(); if(AnimationRequired == true && isAnimating) { @@ -227,17 +230,23 @@ defaultValueCreator: (bindable) => ((ListItemLayout)bindable).playingStatus); string currentPlatformThemeId = ThemeManager.PlatformThemeId; if (currentPlatformThemeId.Equals(AppConstants.LightPlatformThemeId)) { - if(titleLabel != null && subtitleLabel != null) + if(titleLabel != null) { titleLabel.TextColor = UIColors.HEX001447; + } + if(subtitleLabel != null) + { subtitleLabel.TextColor = UIColors.HEX001447; } } else if(currentPlatformThemeId.Equals(AppConstants.DarkPlatformThemeId)) { - if(titleLabel != null && subtitleLabel != null) + if(titleLabel != null) { titleLabel.TextColor = Color.White; + } + if(subtitleLabel != null) + { subtitleLabel.TextColor = Color.White; } } diff --git a/music-player/Views/PlaylistSelectorView.cs b/music-player/Views/PlaylistSelectorView.cs index 42f2213..cd29472 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(1184, 660), + Size2D = new Size2D(1184, 660).DpToPx(), Title = "Add to playlist", Content = selectPlaylistContentArea, Actions = new List { selectPlaylistCancelButton }, - Padding = new Extents(0, 0, 0, 0), - Margin = new Extents(0, 0, 0, 0), + Padding = new Extents(0, 0, 0, 0).DpToPx(), + Margin = new Extents(0, 0, 0, 0).DpToPx(), }; TextLabel textLabel = (TextLabel)selectPlaylistDialog.TitleContent; textLabel.FontStyle = UIFontStyles.AllNormal; @@ -72,7 +72,7 @@ namespace MusicPlayer.Views selectPlaylistContentArea = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 340, + HeightSpecification = 340.DpToPx(), BackgroundColor = Color.Transparent, Layout = new FlexLayout() { @@ -95,9 +95,9 @@ namespace MusicPlayer.Views createNewPlaylistButton = new Button("PlaylistCreate") { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 108, + HeightSpecification = 108.DpToPx(), TextAlignment = HorizontalAlignment.Begin, - Padding = new Extents(64, 64, 0, 0), + Padding = new Extents(64, 64, 0, 0).DpToPx(), IsEnabled = true, IsSelectable = false, ItemAlignment = LinearLayout.Alignment.CenterVertical, @@ -109,9 +109,9 @@ namespace MusicPlayer.Views View itemSeperator = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 2, + HeightSpecification = 2.DpToPx(), BackgroundColor = UIColors.ItemSeperator, - Margin = new Extents(64, 64, 0, 0), + Margin = new Extents(64, 64, 0, 0).DpToPx(), }; selectPlaylistContentArea.Add(itemSeperator); createNewPlaylistButton.Clicked += CreateNewPlaylistButtonClicked; @@ -124,12 +124,12 @@ namespace MusicPlayer.Views AddCreatePlaylistButtons(); createPlaylistDialog = new AlertDialog() { - Size2D = new Size2D(1184, 465), + Size2D = new Size2D(1184, 465).DpToPx(), Title = "Create playlist", Content = createPlaylistContentArea, Actions = new List { createPlaylistCancelButton, createPlaylistCreateButton }, - Padding = new Extents(0, 0, 0, 0), - Margin = new Extents(0, 0, 0, 0), + Padding = new Extents(0, 0, 0, 0).DpToPx(), + Margin = new Extents(0, 0, 0, 0).DpToPx(), }; TextLabel textLabel = (TextLabel)selectPlaylistDialog.TitleContent; textLabel.FontStyle = UIFontStyles.AllNormal; @@ -148,7 +148,7 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, StyleName = "ListBackground", - Size2D = new Size2D(1184, 108), + Size2D = new Size2D(1184, 108).DpToPx(), 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 + HeightSpecification = 108.DpToPx(), }; layout.Seperator.BackgroundColor = UIColors.ItemSeperator; - layout.Seperator.Padding = new Extents(0, 0, 0, 0); - layout.Seperator.Margin = new Extents(0, 0, 0, 0); + layout.Seperator.Padding = new Extents(0, 0, 0, 0).DpToPx(); + layout.Seperator.Margin = new Extents(0, 0, 0, 0).DpToPx(); layout.Seperator.WidthSpecification = LayoutParamPolicies.MatchParent; layout.Label.SetBinding(TextLabel.TextProperty, "PlaylistName"); layout.Label.FontStyle = UIFontStyles.NormalLight; - layout.Padding = new Extents(0, 0, 0, 0); - layout.Margin = new Extents(0, 0, 0, 0); + layout.Padding = new Extents(0, 0, 0, 0).DpToPx(); + layout.Margin = new Extents(0, 0, 0, 0).DpToPx(); return layout; }); collectionView.ItemsSource = viewModel.ListViewModel; @@ -224,14 +224,14 @@ namespace MusicPlayer.Views StyleName = "ItemLabel", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 108, - PixelSize = 32, + HeightSpecification = 108.DpToPx(), + PixelSize = 32.DpToPx(), Text = "No playlists available", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, FontFamily = "BreezeSans", FontStyle = UIFontStyles.NormalLight, - Padding = new Extents(64, 64, 0, 0), + Padding = new Extents(64, 64, 0, 0).DpToPx(), }; selectPlaylistContentArea.Add(noListText); } @@ -239,6 +239,7 @@ namespace MusicPlayer.Views { selectPlaylistCancelButton = new Button() { + Size2D = new Size2D(336, 96).DpToPx(), Text = "Cancel", }; selectPlaylistCancelButton.TextLabel.FontStyle = UIFontStyles.AllNormal; @@ -263,29 +264,29 @@ namespace MusicPlayer.Views createPlaylistContentArea = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 169, + HeightSpecification = 169.DpToPx(), BackgroundColor = Color.Transparent, Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Column, ItemsAlignment = FlexLayout.AlignmentType.FlexStart, Justification = FlexLayout.FlexJustification.FlexStart, - Padding = new Extents(64, 64, 0, 0), + Padding = new Extents(64, 64, 0, 0).DpToPx(), }, }; TextLabel textLabel = new TextLabel() { - StyleName = "TitleText", + StyleName = "ItemLabel", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 40, - PixelSize = 32, + HeightSpecification = 40.DpToPx(), + PixelSize = 32.DpToPx(), Text = "Add playlist name.", HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, FontFamily = "BreezeSans", FontStyle = UIFontStyles.NormalLight, - Margin = new Extents(0, 0, 0, 24), + Margin = new Extents(0, 0, 0, 24).DpToPx(), }; createPlaylistContentArea.Add(textLabel); AddInputArea(); @@ -293,7 +294,7 @@ namespace MusicPlayer.Views { BackgroundColor = UIColors.ItemSeperator, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 1, + HeightSpecification = 1.DpToPx(), }; createPlaylistContentArea.Add(itemSeperator); underText = new TextLabel() @@ -301,8 +302,8 @@ namespace MusicPlayer.Views StyleName = "ItemLabel", ThemeChangeSensitive = true, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 32, - PixelSize = 24, + HeightSpecification = 32.DpToPx(), + PixelSize = 24.DpToPx(), Text = "Can't enter more than 64 characters.", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -316,7 +317,7 @@ namespace MusicPlayer.Views { inputArea = new View() { - Size2D = new Size2D(1024, 48), + Size2D = new Size2D(1024, 48).DpToPx(), Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Row, @@ -328,10 +329,10 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, StyleName = "TextField", - PixelSize = 32, - Size2D = new Size2D(928, 48), - Position2D = new Position2D(0, 0), - Margin = new Extents(0, 48, 0, 0), + PixelSize = 32.DpToPx(), + Size2D = new Size2D(928, 48).DpToPx(), + Position2D = new Position2D(0, 0).DpToPx(), + Margin = new Extents(0, 48, 0, 0).DpToPx(), FontStyle = UIFontStyles.NormalLight, MaxLength = 65, }; @@ -341,7 +342,7 @@ namespace MusicPlayer.Views crossButton = new Button("ClearButton") { ThemeChangeSensitive = true, - Position2D = new Position2D(976, 6), + Position2D = new Position2D(976, 6).DpToPx(), }; crossButton.Clicked += (object o, ClickedEventArgs e) => { @@ -390,6 +391,7 @@ namespace MusicPlayer.Views createPlaylistCreateButton = new Button() { + Size2D = new Size2D(336, 96).DpToPx(), Text = "Create", }; createPlaylistCreateButton.TextLabel.FontStyle = UIFontStyles.AllNormal; diff --git a/music-player/Views/PlaylistView.cs b/music-player/Views/PlaylistView.cs index 4c02601..b4657cd 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, + PixelSize = 28.DpToPx(), 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), + Margin = new Extents(40, 0, 0, 0).DpToPx(), }; playlistCreateButton.BindingContext = viewModel; playlistCreateButton.SetBinding(Button.IsEnabledProperty, "CanCreatePlaylist"); @@ -121,7 +121,7 @@ namespace MusicPlayer.Views Name = "AlertDialogTitle", StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 40, + PixelSize = 40.DpToPx(), FontFamily = "BreezeSans", FontStyle = UIFontStyles.AllNormal, Text = "Create playlist", @@ -136,12 +136,12 @@ namespace MusicPlayer.Views Name = "AlertDialogContentMessage", StyleName = "LabelText", ThemeChangeSensitive = true, - PixelSize = 32, + PixelSize = 32.DpToPx(), FontFamily = "BreezeSans", FontStyle = UIFontStyles.NormalLight, Text = "Create a playlist", WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 40, + HeightSpecification = 40.DpToPx(), HorizontalAlignment = HorizontalAlignment.Center, }; return contentLabel; @@ -155,6 +155,7 @@ namespace MusicPlayer.Views PlaceholderText = "Enter Playlist Name", Text = DefaultPlaylistName, HorizontalAlignment = HorizontalAlignment.Begin, + PixelSize = 32.DpToPx(), }; return inputTextField; } @@ -165,7 +166,7 @@ namespace MusicPlayer.Views { Name = "AlertDialogClearButton", ThemeChangeSensitive = true, - Margin = new Extents(48, 0, 0, 0), + Margin = new Extents(48, 0, 0, 0).DpToPx(), }; return clearButton; } @@ -177,8 +178,8 @@ namespace MusicPlayer.Views Name = "AlertDialogInputArea", BackgroundColor = Color.Transparent, WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 48, - Margin = new Extents(0, 0, 24, 0), + HeightSpecification = 48.DpToPx(), + Margin = new Extents(0, 0, 24, 0).DpToPx(), Layout = new RelativeLayout() }; return inputArea; @@ -189,16 +190,16 @@ namespace MusicPlayer.Views View contentArea = new View() { Name = "AlertDialogContent", - SizeWidth = 1024, - WidthSpecification = 1024, - SizeHeight = 240, - HeightSpecification = 240, + SizeWidth = 1024.DpToPx(), + WidthSpecification = 1024.DpToPx(), + SizeHeight = 240.DpToPx(), + HeightSpecification = 240.DpToPx(), BackgroundColor = Color.Transparent, Layout = new LinearLayout() { LinearOrientation = LinearLayout.Orientation.Vertical, LinearAlignment = LinearLayout.Alignment.Center, - Margin = new Extents(0, 0, 0, 24), + Margin = new Extents(0, 0, 0, 24).DpToPx(), } }; return contentArea; @@ -219,6 +220,7 @@ namespace MusicPlayer.Views { Button createButton = new Button() { + Size2D = new Size2D(336, 96).DpToPx(), Name = "AlertDialogCreateButton", Text = "Create", }; @@ -275,8 +277,8 @@ namespace MusicPlayer.Views { View buttonArea = new View() { - HeightSpecification = 136, - WidthSpecification = 1024, + HeightSpecification = 136.DpToPx(), + WidthSpecification = 1024.DpToPx(), Layout = new RelativeLayout(), }; return buttonArea; diff --git a/music-player/Views/SearchView.cs b/music-player/Views/SearchView.cs index f99453b..0ce951c 100755 --- a/music-player/Views/SearchView.cs +++ b/music-player/Views/SearchView.cs @@ -40,7 +40,7 @@ namespace MusicPlayer.Views Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Column, - Padding = new Extents(64, 64, 0, 0), + Padding = new Extents(64, 64, 0, 0).DpToPx(), }; AddTopView(); AddTopViewElements(); @@ -62,8 +62,8 @@ namespace MusicPlayer.Views topView = new View() { BackgroundColor = Color.Transparent, - Size2D = new Size2D(Window.Instance.WindowSize.Width - 128, 120), - Position2D = new Position2D(64, 0), + Size2D = new Size2D(Window.Instance.WindowSize.Width - 128, 120).DpToPx(), + Position2D = new Position2D(64, 0).DpToPx(), Layout = new FlexLayout { Direction = FlexLayout.FlexDirection.Row, @@ -80,8 +80,8 @@ namespace MusicPlayer.Views backButton = new Button("BackButton") { ThemeChangeSensitive = true, - Size2D = new Size2D(48, 48), - Margin = new Extents(0, 24, 0, 0), + Size2D = new Size2D(48, 48).DpToPx(), + Margin = new Extents(0, 24, 0, 0).DpToPx(), }; topView.Add(backButton); backButton.Clicked += BackButtonClicked; @@ -90,11 +90,11 @@ namespace MusicPlayer.Views { StyleName = "PageLabel", ThemeChangeSensitive = true, - Size2D = new Size2D(960, 48), + Size2D = new Size2D(960, 48).DpToPx(), Text = "Search", - PixelSize = 36, + PixelSize = 36.DpToPx(), FontFamily = "BreezeSans", - Margin = new Extents(0, 32, 0, 0), + Margin = new Extents(0, 32, 0, 0).DpToPx(), FontStyle = UIFontStyles.NormalLight, }; topView.Add(searchLabel); @@ -106,8 +106,8 @@ namespace MusicPlayer.Views { StyleName = "SearchBox", ThemeChangeSensitive = true, - Size2D = new Size2D(648, 60), - Margin = new Extents(0, 32, 0, 0), + Size2D = new Size2D(648, 60).DpToPx(), + Margin = new Extents(0, 32, 0, 0).DpToPx(), Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Row, @@ -120,19 +120,19 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, Name = "searchbutton", - Margin = new Extents(24, 0, 10, 10), - Position2D = new Position2D(24, 10), + Margin = new Extents(24, 0, 10, 10).DpToPx(), + Position2D = new Position2D(24, 10).DpToPx(), }; textField = new TextField() { StyleName = "TextField", ThemeChangeSensitive = true, Name ="Textfield", - Size2D = new Size2D(460, 40), + Size2D = new Size2D(460, 40).DpToPx(), BackgroundColor = Color.Transparent, - Position2D = new Position2D(88, 10), - Margin = new Extents(24, 0, 10, 10), - PixelSize = 32, + Position2D = new Position2D(88, 10).DpToPx(), + Margin = new Extents(24, 0, 10, 10).DpToPx(), + PixelSize = 32.DpToPx(), PlaceholderText = "Type Here", PlaceholderTextFocused = "Search music", }; @@ -142,8 +142,8 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, Name = "crossButton", - Margin = new Extents(24, 0, 6, 6), - Position2D = new Position2D(572, 6), + Margin = new Extents(24, 0, 6, 6).DpToPx(), + Position2D = new Position2D(572, 6).DpToPx(), }; crossButton.Clicked += CrossButtonClicked; @@ -188,14 +188,14 @@ namespace MusicPlayer.Views ThemeChangeSensitive = true, StyleName = "ListBackground", WidthSpecification = LayoutParamPolicies.MatchParent, - Padding = new Extents(0, 0, 0, 0), + Padding = new Extents(0, 0, 0, 0).DpToPx(), ItemsLayouter = new LinearLayouter(), ItemTemplate = new DataTemplate(() => { ListItemLayout layout = new ListItemLayout() { - Padding = new Extents(0, 0, 0, 0), - Margin = new Extents(0, 0, 0, 0) + Padding = new Extents(0, 0, 0, 0).DpToPx(), + Margin = new Extents(0, 0, 0, 0).DpToPx() }; layout.Icon.SetBinding(ImageView.ResourceUrlProperty, "Thumbnail"); layout.TitleLabel.SetBinding(TextLabel.TextProperty, "Title"); @@ -206,8 +206,8 @@ namespace MusicPlayer.Views { DefaultTitleItem group = new DefaultTitleItem("DefaultTitle") { - Padding = new Extents(0, 0, 0, 0), - Margin = new Extents(0, 0, 0, 0) + Padding = new Extents(0, 0, 0, 0).DpToPx(), + Margin = new Extents(0, 0, 0, 0).DpToPx() }; group.Label.FontStyle = UIFontStyles.AllNormal; group.Label.SetBinding(TextLabel.TextProperty, "DataCount"); @@ -287,13 +287,13 @@ namespace MusicPlayer.Views Direction = FlexLayout.FlexDirection.Column, ItemsAlignment = FlexLayout.AlignmentType.Center, Justification = FlexLayout.FlexJustification.FlexStart, - Padding = new Extents(0, 0, 40, 0), + Padding = new Extents(0, 0, 40, 0).DpToPx(), } }; noItemsAnimation = new LottieAnimationView() { URL = Resources.GetLottiePath() + "search_no_result.json", - Size2D = new Size2D(264, 292), + Size2D = new Size2D(264, 292).DpToPx(), LoopCount = -1, BackgroundColor = Color.Transparent, }; @@ -301,12 +301,12 @@ namespace MusicPlayer.Views TextLabel textLabel = new TextLabel() { StyleName = "TitleText", - Size2D = new Size2D(1124, 36), + Size2D = new Size2D(1124, 36).DpToPx(), Text = "No results found", - PixelSize = 28, + PixelSize = 28.DpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Center, - Margin = new Extents(0, 0, 32, 0), + Margin = new Extents(0, 0, 32, 0).DpToPx(), }; noItemView.Add(textLabel); } diff --git a/music-player/Views/SelectListLayout.cs b/music-player/Views/SelectListLayout.cs index 778ad03..c76adab 100755 --- a/music-player/Views/SelectListLayout.cs +++ b/music-player/Views/SelectListLayout.cs @@ -27,11 +27,10 @@ namespace MusicPlayer.Views public SelectListLayout(int width = 1792, int height = 108) : base() { base.OnInitialize(); - base.IsCreateByXaml = true; Width = width; Height = height; - WidthSpecification = Width; - HeightSpecification = Height; + WidthSpecification = Width.DpToPx(); + HeightSpecification = Height.DpToPx(); // to show the rounded rect of the bg BackgroundColor = Color.Transparent; @@ -44,29 +43,27 @@ namespace MusicPlayer.Views checkBox = new CheckBox("CheckBox") { - IsCreateByXaml = true, - Position2D = new Position2D(x, BoxSize), + Position2D = new Position2D(x, BoxSize).DpToPx(), }; checkBox.Icon.Opacity = 1.0f; - checkBox.Icon.Size = new Size2D(BoxSize, BoxSize); + checkBox.Icon.Size = new Size2D(BoxSize, BoxSize).DpToPx(); base.Add(checkBox); icon = new ImageView() { - WidthSpecification = IconSize, - HeightSpecification = IconSize, - IsCreateByXaml = true, - Position2D = new Position2D(x + BoxSize + LayoutPadding, ((Height / 2) - (IconSize / 2))), + WidthSpecification = IconSize.DpToPx(), + HeightSpecification = IconSize.DpToPx(), + Position2D = new Position2D(x + BoxSize + LayoutPadding, ((Height / 2) - (IconSize / 2))).DpToPx(), }; base.Add(icon); itemSeperator = new View() { - WidthSpecification = (Width - (2 * LeftPadding)), - HeightSpecification = SeperatorHeight, + WidthSpecification = (Width - (2 * LeftPadding)).DpToPx(), + HeightSpecification = SeperatorHeight.DpToPx(), ExcludeLayouting = true, - Position2D = new Position2D(x, Height - SeperatorHeight), + Position2D = new Position2D(x, Height - SeperatorHeight).DpToPx(), BackgroundColor = UIColors.ItemSeperator, }; base.Add(itemSeperator); @@ -74,29 +71,26 @@ namespace MusicPlayer.Views titleLabel = new TextLabel() { StyleName = "ItemLabel", - WidthSpecification = (Width - (2 * LeftPadding) - IconSize - 2 * LayoutPadding - BoxSize), - HeightSpecification = 40, - PixelSize = 32, + WidthSpecification = (Width - (2 * LeftPadding) - IconSize - 2 * LayoutPadding - BoxSize).DpToPx(), + HeightSpecification = 40.DpToPx(), + PixelSize = 32.DpToPx(), FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, - IsCreateByXaml = true, - Position2D = new Position2D((x + IconSize + 2 * LayoutPadding + BoxSize), LayoutMargin), + Position2D = new Position2D((x + IconSize + 2 * LayoutPadding + BoxSize), LayoutMargin).DpToPx(), }; base.Add(titleLabel); subtitleLabel = new TextLabel() { StyleName = "ItemLabel", - WidthSpecification = (Width - (2 * LeftPadding) - IconSize - 2* LayoutPadding - BoxSize), - HeightSpecification = 36, - PixelSize = 28, + WidthSpecification = (Width - (2 * LeftPadding) - IconSize - 2* LayoutPadding - BoxSize).DpToPx(), + HeightSpecification = 36.DpToPx(), + PixelSize = 28.DpToPx(), FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, - IsCreateByXaml = true, - Position2D = new Position2D((x + IconSize + 2 * LayoutPadding + BoxSize), LayoutMargin + 40) + Position2D = new Position2D((x + IconSize + 2 * LayoutPadding + BoxSize), LayoutMargin + 40).DpToPx(), }; base.Add(subtitleLabel); - IsCreateByXaml = true; IsSelected = false; } diff --git a/music-player/Views/SelectorView.cs b/music-player/Views/SelectorView.cs index d47796c..e3aba09 100755 --- a/music-player/Views/SelectorView.cs +++ b/music-player/Views/SelectorView.cs @@ -79,7 +79,7 @@ namespace MusicPlayer.Views Button button = new Button("TextButton") { Text = url, - Position2D = new Position2D(x, y), + Position2D = new Position2D(x, y).DpToPx(), IsEnabled = false, }; return button; @@ -90,12 +90,12 @@ namespace MusicPlayer.Views View topView = new View() { BackgroundColor = Color.Transparent, - WidthSpecification = Window.Instance.WindowSize.Width, - HeightSpecification = 120, + WidthSpecification = Window.Instance.WindowSize.Width.DpToPx(), + HeightSpecification = 120.DpToPx(), Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Row, - Padding = new Extents(LayoutPadding, LayoutPadding, LayoutMargin, LayoutMargin), + Padding = new Extents(LayoutPadding, LayoutPadding, LayoutMargin, LayoutMargin).DpToPx(), }, }; base.Add(topView); @@ -107,9 +107,9 @@ namespace MusicPlayer.Views selectedCountLabel = new TextLabel() { StyleName = "TitleText", - Size2D = new Size2D(1192, TextLabelHeight), - Position2D = new Position2D(LayoutPadding, 0), - PixelSize = 36, + Size2D = new Size2D(1192, TextLabelHeight).DpToPx(), + Position2D = new Position2D(LayoutPadding, 0).DpToPx(), + PixelSize = 36.DpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -123,7 +123,7 @@ namespace MusicPlayer.Views private void AddButtons() { cancelButton = CreateButton("Cancel", Window.Instance.WindowSize.Width - LayoutPadding - 2 * TextButtonWidth -40, LayoutMargin); - cancelButton.Margin = new Extents(40, 0, 0, 0); + cancelButton.Margin = new Extents(40, 0, 0, 0).DpToPx(); cancelButton.IsEnabled = true; topView.Add(cancelButton); cancelButton.Clicked += (object o, ClickedEventArgs args) => @@ -132,7 +132,7 @@ namespace MusicPlayer.Views }; doneButton = CreateButton("Done", Window.Instance.WindowSize.Width - LayoutPadding - TextButtonWidth, LayoutMargin); - doneButton.Margin = new Extents(40, 0, 0, 0); + doneButton.Margin = new Extents(40, 0, 0, 0).DpToPx(); topView.Add(doneButton); doneButton.Clicked += (object o, ClickedEventArgs args) => { @@ -204,10 +204,10 @@ namespace MusicPlayer.Views { StyleName = "SelectAllBg", ThemeChangeSensitive = true, - WidthSpecification = Window.Instance.WindowSize.Width - 2 * LayoutPadding, - HeightSpecification = 108, - Position2D = new Position2D(LayoutPadding,120), - Margin = new Extents(LayoutPadding,LayoutPadding,0,40), + WidthSpecification = (Window.Instance.WindowSize.Width - 2 * LayoutPadding).DpToPx(), + HeightSpecification = 108.DpToPx(), + Position2D = new Position2D(LayoutPadding,120).DpToPx(), + Margin = new Extents(LayoutPadding,LayoutPadding,0,40).DpToPx(), }; base.Add(selAllView); return selAllView; @@ -217,9 +217,9 @@ namespace MusicPlayer.Views { selAllButton = new CheckBox() { - Size2D = new Size2D(36, 36), - Position2D = new Position2D(LayoutPadding, LayoutMargin), - Margin = new Extents(LayoutPadding, 32, LayoutMargin, LayoutMargin), + Size2D = new Size2D(36, 36).DpToPx(), + Position2D = new Position2D(LayoutPadding, LayoutMargin).DpToPx(), + Margin = new Extents(LayoutPadding, 32, LayoutMargin, LayoutMargin).DpToPx(), }; selAllView.Add(selAllButton); selAllButton.Clicked += OnSelAllClicked; @@ -228,10 +228,10 @@ namespace MusicPlayer.Views { StyleName ="LabelText", Text = "Select All", - Size2D = new Size2D(1596, 40), - Margin = new Extents(0,LayoutPadding,34,34), - Position2D = new Position2D(LayoutPadding+36+32, 34), - PixelSize = 32, + Size2D = new Size2D(1596, 40).DpToPx(), + Margin = new Extents(0,LayoutPadding,34,34).DpToPx(), + Position2D = new Position2D(LayoutPadding+36+32, 34).DpToPx(), + PixelSize = 32.DpToPx(), FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, @@ -283,8 +283,8 @@ namespace MusicPlayer.Views { ThemeChangeSensitive = true, StyleName = "ListBackground", - Size2D = new Size2D(1792, 108), - Margin = new Extents(LayoutPadding, LayoutPadding, 0, 0), + Size2D = new Size2D(1792, 108).DpToPx(), + Margin = new Extents(LayoutPadding, LayoutPadding, 0, 0).DpToPx(), ItemsLayouter = new LinearLayouter(), ScrollingDirection = ScrollableBase.Direction.Vertical, HeightSpecification = LayoutParamPolicies.WrapContent, diff --git a/music-player/Views/TrackDetailView.cs b/music-player/Views/TrackDetailView.cs index b37670a..b442e65 100755 --- a/music-player/Views/TrackDetailView.cs +++ b/music-player/Views/TrackDetailView.cs @@ -90,8 +90,8 @@ namespace MusicPlayer.Views ThemeChangeSensitive = true, StyleName = "ListBackground", WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 836, - Margin = new Extents(64, 64, 0, 0), + HeightSpecification = 836.DpToPx(), + Margin = new Extents(64, 64, 0, 0).DpToPx(), ScrollingDirection = ScrollableBase.Direction.Vertical, }; return scrollableBase; @@ -102,7 +102,7 @@ namespace MusicPlayer.Views View view = new View() { WidthSpecification = LayoutParamPolicies.MatchParent, - HeightSpecification = 124, + HeightSpecification = 124.DpToPx(), BackgroundColor = Color.Magenta, }; return view; @@ -142,7 +142,7 @@ namespace MusicPlayer.Views View view = new View() { BackgroundColor = Color.Transparent, - Size2D = new Size2D(1664, 108), + Size2D = new Size2D(1664, 108).DpToPx(), BindingContext = viewModel.Model, }; @@ -167,8 +167,8 @@ namespace MusicPlayer.Views View itemSaperator = new View() { BackgroundColor = UIColors.HEXC3CAD2, - Size2D = new Size2D(1664, 1), - Position2D = new Position2D(0, 107), + Size2D = new Size2D(1664.DpToPx(), 1), + Position2D = new Position2D(0, 107).DpToPx(), }; view.Add(itemSaperator); @@ -177,7 +177,7 @@ namespace MusicPlayer.Views private void AddItem(View item, int x, int y) { - item.Position2D = new Position2D(x, y); + item.Position2D = new Position2D(x, y).DpToPx(); itemRootView.Add(item); } diff --git a/music-player/Views/TrackView.cs b/music-player/Views/TrackView.cs index 07d38fe..762dfb3 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, + PixelSize = 28.DpToPx(), 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), + Margin = new Extents(32, 40, 0, 0).DpToPx(), }; titleView.Add(playAllWithShuffle); playAllWithShuffle.Clicked += (object sender, ClickedEventArgs e) => diff --git a/music-player/music-player.csproj b/music-player/music-player.csproj index 400a827..4929997 100755 --- a/music-player/music-player.csproj +++ b/music-player/music-player.csproj @@ -2,7 +2,7 @@ Exe - tizen90 + tizen10.0 8.0 Tizen @@ -22,7 +22,7 @@ Runtime - + diff --git a/music-player/res/themes/dark.xaml b/music-player/res/themes/dark.xaml index d02b5cb..c10e78b 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,7 +247,7 @@ Id="DarkTheme"> - - + + \ No newline at end of file diff --git a/music-player/res/themes/light.xaml b/music-player/res/themes/light.xaml index 8b11e4a..893046b 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,7 +247,7 @@ Id="LightTheme"> - - + + \ No newline at end of file diff --git a/packaging/org.tizen.MusicPlayer-1.0.0.tpk b/packaging/org.tizen.MusicPlayer-1.0.0.tpk index 592e63f..d9c1e48 100755 Binary files a/packaging/org.tizen.MusicPlayer-1.0.0.tpk and b/packaging/org.tizen.MusicPlayer-1.0.0.tpk differ