Fix Text not appearing issue for giant font size 53/320153/1
authorMd. Farhan Mahtab/NC eXperience Group /SRBD/Engineer/Samsung Electronics <farhan.m1@samsung.com>
Fri, 8 Nov 2024 08:18:43 +0000 (14:18 +0600)
committerMd. Farhan Mahtab/NC eXperience Group /SRBD/Engineer/Samsung Electronics <farhan.m1@samsung.com>
Fri, 8 Nov 2024 08:19:40 +0000 (14:19 +0600)
[Problem][TNINE-5253][MusicPlayer] Text doesn't appear properly in giant font size
[Cause & Measure]
 Cause   : All TextLabel's view height is configured in context of Normal font
 Measure : Adjusted all TextLabel's height for maximum font size

Change-Id: Idbb15adc7b67d635a830e1b044b630fe55a5242d
Signed-off-by: Md. Farhan Mahtab/NC eXperience Group /SRBD/Engineer/Samsung Electronics <farhan.m1@samsung.com>
16 files changed:
music-player/ViewModels/AlbumViewModel.cs
music-player/Views/AlbumDetailLayout.cs
music-player/Views/AlbumDetailView.cs
music-player/Views/ArtistDetailGroupLayout.cs
music-player/Views/ArtistDetailItemLayout.cs
music-player/Views/BaseContentView.cs
music-player/Views/BaseSubContentView.cs
music-player/Views/BaseView.cs
music-player/Views/ListItemLayout.cs
music-player/Views/MiniPlayer.cs
music-player/Views/PlayerView.cs
music-player/Views/PlaylistView.cs
music-player/Views/SearchView.cs
music-player/Views/SelectListLayout.cs
music-player/Views/SelectorView.cs
music-player/Views/TrackDetailView.cs

index 169507a03a1e07156633a81521585df06663d53b..170694e7e3ba9c316e205ffdf72cedbe0412ec8d 100755 (executable)
@@ -31,7 +31,7 @@ namespace MusicPlayer.ViewModels
             get => albumCount;\r
             set\r
             {\r
-                string text = string.Equals(value, "1") ? " IDS_ALBUM" : "IDS_ALBUM";\r
+                string text = string.Equals(value, "1") ? "IDS_ALBUM" : "IDS_ALBUMS";\r
                 AlbumTitle = text;\r
                 SetProperty(ref albumCount, value);\r
             }\r
