From: Akshat Airan/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics Date: Fri, 1 Mar 2024 09:01:55 +0000 (+0530) Subject: Added Korean Translation in Collection View of X-Git-Tag: accepted/tizen/unified/20240424.063517^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F72%2F306972%2F7;p=profile%2Fiot%2Fapps%2Fdotnet%2Fmusic-player.git Added Korean Translation in Collection View of each tab and at Selector View . Change-Id: I02e61d358d58572a33d539aa2d5d554fc57dce27 Signed-off-by: Akshat Airan/Core S/W Group /SRI-Delhi/Engineer/Samsung Electronics --- diff --git a/music-player/Models/Artist.cs b/music-player/Models/Artist.cs index 27d73f3..c3a83cf 100755 --- a/music-player/Models/Artist.cs +++ b/music-player/Models/Artist.cs @@ -15,7 +15,6 @@ namespace MusicPlayer.Models ArtistName = artistName; AlbumCount = ArtistDataProvider.GetArtistAlbumCount(artistName).ToString(); TrackCount = ArtistDataProvider.GetArtistTrackCount(artistName).ToString(); - TotalCount = AlbumCount + " / " + TrackCount; AlbumArtPath = ArtistDataProvider.GetArtistAlbumArtPath(artistName); IsSelected = false; } @@ -39,11 +38,20 @@ namespace MusicPlayer.Models get => albumCount; set { - string text = string.Equals(value, "1") ? " album" : " albums"; - SetProperty(ref albumCount, value + text); + string text = string.Equals(value, "1") ? "IDS_ALBUM" : "IDS_ALBUMS"; + AlbumTitle = text; + SetProperty(ref albumCount, value); } } + private string albumTitle; + + public string AlbumTitle + { + get => albumTitle; + set => SetProperty(ref albumTitle, value); + } + private string trackCount; public string TrackCount @@ -51,11 +59,20 @@ namespace MusicPlayer.Models get => trackCount; set { - string text = string.Equals(value, "1") ? " track" : " tracks"; - SetProperty(ref trackCount, value + text); + string text = string.Equals(value, "1") ? "IDS_TRACK" : "IDS_TRACKS"; + TrackTitle = text; + SetProperty(ref trackCount,"/ " + value); } } + private string trackTitle; + + public string TrackTitle + { + get => trackTitle; + set => SetProperty(ref trackTitle, value); + } + private string totalCount; public string TotalCount diff --git a/music-player/Models/PlaylistModel.cs b/music-player/Models/PlaylistModel.cs index 7ce0409..d0557a3 100755 --- a/music-player/Models/PlaylistModel.cs +++ b/music-player/Models/PlaylistModel.cs @@ -59,7 +59,20 @@ namespace MusicPlayer.Models public string PlaylistTrackCount { get => playlistTrackCount; - set => SetProperty(ref playlistTrackCount, value); + set + { + string text = string.Equals(value, "1") ? "IDS_TRACK" : "IDS_TRACKS"; + PlaylistTrackTitle = text; + SetProperty(ref playlistTrackCount, value); + } + } + + private string playlistTrackTitle; + + public string PlaylistTrackTitle + { + get => playlistTrackTitle; + set => SetProperty(ref playlistTrackTitle, value); } private string playlistThumbnailPath; diff --git a/music-player/MusicPlayer.cs b/music-player/MusicPlayer.cs index 5fdc80f..87a1423 100755 --- a/music-player/MusicPlayer.cs +++ b/music-player/MusicPlayer.cs @@ -46,7 +46,7 @@ namespace MusicPlayer } catch (Exception ex) { - Tizen.Log.Debug(AppConstants.LogTag, "Failed to write app doamin exception message: "+ex.Message); + Tizen.Log.Debug(AppConstants.LogTag, "Failed to write app doamin exception message: " +ex.Message); } Environment.Exit(1); } diff --git a/music-player/TextResources/Resources.Designer.cs b/music-player/TextResources/Resources.Designer.cs index 02ca3ec..1ec8839 100644 --- a/music-player/TextResources/Resources.Designer.cs +++ b/music-player/TextResources/Resources.Designer.cs @@ -312,6 +312,24 @@ namespace MusicPlayer.TextResources { } } + /// + /// Looks up a localized string similar to Select Items. + /// + internal static string IDS_SELECT_ITEMS { + get { + return ResourceManager.GetString("IDS_SELECT_ITEMS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected. + /// + internal static string IDS_SELECTED { + get { + return ResourceManager.GetString("IDS_SELECTED", resourceCulture); + } + } + /// /// Looks up a localized string similar to Share. /// diff --git a/music-player/TextResources/Resources.en-US.resx b/music-player/TextResources/Resources.en-US.resx index d74bb60..4c78371 100644 --- a/music-player/TextResources/Resources.en-US.resx +++ b/music-player/TextResources/Resources.en-US.resx @@ -198,9 +198,15 @@ Search music + + Selected + Select All + + Select Items + Share diff --git a/music-player/TextResources/Resources.ko-KR.resx b/music-player/TextResources/Resources.ko-KR.resx index 71dc669..4cda689 100644 --- a/music-player/TextResources/Resources.ko-KR.resx +++ b/music-player/TextResources/Resources.ko-KR.resx @@ -198,9 +198,15 @@ 음악 검색 + + 선택한 + 전체 선택 + + 아이템 선택 + 공유 diff --git a/music-player/TextResources/Resources.resx b/music-player/TextResources/Resources.resx index 53f1f57..1824c48 100644 --- a/music-player/TextResources/Resources.resx +++ b/music-player/TextResources/Resources.resx @@ -198,9 +198,15 @@ Search music + + Selected + Select All + + Select Items + Share diff --git a/music-player/ViewModels/AlbumDetailViewModel.cs b/music-player/ViewModels/AlbumDetailViewModel.cs index 22ebc19..747dea5 100755 --- a/music-player/ViewModels/AlbumDetailViewModel.cs +++ b/music-player/ViewModels/AlbumDetailViewModel.cs @@ -87,11 +87,20 @@ namespace MusicPlayer.ViewModels get => totalTracks; set { - string text = string.Equals(value, "1") ? " Track" : " Tracks"; - SetProperty(ref totalTracks, value + text); + string text = string.Equals(value, "1") ? "IDS_TRACK" : "IDS_TRACKS"; + TracksTitle = text; + SetProperty(ref totalTracks, value); } } + private string tracksTitle; + + public string TracksTitle + { + get => tracksTitle; + set => SetProperty(ref tracksTitle, value); + } + // TODO do we really need this ? public void OnViewDeleted() { diff --git a/music-player/ViewModels/AlbumViewModel.cs b/music-player/ViewModels/AlbumViewModel.cs index 304e5b8..169507a 100755 --- a/music-player/ViewModels/AlbumViewModel.cs +++ b/music-player/ViewModels/AlbumViewModel.cs @@ -32,8 +32,8 @@ namespace MusicPlayer.ViewModels set { string text = string.Equals(value, "1") ? " IDS_ALBUM" : "IDS_ALBUM"; + AlbumTitle = text; SetProperty(ref albumCount, value); - SetProperty(ref albumTitle, text); } } @@ -42,6 +42,7 @@ namespace MusicPlayer.ViewModels public string AlbumTitle { get => albumTitle; + set =>SetProperty(ref albumTitle, value); } private void CreateAlbumData() diff --git a/music-player/ViewModels/ArtistViewModel.cs b/music-player/ViewModels/ArtistViewModel.cs index 20be9a8..17f4eb8 100755 --- a/music-player/ViewModels/ArtistViewModel.cs +++ b/music-player/ViewModels/ArtistViewModel.cs @@ -31,8 +31,8 @@ namespace MusicPlayer.ViewModels set { string text = string.Equals(value, "1") ? "IDS_ARTIST" : "IDS_ARTISTS"; + ArtistTitle = text; SetProperty(ref artistCount, value); - SetProperty(ref artistTitle, text); } } @@ -41,6 +41,7 @@ namespace MusicPlayer.ViewModels public string ArtistTitle { get => artistTitle; + set => SetProperty(ref artistTitle, value); } private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) diff --git a/music-player/ViewModels/PlaylistDetailViewModel.cs b/music-player/ViewModels/PlaylistDetailViewModel.cs index a8bad4b..a43c173 100755 --- a/music-player/ViewModels/PlaylistDetailViewModel.cs +++ b/music-player/ViewModels/PlaylistDetailViewModel.cs @@ -69,8 +69,8 @@ namespace MusicPlayer.ViewModels set { string text = string.Equals(value, "1") ? "IDS_TRACK" : "IDS_TRACKS"; + PlaylistTrackTitle = text; SetProperty(ref playlistTrackCount, value); - SetProperty(ref playlistTrackTitle, text); } } @@ -79,6 +79,7 @@ namespace MusicPlayer.ViewModels public string PlaylistTrackTitle { get => playlistTrackTitle; + set => SetProperty(ref playlistTrackTitle, value); } private bool isDefaultPlaylist; diff --git a/music-player/ViewModels/PlaylistSelectorViewModel.cs b/music-player/ViewModels/PlaylistSelectorViewModel.cs index 7916cb7..28a30d2 100755 --- a/music-player/ViewModels/PlaylistSelectorViewModel.cs +++ b/music-player/ViewModels/PlaylistSelectorViewModel.cs @@ -127,7 +127,7 @@ namespace MusicPlayer.ViewModels private string GetTrackCountForPlaylist(int playlistId) { int trackCount = PlaylistManager.Instance.PlaylistTrackCount(playlistId); - return trackCount > 1 ? trackCount.ToString() + " tracks" : trackCount.ToString() + " track"; + return trackCount.ToString(); } private int UpdateLength(int length, int count) diff --git a/music-player/ViewModels/PlaylistViewModel.cs b/music-player/ViewModels/PlaylistViewModel.cs index c7c9c81..6c9291b 100755 --- a/music-player/ViewModels/PlaylistViewModel.cs +++ b/music-player/ViewModels/PlaylistViewModel.cs @@ -53,8 +53,8 @@ namespace MusicPlayer.ViewModels set { string text = string.Equals(value, "1") ? "IDS_PLAYLIST" : "IDS_PLAYLISTS"; + PlaylistTitle = text; SetProperty(ref playlistCount, value); - SetProperty(ref playlistTitle, text); } } @@ -63,6 +63,7 @@ namespace MusicPlayer.ViewModels public string PlaylistTitle { get => playlistTitle; + set => SetProperty(ref playlistTitle, value); } private bool canCreatePlaylist; @@ -115,7 +116,7 @@ namespace MusicPlayer.ViewModels private string GetTrackCountText(int trackCount) { - return trackCount > 1 ? trackCount.ToString() + " tracks" : trackCount.ToString() + " track"; + return trackCount.ToString(); } private void AddDefaultPlaylist(List list) diff --git a/music-player/ViewModels/SelectorViewModel.cs b/music-player/ViewModels/SelectorViewModel.cs index cb2e6dc..5e4f7f6 100755 --- a/music-player/ViewModels/SelectorViewModel.cs +++ b/music-player/ViewModels/SelectorViewModel.cs @@ -28,11 +28,30 @@ namespace MusicPlayer.ViewModels get => selectedCount; set { - string text = string.Equals(value, "0") ? "Select Items" : value + " Selected"; - SetProperty(ref selectedCount, text); + string count; + string label; + if (string.Equals(value, "0")) + { + count = ""; + label = "IDS_SELECT_ITEMS"; + } + else + { + count = value; + label = "IDS_SELECTED"; + } + SelectedTitle = label; + SetProperty(ref selectedCount, count); } } + private string selectedTitle; + public string SelectedTitle + { + get => selectedTitle; + set => SetProperty(ref selectedTitle, value); + } + public int TotalCount { get; set; } public List TrackList { get; set; } diff --git a/music-player/ViewModels/TrackViewModel.cs b/music-player/ViewModels/TrackViewModel.cs index 7d8bc77..3baca29 100755 --- a/music-player/ViewModels/TrackViewModel.cs +++ b/music-player/ViewModels/TrackViewModel.cs @@ -57,8 +57,8 @@ namespace MusicPlayer.ViewModels set { string text = string.Equals(value, "1") ? "IDS_TRACK" : "IDS_TRACKS"; + TrackTitle = text; SetProperty(ref trackCount, value); - SetProperty(ref trackTitle, text); } } @@ -67,6 +67,7 @@ namespace MusicPlayer.ViewModels public string TrackTitle { get => trackTitle; + set => SetProperty(ref trackTitle, value); } public Track PlayingTrack { get; set; } diff --git a/music-player/Views/AlbumDetailView.cs b/music-player/Views/AlbumDetailView.cs index a496151..b4c2b39 100755 --- a/music-player/Views/AlbumDetailView.cs +++ b/music-player/Views/AlbumDetailView.cs @@ -36,7 +36,9 @@ namespace MusicPlayer.Views Layout = baseLayout; albumInfoView = CreateLeftView(); countLabel.BindingContext = viewModel; + countTitleLabel.BindingContext = viewModel; countLabel.SetBinding(TextLabel.TextProperty, "TotalTracks"); + countTitleLabel.SetBinding(TextLabel.TranslatableTextProperty, "TracksTitle"); collectionView.BindingContext = viewModel; UpdateCollectionView(); Add(listContainer); diff --git a/music-player/Views/ArtistView.cs b/music-player/Views/ArtistView.cs index 54d63c3..b1d1fcb 100755 --- a/music-player/Views/ArtistView.cs +++ b/music-player/Views/ArtistView.cs @@ -27,7 +27,10 @@ namespace MusicPlayer.Views ListItemLayout layout = new ListItemLayout(); layout.Icon.SetBinding(ImageView.ResourceUrlProperty, "AlbumArtPath"); layout.TitleLabel.SetBinding(TextLabel.TextProperty, "ArtistName"); - layout.SubtitleLabel.SetBinding(TextLabel.TextProperty, "TotalCount"); + layout.SubtitleLabel.SetBinding(TextLabel.TextProperty, "AlbumCount"); + layout.SubtitleLabel2.SetBinding(TextLabel.TranslatableTextProperty, "AlbumTitle"); + layout.SubtitleLabel3.SetBinding(TextLabel.TextProperty, "TrackCount"); + layout.SubtitleLabel4.SetBinding(TextLabel.TranslatableTextProperty, "TrackTitle"); return layout; }); collectionView.ScrollingDirection = ScrollableBase.Direction.Vertical; diff --git a/music-player/Views/BaseSubContentView.cs b/music-player/Views/BaseSubContentView.cs index 99749ba..69eed42 100755 --- a/music-player/Views/BaseSubContentView.cs +++ b/music-player/Views/BaseSubContentView.cs @@ -259,6 +259,7 @@ namespace MusicPlayer.Views if (type == DisposeTypes.Explicit) { topView.Remove(countLabel); + topView.Remove(countTitleLabel); topView.Remove(playAllWithShuffle); topView.Remove(playAll); @@ -274,6 +275,8 @@ namespace MusicPlayer.Views countLabel.Dispose(); countLabel = null; + countTitleLabel.Dispose(); + countTitleLabel = null; playAllWithShuffle.Dispose(); playAllWithShuffle = null; playAll.Dispose(); diff --git a/music-player/Views/ListItemLayout.cs b/music-player/Views/ListItemLayout.cs index 0ca017b..c8219c3 100755 --- a/music-player/Views/ListItemLayout.cs +++ b/music-player/Views/ListItemLayout.cs @@ -11,11 +11,14 @@ namespace MusicPlayer.Views { private const int IconSize = 70; private const int SeperatorHeight = 2; - private View itemSeperator; private View textView; + private View subtitleView; private TextLabel titleLabel; private TextLabel subtitleLabel; + private TextLabel subtitleLabel2; + private TextLabel subtitleLabel3; + private TextLabel subtitleLabel4; private ImageView icon; private Button playPauseIcon; private bool isAnimating = false; @@ -106,18 +109,21 @@ namespace MusicPlayer.Views }; textView.Add(titleLabel); - subtitleLabel = new TextLabel() + subtitleView = new View() { - WidthSpecification = LayoutParamPolicies.MatchParent, + BackgroundColor = Color.Transparent, HeightSpecification = 36.SpToPx(), - PixelSize = 24.SpToPx(), - FontFamily = "BreezeSans", - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Center, - FontStyle = UIFontStyles.AllNormal, - Ellipsis = true, + WidthSpecification = LayoutParamPolicies.MatchParent, + Layout = new LinearLayout() + { + LinearOrientation = LinearLayout.Orientation.Horizontal, + HorizontalAlignment = HorizontalAlignment.Begin, + VerticalAlignment = VerticalAlignment.Center, + CellPadding = new Size2D(8, 0), + } }; - textView.Add(subtitleLabel); + textView.Add(subtitleView); + AddSubtitlelabels(); UpdateLabelColors(); itemSeperator = new View() @@ -131,6 +137,35 @@ namespace MusicPlayer.Views ThemeManager.ThemeChanged += OnThemeUpdated; } + + void AddSubtitlelabels() + { + subtitleLabel = CreateSubtitleLabel(); + subtitleLabel2 = CreateSubtitleLabel(); + subtitleLabel3 = CreateSubtitleLabel(); + subtitleLabel4 = CreateSubtitleLabel(); + subtitleLabel2.WidthSpecification = 102.SpToPx(); + subtitleLabel4.WidthSpecification = 102.SpToPx(); + subtitleView.Add(subtitleLabel); + subtitleView.Add(subtitleLabel2); + subtitleView.Add(subtitleLabel3); + subtitleView.Add(subtitleLabel4); + } + + private TextLabel CreateSubtitleLabel() + { + TextLabel Label = new TextLabel() + { + HeightSpecification = 36.SpToPx(), + PixelSize = 24.SpToPx(), + FontFamily = "BreezeSans", + HorizontalAlignment = HorizontalAlignment.Begin, + VerticalAlignment = VerticalAlignment.Center, + FontStyle = UIFontStyles.AllNormal, + Ellipsis = true, + }; + return Label; + } public ImageView Icon { get => icon; @@ -139,10 +174,23 @@ namespace MusicPlayer.Views { get => titleLabel; } + public TextLabel SubtitleLabel { get => subtitleLabel; } + public TextLabel SubtitleLabel2 + { + get => subtitleLabel2; + } + public TextLabel SubtitleLabel3 + { + get => subtitleLabel3; + } + public TextLabel SubtitleLabel4 + { + get => subtitleLabel4; + } private bool isPlaying = false; @@ -168,6 +216,7 @@ namespace MusicPlayer.Views } if (type == DisposeTypes.Explicit) { + ThemeManager.ThemeChanged -= OnThemeUpdated; Remove(itemSeperator); itemSeperator?.Dispose(); itemSeperator = null; @@ -182,10 +231,26 @@ namespace MusicPlayer.Views titleLabel?.Dispose(); titleLabel = null; - textView.Remove(subtitleLabel); + subtitleView.Remove(subtitleLabel); subtitleLabel?.Dispose(); subtitleLabel = null; + subtitleView.Remove(subtitleLabel2); + subtitleLabel2?.Dispose(); + subtitleLabel2 = null; + + subtitleView.Remove(subtitleLabel3); + subtitleLabel3?.Dispose(); + subtitleLabel3 = null; + + subtitleView.Remove(subtitleLabel4); + subtitleLabel4?.Dispose(); + subtitleLabel4 = null; + + textView.Remove(subtitleView); + subtitleView?.Dispose(); + subtitleView = null; + Remove(textView); textView?.Dispose(); textView = null; @@ -202,11 +267,23 @@ namespace MusicPlayer.Views { titleLabel.TextColor = UIColors.HEX1473E6; } - if(subtitleLabel != null) + if (subtitleLabel != null) { subtitleLabel.TextColor = UIColors.HEX1473E6; } - if(isAnimationRequired && isAnimating == false) + if (subtitleLabel2 != null) + { + subtitleLabel2.TextColor = UIColors.HEX1473E6; + } + if (subtitleLabel3 != null) + { + subtitleLabel3.TextColor = UIColors.HEX1473E6; + } + if (subtitleLabel4 != null) + { + subtitleLabel4.TextColor = UIColors.HEX1473E6; + } + if (isAnimationRequired && isAnimating == false) { isAnimating = AddAnimation(); } @@ -258,10 +335,22 @@ namespace MusicPlayer.Views { titleLabel.TextColor = UIColors.HEX001447; } - if(subtitleLabel != null) + if (subtitleLabel != null) { subtitleLabel.TextColor = UIColors.HEX001447; } + if (subtitleLabel2 != null) + { + subtitleLabel2.TextColor = UIColors.HEX001447; + } + if (subtitleLabel3 != null) + { + subtitleLabel3.TextColor = UIColors.HEX001447; + } + if (subtitleLabel4 != null) + { + subtitleLabel4.TextColor = UIColors.HEX001447; + } } else if(currentPlatformThemeId.Equals(AppConstants.DarkPlatformThemeId)) { @@ -269,10 +358,22 @@ namespace MusicPlayer.Views { titleLabel.TextColor = Color.White; } - if(subtitleLabel != null) + if (subtitleLabel != null) { subtitleLabel.TextColor = Color.White; } + if (subtitleLabel2 != null) + { + subtitleLabel2.TextColor = Color.White; + } + if (subtitleLabel3 != null) + { + subtitleLabel3.TextColor = Color.White; + } + if (subtitleLabel4 != null) + { + subtitleLabel4.TextColor = Color.White; + } } } diff --git a/music-player/Views/PlaylistView.cs b/music-player/Views/PlaylistView.cs index 7d904d1..d572031 100755 --- a/music-player/Views/PlaylistView.cs +++ b/music-player/Views/PlaylistView.cs @@ -31,6 +31,7 @@ namespace MusicPlayer.Views layout.Icon.SetBinding(ImageView.ResourceUrlProperty, "PlaylistThumbnailPath"); layout.TitleLabel.SetBinding(TextLabel.TextProperty, "PlaylistName"); layout.SubtitleLabel.SetBinding(TextLabel.TextProperty, "PlaylistTrackCount"); + layout.SubtitleLabel2.SetBinding(TextLabel.TranslatableTextProperty, "PlaylistTrackTitle"); return layout; }); collectionView.SelectionChanged += OnPlaylistSelectionChange; diff --git a/music-player/Views/SelectListLayout.cs b/music-player/Views/SelectListLayout.cs index c12a9cb..5a97e10 100755 --- a/music-player/Views/SelectListLayout.cs +++ b/music-player/Views/SelectListLayout.cs @@ -13,8 +13,12 @@ namespace MusicPlayer.Views private CheckBox checkBox; private View itemSeperator; private View textView; + private View subtitleView; private TextLabel titleLabel; private TextLabel subtitleLabel; + private TextLabel subtitleLabel2; + private TextLabel subtitleLabel3; + private TextLabel subtitleLabel4; private ImageView icon; public SelectListLayout() : base() @@ -81,19 +85,21 @@ namespace MusicPlayer.Views }; textView.Add(titleLabel); - subtitleLabel = new TextLabel() + subtitleView = new View() { - StyleName = "ItemLabel", - WidthSpecification = LayoutParamPolicies.MatchParent, + BackgroundColor = Color.Transparent, HeightSpecification = 36.SpToPx(), - PixelSize = 24.SpToPx(), - FontFamily = "BreezeSans", - HorizontalAlignment = HorizontalAlignment.Begin, - VerticalAlignment = VerticalAlignment.Center, - FontStyle = UIFontStyles.AllNormal, - Ellipsis = true, + WidthSpecification = LayoutParamPolicies.MatchParent, + Layout = new LinearLayout() + { + LinearOrientation = LinearLayout.Orientation.Horizontal, + HorizontalAlignment = HorizontalAlignment.Begin, + VerticalAlignment = VerticalAlignment.Center, + CellPadding = new Size2D(8, 0), + } }; - textView.Add(subtitleLabel); + textView.Add(subtitleView); + AddSubtitlelabels(); itemSeperator = new View() { @@ -106,6 +112,35 @@ namespace MusicPlayer.Views IsSelected = false; } + void AddSubtitlelabels() + { + subtitleLabel = CreateSubtitleLabel(); + subtitleLabel2 = CreateSubtitleLabel(); + subtitleLabel3 = CreateSubtitleLabel(); + subtitleLabel4 = CreateSubtitleLabel(); + subtitleLabel2.WidthSpecification = 102.SpToPx(); + subtitleLabel4.WidthSpecification = 102.SpToPx(); + subtitleView.Add(subtitleLabel); + subtitleView.Add(subtitleLabel2); + subtitleView.Add(subtitleLabel3); + subtitleView.Add(subtitleLabel4); + } + + private TextLabel CreateSubtitleLabel() + { + TextLabel Label = new TextLabel() + { + HeightSpecification = 36.SpToPx(), + PixelSize = 24.SpToPx(), + FontFamily = "BreezeSans", + HorizontalAlignment = HorizontalAlignment.Begin, + VerticalAlignment = VerticalAlignment.Center, + FontStyle = UIFontStyles.AllNormal, + Ellipsis = true, + }; + return Label; + } + public ImageView Icon { get => icon; @@ -119,6 +154,19 @@ namespace MusicPlayer.Views get => subtitleLabel; } + public TextLabel SubtitleLabel2 + { + get => subtitleLabel2; + } + + public TextLabel SubtitleLabel3 + { + get => subtitleLabel3; + } + public TextLabel SubtitleLabel4 + { + get => subtitleLabel4; + } public CheckBox Checkbox { get => checkBox; @@ -148,10 +196,26 @@ namespace MusicPlayer.Views titleLabel?.Dispose(); titleLabel = null; - textView.Remove(subtitleLabel); + subtitleView.Remove(subtitleLabel); subtitleLabel?.Dispose(); subtitleLabel = null; + subtitleView.Remove(subtitleLabel2); + subtitleLabel2?.Dispose(); + subtitleLabel2 = null; + + subtitleView.Remove(subtitleLabel3); + subtitleLabel3?.Dispose(); + subtitleLabel3 = null; + + subtitleView.Remove(subtitleLabel4); + subtitleLabel4?.Dispose(); + subtitleLabel4 = null; + + textView.Remove(subtitleView); + subtitleView?.Dispose(); + subtitleView = null; + Remove(textView); textView?.Dispose(); textView = null; diff --git a/music-player/Views/SelectorView.cs b/music-player/Views/SelectorView.cs index ef22beb..6f5ac70 100755 --- a/music-player/Views/SelectorView.cs +++ b/music-player/Views/SelectorView.cs @@ -23,6 +23,7 @@ namespace MusicPlayer.Views private View topView; private View selAllView; private TextLabel selectedCountLabel; + private TextLabel selectedCountLabel2; private CheckBox selAllButton; private Button cancelButton; private Button doneButton; @@ -105,15 +106,29 @@ namespace MusicPlayer.Views HorizontalAlignment = HorizontalAlignment.Begin, VerticalAlignment = VerticalAlignment.Center, Ellipsis = true, + Margin = new Extents(0, 4, 0, 0).SpToPx(), }; selectedCountLabel.BindingContext = viewModel; selectedCountLabel.SetBinding(TextLabel.TextProperty, "SelectedCount"); topView.Add(selectedCountLabel); - RelativeLayout.SetLeftTarget(selectedCountLabel, topView); - RelativeLayout.SetLeftRelativeOffset(selectedCountLabel, 0.0f); - RelativeLayout.SetFillHorizontal(selectedCountLabel, true); - RelativeLayout.SetVerticalAlignment(selectedCountLabel, RelativeLayout.Alignment.Center); + selectedCountLabel2 = new TextLabel() + { + StyleName = "TitleText", + HeightSpecification = 48.SpToPx(), + PixelSize = 32.SpToPx(), + FontFamily = "BreezeSans", + HorizontalAlignment = HorizontalAlignment.Begin, + VerticalAlignment = VerticalAlignment.Center, + Ellipsis = true, + Margin = new Extents(4, 0, 0, 0).SpToPx(), + }; + selectedCountLabel2.BindingContext = viewModel; + selectedCountLabel2.SetBinding(TextLabel.TranslatableTextProperty, "SelectedTitle"); + topView.Add(selectedCountLabel2); + + RelativeLayout.SetLeftTarget(selectedCountLabel2, selectedCountLabel); + RelativeLayout.SetLeftRelativeOffset(selectedCountLabel2, 1.0f); } private void AddButtons() @@ -347,7 +362,10 @@ namespace MusicPlayer.Views SelectListLayout layout = new SelectListLayout(); layout.Icon.SetBinding(ImageView.ResourceUrlProperty, "AlbumArtPath"); layout.TitleLabel.SetBinding(TextLabel.TextProperty, "ArtistName"); - layout.SubtitleLabel.SetBinding(TextLabel.TextProperty, "TotalCount"); + layout.SubtitleLabel.SetBinding(TextLabel.TextProperty, "AlbumCount"); + layout.SubtitleLabel2.SetBinding(TextLabel.TranslatableTextProperty, "AlbumTitle"); + layout.SubtitleLabel3.SetBinding(TextLabel.TextProperty, "TrackCount"); + layout.SubtitleLabel4.SetBinding(TextLabel.TranslatableTextProperty, "TrackTitle"); layout.Checkbox.SetBinding(Button.IsSelectedProperty, "IsSelected"); return layout; }); @@ -361,6 +379,7 @@ namespace MusicPlayer.Views layout.Icon.SetBinding(ImageView.ResourceUrlProperty, "PlaylistThumbnailPath"); layout.TitleLabel.SetBinding(TextLabel.TextProperty, "PlaylistName"); layout.SubtitleLabel.SetBinding(TextLabel.TextProperty, "PlaylistTrackCount"); + layout.SubtitleLabel2.SetBinding(TextLabel.TranslatableTextProperty, "PlaylistTrackTitle"); layout.Checkbox.SetBinding(Button.IsSelectedProperty, "PlaylistIsSelected"); return layout; }); @@ -374,7 +393,6 @@ namespace MusicPlayer.Views { List oldSel = new List(ev.PreviousSelection); List newSel = new List(ev.CurrentSelection); - foreach (object item in oldSel) { if (item != null && !newSel.Contains(item)) @@ -468,7 +486,6 @@ namespace MusicPlayer.Views } } } - viewModel.SelectedCount = itemCount.ToString(); doneButton.IsEnabled = itemCount != 0; Tizen.Log.Debug(AppConstants.LogTag, "Total tracks selected " + selectedItemList.Count); diff --git a/packaging/org.tizen.MusicPlayer-1.0.0.tpk b/packaging/org.tizen.MusicPlayer-1.0.0.tpk index a1144a5..6e34808 100755 Binary files a/packaging/org.tizen.MusicPlayer-1.0.0.tpk and b/packaging/org.tizen.MusicPlayer-1.0.0.tpk differ