From: shivamv Date: Thu, 21 Oct 2021 05:29:02 +0000 (+0530) Subject: Added dark theme for Selector, Search View and added scrollbar animation for collecti... X-Git-Tag: submit/tizen/20211109.094344~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b78d1b1f8dbd87099c8315d4f090d0f80b1f66a3;p=profile%2Fiot%2Fapps%2Fdotnet%2Fmusic-player.git Added dark theme for Selector, Search View and added scrollbar animation for collection Views. Change-Id: I795202f3a424f3cc313d9aa7cdf25b82ab9d4797 Signed-off-by: shivamv --- diff --git a/music-player/Views/ArtistDetailGroupLayout.cs b/music-player/Views/ArtistDetailGroupLayout.cs index c896a0e..c4d2b63 100755 --- a/music-player/Views/ArtistDetailGroupLayout.cs +++ b/music-player/Views/ArtistDetailGroupLayout.cs @@ -67,6 +67,8 @@ namespace MusicPlayer.Views { TextLabel titleLabel = new TextLabel() { + StyleName = "ItemLabel", + ThemeChangeSensitive = true, Size2D = new Size2D((Width - (2 * LeftPadding) - IconSize - LayoutPadding), 40), TextColor = UIColors.HEX001447, PixelSize = 32, diff --git a/music-player/Views/BaseContentView.cs b/music-player/Views/BaseContentView.cs index 4bd4b32..d4da99a 100755 --- a/music-player/Views/BaseContentView.cs +++ b/music-player/Views/BaseContentView.cs @@ -67,6 +67,14 @@ namespace MusicPlayer.Views HeightSpecification = LayoutParamPolicies.WrapContent, SelectionMode = ItemSelectionMode.Single, }; + collectionView.ScrollDragStarted += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = false; + }; + collectionView.ScrollAnimationEnded += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = true; + }; contentViewContainer.Add(collectionView); FlexLayout.SetFlexGrow(collectionView, 1); FlexLayout.SetFlexShrink(collectionView, 1); diff --git a/music-player/Views/BaseSubContentView.cs b/music-player/Views/BaseSubContentView.cs index ab82a77..2de9156 100755 --- a/music-player/Views/BaseSubContentView.cs +++ b/music-player/Views/BaseSubContentView.cs @@ -106,6 +106,14 @@ namespace MusicPlayer.Views HeightSpecification = LayoutParamPolicies.MatchParent, SelectionMode = ItemSelectionMode.Single, }; + collectionView.ScrollDragStarted += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = false; + }; + collectionView.ScrollAnimationEnded += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = true; + }; listContainer.Add(collectionView); } diff --git a/music-player/Views/PlayingListView.cs b/music-player/Views/PlayingListView.cs index 7a9bcac..c7b7c91 100755 --- a/music-player/Views/PlayingListView.cs +++ b/music-player/Views/PlayingListView.cs @@ -36,6 +36,14 @@ namespace MusicPlayer.Views WidthResizePolicy = ResizePolicyType.FillToParent, HeightResizePolicy = ResizePolicyType.FillToParent, }; + collectionView.ScrollDragStarted += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = false; + }; + collectionView.ScrollAnimationEnded += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = true; + }; base.Add(collectionView); viewModel.ItemsSourceChanged += ItemSourceChanged; collectionView.SelectionChanged += OnItemSelected; diff --git a/music-player/Views/PlaylistSelectorView.cs b/music-player/Views/PlaylistSelectorView.cs index 7d74539..2e1c2ac 100755 --- a/music-player/Views/PlaylistSelectorView.cs +++ b/music-player/Views/PlaylistSelectorView.cs @@ -111,6 +111,7 @@ namespace MusicPlayer.Views HeightSpecification = 108, TextAlignment = HorizontalAlignment.Begin, Padding = new Extents(64, 64, 0, 0), + IsEnabled = true, IsSelectable = false, ItemAlignment = LinearLayout.Alignment.CenterVertical, }; @@ -163,6 +164,14 @@ namespace MusicPlayer.Views HeightSpecification = LayoutParamPolicies.WrapContent, SelectionMode = ItemSelectionMode.Single, }; + collectionView.ScrollDragStarted += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = false; + }; + collectionView.ScrollAnimationEnded += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = true; + }; selectPlaylistContentArea.Add(collectionView); FlexLayout.SetFlexGrow(collectionView, 1); FlexLayout.SetFlexShrink(collectionView, 1); diff --git a/music-player/Views/SearchView.cs b/music-player/Views/SearchView.cs index c4c8158..7b17896 100755 --- a/music-player/Views/SearchView.cs +++ b/music-player/Views/SearchView.cs @@ -29,12 +29,13 @@ namespace MusicPlayer.Views public SearchView(SearchViewModel viewModel) : base() { + StyleName = "AppBackground"; + ThemeChangeSensitive = true; this.viewModel = viewModel; noItemFound = false; noItemView = null; WidthResizePolicy = ResizePolicyType.FillToParent; HeightResizePolicy = ResizePolicyType.FillToParent; - BackgroundColor = UIColors.HEXEEEFF1; Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Column, @@ -44,6 +45,7 @@ namespace MusicPlayer.Views AddTopViewElements(); AddSearchBox(); AddCollectionView(); + TouchEvent += (object source, TouchEventArgs e) => false; Window.Instance.Add(this); BackKeyPressed += OnBackKeyPressed; } @@ -57,7 +59,7 @@ namespace MusicPlayer.Views { topView = new View() { - BackgroundColor = UIColors.HEXEEEFF1, + BackgroundColor = Color.Transparent, Size2D = new Size2D(Window.Instance.WindowSize.Width - 128, 120), Position2D = new Position2D(64, 0), Layout = new FlexLayout @@ -73,18 +75,9 @@ namespace MusicPlayer.Views private void AddTopViewElements() { - ButtonStyle buttonStyle = new ButtonStyle() - { - Icon = new ImageViewStyle() - { - ResourceUrl = Resources.GetImagePath() + "back.png", - }, - IsSelectable = false, - IsEnabled = true, - }; - - backButton = new Button(buttonStyle) + backButton = new Button("BackButton") { + ThemeChangeSensitive = true, Size2D = new Size2D(48, 48), Margin = new Extents(0, 24, 0, 0), }; @@ -93,12 +86,14 @@ namespace MusicPlayer.Views searchLabel = new TextLabel() { + StyleName = "PageLabel", + ThemeChangeSensitive = true, Size2D = new Size2D(960, 48), Text = "Search", - TextColor = UIColors.HEX001447, PixelSize = 36, FontFamily = "BreezeSans", Margin = new Extents(0, 32, 0, 0), + FontStyle = UIFontStyles.NormalLight, }; topView.Add(searchLabel); } @@ -107,9 +102,10 @@ namespace MusicPlayer.Views { searchBox = new View() { + StyleName = "SearchBox", + ThemeChangeSensitive = true, Size2D = new Size2D(648, 60), Margin = new Extents(0, 32, 0, 0), - BackgroundImage = Resources.GetImagePath() + "search_box_bg.png", Layout = new FlexLayout() { Direction = FlexLayout.FlexDirection.Row, @@ -117,30 +113,24 @@ namespace MusicPlayer.Views Justification = FlexLayout.FlexJustification.FlexStart, }, }; - ButtonStyle searchButtonStyle = new ButtonStyle() - { - Icon = new ImageViewStyle() - { - ResourceUrl = Resources.GetImagePath() + "search_icon.png", - }, - IsSelectable = false, - IsEnabled = true, - }; - Button searchButton = new Button(searchButtonStyle) + + Button searchButton = new Button("SearchIcon") { + ThemeChangeSensitive = true, Name = "searchbutton", - Size2D = new Size2D(40, 40), Margin = new Extents(24, 0, 10, 10), Position2D = new Position2D(24, 10), }; textField = new TextField() { - Name="Textfield", + StyleName = "TextField", + ThemeChangeSensitive = true, + Name ="Textfield", Size2D = new Size2D(460, 40), - BackgroundColor = Color.White, + BackgroundColor = Color.Transparent, Position2D = new Position2D(88, 10), Margin = new Extents(24, 0, 10, 10), - TextColor = UIColors.HEX001447, + PixelSize = 32, PlaceholderText = "Type Here", PlaceholderTextFocused = "Search music", }; @@ -209,10 +199,11 @@ namespace MusicPlayer.Views }), GroupHeaderTemplate = new DataTemplate(() => { - DefaultTitleItem group = new DefaultTitleItem(); + DefaultTitleItem group = new DefaultTitleItem("DefaultTitle"); group.WidthSpecification = 1792; group.Padding = new Extents(0, 0, 0, 0); group.Margin = new Extents(0, 0, 0, 0); + group.Label.FontStyle = UIFontStyles.AllNormal; group.Label.SetBinding(TextLabel.TextProperty, "DataCount"); group.Label.HorizontalAlignment = HorizontalAlignment.Begin; group.Label.VerticalAlignment = VerticalAlignment.Center; @@ -223,6 +214,14 @@ namespace MusicPlayer.Views HeightSpecification = LayoutParamPolicies.WrapContent, SelectionMode = ItemSelectionMode.Single, }; + collectionView.ScrollDragStarted += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = false; + }; + collectionView.ScrollAnimationEnded += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = true; + }; base.Add(collectionView); FlexLayout.SetFlexGrow(collectionView, 1); FlexLayout.SetFlexShrink(collectionView, 1); @@ -274,7 +273,7 @@ namespace MusicPlayer.Views { noItemView = new View() { - BackgroundColor = UIColors.HEXEEEFF1, + BackgroundColor = Color.Transparent, WidthSpecification = LayoutParamPolicies.MatchParent, HeightResizePolicy = ResizePolicyType.FillToParent, Layout = new FlexLayout @@ -287,16 +286,15 @@ namespace MusicPlayer.Views }; ImageView noResultsIcon = new ImageView() { - BackgroundColor = UIColors.HEXEEEFF1, + BackgroundColor = Color.Transparent, ResourceUrl = Resources.GetImagePath() + "no_results_found.png", Size2D = new Size2D(264, 292), }; noItemView.Add(noResultsIcon); - TextLabel textLabel = new TextLabel() + TextLabel textLabel = new TextLabel("LabelText") { Size2D = new Size2D(1124, 36), Text = "No results found", - TextColor = UIColors.HEX001447, PixelSize = 28, FontFamily = "BreezeSans", HorizontalAlignment = HorizontalAlignment.Center, diff --git a/music-player/Views/SelectListLayout.cs b/music-player/Views/SelectListLayout.cs index 9693db6..0aee7c4 100755 --- a/music-player/Views/SelectListLayout.cs +++ b/music-player/Views/SelectListLayout.cs @@ -42,14 +42,10 @@ namespace MusicPlayer.Views DisabledSelected = Resources.GetImagePath() + "check_on.png", }; - checkBox = new CheckBox() + checkBox = new CheckBox("CheckBox") { - Size2D = new Size2D(BoxSize, BoxSize), IsCreateByXaml = true, Position2D = new Position2D(x, BoxSize), - IconURLSelector = iconURL, - IsSelected = false, - IsEnabled =false, }; checkBox.Icon.Opacity = 1.0f; @@ -75,11 +71,10 @@ namespace MusicPlayer.Views }; base.Add(itemSeperator); - titleLabel = new TextLabel() + titleLabel = new TextLabel("ItemLabel") { WidthSpecification = (Width - (2 * LeftPadding) - IconSize - 2 * LayoutPadding - BoxSize), HeightSpecification = 40, - TextColor = UIColors.HEX001447, PixelSize = 32, FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, @@ -88,11 +83,10 @@ namespace MusicPlayer.Views }; base.Add(titleLabel); - subtitleLabel = new TextLabel() + subtitleLabel = new TextLabel("ItemLabel") { WidthSpecification = (Width - (2 * LeftPadding) - IconSize - 2* LayoutPadding - BoxSize), HeightSpecification = 36, - TextColor = UIColors.HEX001447, PixelSize = 28, FontFamily = "BreezeSans", VerticalAlignment = VerticalAlignment.Center, diff --git a/music-player/Views/SelectorView.cs b/music-player/Views/SelectorView.cs index 5cd240c..a07be4f 100755 --- a/music-player/Views/SelectorView.cs +++ b/music-player/Views/SelectorView.cs @@ -41,10 +41,11 @@ namespace MusicPlayer.Views public SelectorView(OperationViewType viewType, SelectorViewModel viewModel) : base() { + StyleName = "AppBackground"; + ThemeChangeSensitive = true; currentViewType = viewType; selectedItemList = new List(); this.viewModel = viewModel; - BackgroundColor = UIColors.HEXEEEFF1; WidthResizePolicy = ResizePolicyType.FillToParent; HeightResizePolicy = ResizePolicyType.FillToParent; @@ -62,7 +63,7 @@ namespace MusicPlayer.Views AddSelAllViewElements(); collectionView = AddCollectionView(); itemCount = 0; - TouchEvent += SelectorViewTouchEvent; + TouchEvent += (object source, TouchEventArgs e) => false; Window.Instance.Add(this); BackKeyPressed += OnBackKeyPressed; } @@ -72,32 +73,13 @@ namespace MusicPlayer.Views OnCancel(); } - private bool SelectorViewTouchEvent(object source, TouchEventArgs e) - { - return false; - } - public List SelectedItemList => selectedItemList; private Button CreateButton(string url, int x, int y) { - ButtonStyle buttonStyle = new ButtonStyle() + Button button = new Button("TextButton") { - Text = new TextLabelStyle() - { - Text = url, - PixelSize = 28, - FontFamily = "BreezeSans", - TextColor = UIColors.HEX000C2B, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - }, - IsSelectable = false, - }; - - Button button = new Button(buttonStyle) - { - Size2D = new Size2D(TextButtonWidth, TextLabelHeight), + Text = url, Position2D = new Position2D(x, y), IsEnabled = false, IsSelectable = true, @@ -109,6 +91,7 @@ namespace MusicPlayer.Views { View topView = new View() { + BackgroundColor = Color.Transparent, WidthSpecification = Window.Instance.WindowSize.Width, HeightSpecification = 120, Layout = new FlexLayout() @@ -123,13 +106,12 @@ namespace MusicPlayer.Views private void AddSelectCountLabel() { - selectedCountLabel = new TextLabel() + selectedCountLabel = new TextLabel("TitleText") { Size2D = new Size2D(1192, TextLabelHeight), Position2D = new Position2D(LayoutPadding, 0), PixelSize = 36, FontFamily = "BreezeSans", - TextColor = UIColors.HEX000209, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, Ellipsis = true, @@ -211,11 +193,12 @@ namespace MusicPlayer.Views { View selAllView = new View() { + 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), - BackgroundImage = Resources.GetImagePath() + "list_view_bg.png", }; base.Add(selAllView); return selAllView; @@ -232,7 +215,7 @@ namespace MusicPlayer.Views selAllView.Add(selAllButton); selAllButton.Clicked += OnSelAllClicked; - TextLabel selAll = new TextLabel() + TextLabel selAll = new TextLabel("LabelText") { Text = "Select All", Size2D = new Size2D(1596, 40), @@ -240,7 +223,6 @@ namespace MusicPlayer.Views Position2D = new Position2D(LayoutPadding+36+32, 34), PixelSize = 32, FontFamily = "BreezeSans", - TextColor = UIColors.HEX001447, HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, Ellipsis = true, @@ -297,6 +279,14 @@ namespace MusicPlayer.Views HeightSpecification = LayoutParamPolicies.WrapContent, SelectionMode = ItemSelectionMode.Multiple, }; + collectionView.ScrollDragStarted += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = false; + }; + collectionView.ScrollAnimationEnded += (object o, ScrollEventArgs e) => + { + collectionView.HideScrollbar = true; + }; base.Add(collectionView); FlexLayout.SetFlexGrow(collectionView, 1); FlexLayout.SetFlexShrink(collectionView, 1); diff --git a/music-player/res/images/check_off.png b/music-player/res/images/check_off.png deleted file mode 100755 index ab7eb52..0000000 Binary files a/music-player/res/images/check_off.png and /dev/null differ diff --git a/music-player/res/images/check_on.png b/music-player/res/images/check_on.png deleted file mode 100755 index b654380..0000000 Binary files a/music-player/res/images/check_on.png and /dev/null differ diff --git a/music-player/res/images/dark/check_off.png b/music-player/res/images/dark/check_off.png new file mode 100755 index 0000000..9b5a0be Binary files /dev/null and b/music-player/res/images/dark/check_off.png differ diff --git a/music-player/res/images/dark/check_on.png b/music-player/res/images/dark/check_on.png new file mode 100755 index 0000000..b07443c Binary files /dev/null and b/music-player/res/images/dark/check_on.png differ diff --git a/music-player/res/images/dark/search_box_bg.png b/music-player/res/images/dark/search_box_bg.png new file mode 100755 index 0000000..96aa9ec Binary files /dev/null and b/music-player/res/images/dark/search_box_bg.png differ diff --git a/music-player/res/images/dark/search_icon.png b/music-player/res/images/dark/search_icon.png new file mode 100755 index 0000000..8743d85 Binary files /dev/null and b/music-player/res/images/dark/search_icon.png differ diff --git a/music-player/res/images/light/check_off.png b/music-player/res/images/light/check_off.png new file mode 100755 index 0000000..ab7eb52 Binary files /dev/null and b/music-player/res/images/light/check_off.png differ diff --git a/music-player/res/images/light/check_on.png b/music-player/res/images/light/check_on.png new file mode 100755 index 0000000..b654380 Binary files /dev/null and b/music-player/res/images/light/check_on.png differ diff --git a/music-player/res/images/light/search_box_bg.png b/music-player/res/images/light/search_box_bg.png new file mode 100755 index 0000000..a5a146a Binary files /dev/null and b/music-player/res/images/light/search_box_bg.png differ diff --git a/music-player/res/images/search_box_bg.png b/music-player/res/images/search_box_bg.png deleted file mode 100755 index a5a146a..0000000 Binary files a/music-player/res/images/search_box_bg.png and /dev/null differ diff --git a/music-player/res/themes/dark.xaml b/music-player/res/themes/dark.xaml index 07bf468..288b548 100755 --- a/music-player/res/themes/dark.xaml +++ b/music-player/res/themes/dark.xaml @@ -3,10 +3,20 @@ xmlns="http://tizen.org/Tizen.NUI/2018/XAML" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:c="clr-namespace:Tizen.NUI.Components;assembly=Tizen.NUI.Components" -Id="LightTheme"> +Id="DarkTheme"> + + + + + + + + + + @@ -138,6 +148,14 @@ Id="LightTheme"> + + + + *Resource*/images/dark/search_icon.png + + + + *Resource*/images/dark/left_sound_icon.png @@ -167,18 +185,30 @@ Id="LightTheme"> - + + + + + - - - - - *Resource*/images/dark/cross_button.png - - + + + *Resource*/images/dark/cross_button.png + + + + + + + + + + + + diff --git a/music-player/res/themes/light.xaml b/music-player/res/themes/light.xaml index 5b9c38c..807249b 100755 --- a/music-player/res/themes/light.xaml +++ b/music-player/res/themes/light.xaml @@ -7,6 +7,16 @@ Id="LightTheme"> + + + + + + + + + + @@ -138,6 +148,14 @@ Id="LightTheme"> + + + + *Resource*/images/light/search_icon.png + + + + *Resource*/images/light/left_sound_icon.png @@ -167,18 +185,30 @@ Id="LightTheme"> - + + + + + - - - - - *Resource*/images/light/cross_button.png - - + + + *Resource*/images/light/cross_button.png + + + + + + + + + + + + diff --git a/packaging/org.tizen.MusicPlayer-1.0.0.tpk b/packaging/org.tizen.MusicPlayer-1.0.0.tpk index 2f834dc..e542fbc 100755 Binary files a/packaging/org.tizen.MusicPlayer-1.0.0.tpk and b/packaging/org.tizen.MusicPlayer-1.0.0.tpk differ