index c301ea865ef4ddc982cdc83430cf63458bd1087a..4b7d9131261f04bf66cea2da8abb8a241a66bb80 100755 (executable)
@@ -54,7 +54,7 @@ namespace MusicPlayer.Views
         {\r
             textView = new View()\r
             {\r
-                HeightSpecification = 84.SpToPx(),\r
+                HeightSpecification = 108.SpToPx(),\r
                 WidthSpecification = (DeviceInfo.IsPortrait ? 748 : 564).SpToPx(),\r
                 BackgroundColor = Color.Transparent,\r
                 Layout = new LinearLayout()\r
@@ -77,7 +77,7 @@ namespace MusicPlayer.Views
             titleLabel = new TextLabel()\r
             {\r
                 WidthSpecification = LayoutParamPolicies.MatchParent,\r
-                HeightSpecification = 48.SpToPx(),\r
+                HeightSpecification = 62.SpToPx(),\r
                 PixelSize = 32.SpToPx(),\r
                 FontFamily = "BreezeSans",\r
                 HorizontalAlignment = HorizontalAlignment.Begin,\r
@@ -93,7 +93,7 @@ namespace MusicPlayer.Views
             subtitleLabel = new TextLabel()\r
             {\r
                 WidthSpecification = LayoutParamPolicies.MatchParent,\r
-                HeightSpecification = 36.SpToPx(),\r
+                HeightSpecification = 46.SpToPx(),\r
                 PixelSize = 24.SpToPx(),\r
                 FontFamily = "BreezeSans",\r
                 HorizontalAlignment = HorizontalAlignment.Begin,\r
@@ -109,7 +109,7 @@ namespace MusicPlayer.Views
             additionalLabel = new TextLabel()\r
             {\r
                 WidthSpecification = 108.SpToPx(),\r
-                HeightSpecification = 36.SpToPx(),\r
+                HeightSpecification = 46.SpToPx(),\r
                 PixelSize = 24.SpToPx(),\r
                 FontFamily = "BreezeSans",\r
                 VerticalAlignment = VerticalAlignment.Center,\r
index ac0919905574474d6889651353bbe3c0b84df974..d1c6efc35dc0ea2f135402dea22571a9062c90e4 100755 (executable)
@@ -189,7 +189,7 @@ namespace MusicPlayer.Views
                 StyleName = "LabelText",\r
                 ThemeChangeSensitive = true,\r
                 WidthSpecification = (DeviceInfo.IsPortrait ? 508 : 640).SpToPx(),\r
-                HeightSpecification = 36.SpToPx(),\r
+                HeightSpecification = 46.SpToPx(),\r
                 PixelSize = 24.SpToPx(),\r
                 FontFamily = "BreezeSans",\r
                 HorizontalAlignment = HorizontalAlignment.Center,\r
index d8e1657a35fc31ce792bd7e0fc6c445d28e93fc9..985d52b6a16d0373cf59d7e123d627aab3c73d80 100755 (executable)
@@ -62,7 +62,7 @@ namespace MusicPlayer.Views
             TextLabel titleLabel = new TextLabel()
             {
                 StyleName = "ItemLabel",
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 56.SpToPx(),
                 PixelSize = 32.SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Begin,
index c320649d16eb9627e95150afaf347527e8c349eb..96e8fa0368a124b8692915bf67f5f6a9a024b32d 100755 (executable)
@@ -62,7 +62,7 @@ namespace MusicPlayer.Views
         {
             titleLabel = new TextLabel()
             {
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 62.SpToPx(),
                 PixelSize = 32.SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Begin,
@@ -83,7 +83,7 @@ namespace MusicPlayer.Views
             extraLabel = new TextLabel()
             {
                 WidthSpecification = 160.SpToPx(),
-                HeightSpecification = 36.SpToPx(),
+                HeightSpecification = 46.SpToPx(),
                 PixelSize = 24.SpToPx(),
                 FontFamily = "BreezeSans",
                 VerticalAlignment = VerticalAlignment.Center,
index 681c53f3f9c304b7d99b9154249b6e4e7de1b8f0..e7a60abbaba5a836cae24072ecc89317f57b82ae 100755 (executable)
@@ -154,7 +154,7 @@ namespace MusicPlayer.Views
                 TextLabel textLabel = new TextLabel()
                 {
                     StyleName = "TitleText",
-                    Size2D = new Size2D(234, 36).SpToPx(),
+                    Size2D = new Size2D(290, 62).SpToPx(),
                     TranslatableText = "IDS_NO_ITEMS_IN_FOLDER",
                     PixelSize = 24.SpToPx(),
                     FontFamily = "BreezeSans",
index bef577f85d08b75ef447ebddf1c6d2a9d7c6c876..ec6cdd075047e983e462806d2d09967faf549318 100755 (executable)
@@ -165,7 +165,7 @@ namespace MusicPlayer.Views
                 TextLabel textLabel = new TextLabel()
                 {
                     StyleName = "TitleText",
-                    Size2D = new Size2D(234, 36).SpToPx(),
+                    Size2D = new Size2D(234, 62).SpToPx(),
                     TranslatableText = "IDS_NO_ITEMS_IN_FOLDER",
                     PixelSize = 24.SpToPx(),
                     FontFamily = "BreezeSans",
index 91c4a2880ad2cfe7f2e3937184c51d524f1575ca..a31ca843a216532e2b038e6b5be19583d78e8d8b 100755 (executable)
@@ -109,6 +109,38 @@ namespace MusicPlayer.Views
             backButton = null;
             moreButton = null;
             searchButton = null;
+            UpdateTopViewHeightForFontSize(Tizen.System.SystemSettings.FontSize);
+            Tizen.System.SystemSettings.FontSizeChanged += FontSizeEventHandler;
+        }
+
+
+        private void FontSizeEventHandler(object sender, Tizen.System.FontSizeChangedEventArgs e)
+        {
+            UpdateTopViewHeightForFontSize(e.Value);
+        }
+
+        public void UpdateTopViewHeightForFontSize(Tizen.System.SystemSettingsFontSize fontSize)
+        {
+            if (fontSize == Tizen.System.SystemSettingsFontSize.Small)
+            {
+                topView.HeightSpecification = 115.SpToPx();
+            }
+            else if (fontSize == Tizen.System.SystemSettingsFontSize.Normal)
+            {
+                topView.HeightSpecification = 120.SpToPx();
+            }
+            else if(fontSize == Tizen.System.SystemSettingsFontSize.Large)
+            {
+                topView.HeightSpecification = 125.SpToPx();
+            }
+            else if (fontSize == Tizen.System.SystemSettingsFontSize.Huge)
+            {
+                topView.HeightSpecification = 130.SpToPx();
+            }
+            else if (fontSize == Tizen.System.SystemSettingsFontSize.Giant)
+            {
+                topView.HeightSpecification = 135.SpToPx();
+            }
         }
 
         public void resetTitleLabel( bool backButtonShown)
@@ -332,6 +364,7 @@ namespace MusicPlayer.Views
             {
                 if (topView != null)
                 {
+                    Tizen.System.SystemSettings.FontSizeChanged -= FontSizeEventHandler;
                     List<View> children = topView.Children;
                     foreach (View child in children)
                     {
index c8219c3e1f45e44eef9fba383000d0599e8c330e..e36e929d4e4320f712177788f94cc7dbb30c6064 100755 (executable)
@@ -135,7 +135,41 @@ namespace MusicPlayer.Views
             Add(itemSeperator);\r
             RelativeLayout.SetVerticalAlignment(itemSeperator, RelativeLayout.Alignment.End);\r
 \r
+            UpdateTextViewHeightForFontSize(Tizen.System.SystemSettings.FontSize);\r
+\r
             ThemeManager.ThemeChanged += OnThemeUpdated;\r
+            Tizen.System.SystemSettings.FontSizeChanged += FontSizeEventhandler;\r
+        }\r
+\r
+        private void FontSizeEventhandler(object o, Tizen.System.FontSizeChangedEventArgs e)\r
+        {\r
+            UpdateTextViewHeightForFontSize(e.Value);\r
+        }\r
+\r
+        public void UpdateTextViewHeightForFontSize(Tizen.System.SystemSettingsFontSize fontSize)\r
+        {\r
+            int textViewHeight = 82;\r
+            int increment = 3;\r
+             if (fontSize == Tizen.System.SystemSettingsFontSize.Normal)\r
+            {\r
+                textViewHeight += 1 * increment;\r
+            }\r
+            else if (fontSize == Tizen.System.SystemSettingsFontSize.Large)\r
+            {\r
+                textViewHeight += 2 * increment;\r
+            }\r
+            else if (fontSize == Tizen.System.SystemSettingsFontSize.Huge)\r
+            {\r
+                textViewHeight += 3 * increment;\r
+            }\r
+            else if (fontSize == Tizen.System.SystemSettingsFontSize.Giant)\r
+            {\r
+                textViewHeight += 6 * increment;\r
+            }\r
+            textView.HeightSpecification = textViewHeight.SpToPx();\r
+            titleLabel.HeightSpecification = (textViewHeight * 4 / 7).SpToPx();\r
+            subtitleView.HeightSpecification = (textViewHeight * 3 / 7).SpToPx();\r
+\r
         }\r
 \r
         void AddSubtitlelabels()\r
@@ -156,7 +190,7 @@ namespace MusicPlayer.Views
         {\r
             TextLabel Label = new TextLabel()\r
             {\r
-                HeightSpecification = 36.SpToPx(),\r
+                HeightSpecification = LayoutParamPolicies.MatchParent,\r
                 PixelSize = 24.SpToPx(),\r
                 FontFamily = "BreezeSans",\r
                 HorizontalAlignment = HorizontalAlignment.Begin,\r
@@ -216,6 +250,7 @@ namespace MusicPlayer.Views
             }\r
             if (type == DisposeTypes.Explicit)\r
             {\r
+                Tizen.System.SystemSettings.FontSizeChanged -= FontSizeEventhandler;\r
                 ThemeManager.ThemeChanged -= OnThemeUpdated;\r
                 Remove(itemSeperator);\r
                 itemSeperator?.Dispose();\r
index de86828ce7d0a3f5afe7fc02bc017545858ee1a8..889a01632cfc1343bae8d6b53481ae0176e6abd2 100755 (executable)
@@ -90,7 +90,7 @@ namespace MusicPlayer.Views
                     VerticalAlignment = VerticalAlignment.Center,
                 },
                 BackgroundColor = Color.Transparent,
-                HeightSpecification = 76.SpToPx(),
+                HeightSpecification = 108.SpToPx(),
                 WidthSpecification = DeviceInfo.IsPortrait ? Window.Instance.Size.Width - 64.SpToPx() : (int)((Window.Instance.Size.Width - 128.SpToPx()) * 0.65f),
             };
             baseView.Add(leftView);
@@ -122,7 +122,7 @@ namespace MusicPlayer.Views
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
                 },
-                HeightSpecification = 76.SpToPx(),
+                HeightSpecification = LayoutParamPolicies.MatchParent,
                 WidthResizePolicy = ResizePolicyType.FillToParent,
                 Margin = (DeviceInfo.IsPortrait ? new Extents(24, 0, 0, 0) : new Extents(30, 0, 0, 0)).SpToPx(),
             };
@@ -154,7 +154,7 @@ namespace MusicPlayer.Views
                 StyleName = "TitleText",
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 62.SpToPx(),
                 PixelSize = 36.SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Begin,
@@ -172,7 +172,7 @@ namespace MusicPlayer.Views
                 StyleName = "TitleText",
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 28.SpToPx(),
+                HeightSpecification = 46.SpToPx(),
                 PixelSize = 19.SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Begin,
index 1cab4b320e680b8d04fd4e7c7692d577323b38ec..a434f2b0a1e589ee467c5c7d07411099b409cf06 100755 (executable)
@@ -330,7 +330,7 @@ namespace MusicPlayer.Views
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 56.SpToPx(),
                 PixelSize = 32.SpToPx(),
                 FontFamily = "BreezeSans",
                 FontStyle = UIFontStyles.AllNormal,
@@ -348,7 +348,7 @@ namespace MusicPlayer.Views
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 56.SpToPx(),
                 PixelSize = 32.SpToPx(),
                 FontFamily = "BreezeSans",
                 FontStyle = UIFontStyles.NormalLight,
@@ -479,7 +479,7 @@ namespace MusicPlayer.Views
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = ModifySize(48).SpToPx(),
+                HeightSpecification = ModifySize(64).SpToPx(),
                 PixelSize = ModifySize(36).SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Center,
@@ -497,7 +497,7 @@ namespace MusicPlayer.Views
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = ModifySize(36).SpToPx(),
+                HeightSpecification = ModifySize(46).SpToPx(),
                 PixelSize = ModifySize(24).SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Center,
@@ -928,7 +928,7 @@ namespace MusicPlayer.Views
             {
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
-                Size2D = new Size2D(ModifySize(400), ModifySize(32)).SpToPx(),
+                Size2D = new Size2D(ModifySize(400), ModifySize(46)).SpToPx(),
                 PixelSize = ModifySize(24).SpToPx(),
                 FontFamily = "BreezeSans",
                 Text = "00::00:00",
@@ -946,7 +946,7 @@ namespace MusicPlayer.Views
             {
                 StyleName = "LabelText",
                 ThemeChangeSensitive = true,
-                Size2D = new Size2D(ModifySize(400), ModifySize(32)).SpToPx(),
+                Size2D = new Size2D(ModifySize(400), ModifySize(46)).SpToPx(),
                 PixelSize = ModifySize(24).SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.End,
index 6a1e0abe471de9e4562dd48aa0eacc6219ea0176..a3c6e2c45c9da9644d265deacb853b90f2d5391c 100755 (executable)
@@ -171,7 +171,7 @@ namespace MusicPlayer.Views
                 FontStyle = UIFontStyles.NormalLight,
                 TranslatableText = "IDS_ADD_PLAYLIST_NAME",
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 56.SpToPx(),
                 HorizontalAlignment = HorizontalAlignment.Center,
             };
             return contentLabel;
index c623017fe2fcf3543bce2b53530bfc96ddf8d502..8b309a0c4e8aa633e49fc397154d7ca21766077d 100755 (executable)
@@ -104,7 +104,7 @@ namespace MusicPlayer.Views
             {
                 StyleName = "PageLabel",
                 ThemeChangeSensitive = true,
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 62.SpToPx(),
                 TranslatableText = "IDS_SEARCH",
                 PixelSize = 36.SpToPx(),
                 FontFamily = "BreezeSans",
@@ -326,7 +326,7 @@ namespace MusicPlayer.Views
                     {
                         StyleName = "TitleText",
                         WidthSpecification = LayoutParamPolicies.MatchParent,
-                        HeightSpecification = 36.SpToPx(),
+                        HeightSpecification = 56.SpToPx(),
                         TranslatableText = "IDS_NO_RESULT_FOUND",
                         PixelSize = 24.SpToPx(),
                         FontFamily = "BreezeSans",
index 5a97e10f6c96833bcf61fb1006359d52677e9cf5..fd43bec0f02bcd5d39e56bfeda92e6ceac485a5f 100755 (executable)
@@ -55,7 +55,7 @@ namespace MusicPlayer.Views
             textView = new View()
             {
                 BackgroundColor = Color.Transparent,
-                HeightSpecification = 84.SpToPx(),
+                HeightSpecification = 108.SpToPx(),
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
@@ -75,7 +75,7 @@ namespace MusicPlayer.Views
             {
                 StyleName = "ItemLabel",
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 62.SpToPx(),
                 PixelSize = 32.SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Begin,
@@ -88,7 +88,7 @@ namespace MusicPlayer.Views
             subtitleView = new View()
             {
                 BackgroundColor = Color.Transparent,
-                HeightSpecification = 36.SpToPx(),
+                HeightSpecification = 46.SpToPx(),
                 WidthSpecification = LayoutParamPolicies.MatchParent,
                 Layout = new LinearLayout()
                 {
@@ -130,7 +130,7 @@ namespace MusicPlayer.Views
         {
             TextLabel Label = new TextLabel()
             {
-                HeightSpecification = 36.SpToPx(),
+                HeightSpecification = LayoutParamPolicies.MatchParent,
                 PixelSize = 24.SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Begin,
index 8b0e09aa638698addb728c70e514f9d09ea1359a..5a883d8b1c0b098b69b4b482bc818733ca15b42e 100755 (executable)
@@ -100,7 +100,7 @@ namespace MusicPlayer.Views
             selectedCountLabel = new TextLabel()
             {
                 StyleName = "TitleText",
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 56.SpToPx(),
                 PixelSize = 32.SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Begin,
@@ -115,7 +115,7 @@ namespace MusicPlayer.Views
             selectedCountLabel2 = new TextLabel()
             {
                 StyleName = "TitleText",
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 56.SpToPx(),
                 PixelSize = 32.SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Begin,
@@ -256,7 +256,7 @@ namespace MusicPlayer.Views
             {
                 StyleName ="LabelText",
                 TranslatableText = "IDS_SELECT_ALL",
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 56.SpToPx(),
                 PixelSize = 32.SpToPx(),
                 FontFamily = "BreezeSans",
                 HorizontalAlignment = HorizontalAlignment.Begin,
index e89bce700e992fe13b49290b4fb5d5dbd8ade101..4f8b9202fb79633018e12dc85b786be424c6b607 100755 (executable)
@@ -187,7 +187,7 @@ namespace MusicPlayer.Views
             View textArea = new View()
             {
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 84.SpToPx(),
+                HeightSpecification = 100.SpToPx(),
                 Layout = new LinearLayout()
                 {
                     LinearOrientation = LinearLayout.Orientation.Vertical,
@@ -203,7 +203,7 @@ namespace MusicPlayer.Views
             {
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 48.SpToPx(),
+                HeightSpecification = 56.SpToPx(),
                 PixelSize = 32.SpToPx(),
                 StyleName = "DetailTitle",
                 FontStyle = UIFontStyles.NormalLight,
@@ -217,7 +217,7 @@ namespace MusicPlayer.Views
             {
                 ThemeChangeSensitive = true,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
-                HeightSpecification = 36.SpToPx(),
+                HeightSpecification = 44.SpToPx(),
                 StyleName = "DetailSubTitle",
                 FontStyle = UIFontStyles.AllNormal,
                 HorizontalAlignment = HorizontalAlignment.Begin,