Change background color when list item is clicked.
authorPiotr Czaja <p.czaja@samsung.com>
Wed, 25 Oct 2023 13:44:53 +0000 (15:44 +0200)
committerPiotr Czaja/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics <p.czaja@samsung.com>
Tue, 31 Oct 2023 15:30:05 +0000 (16:30 +0100)
Change-Id: I3613db81b92ad789c76a10cd1db6dfcb6fcfdc22

SettingCore/Views/TextWithIconListItem.cs
SettingMainGadget/SettingMainGadget/Storage/AppsStorageGadget.cs

index 2e7e0de4330d16b3094808fff289f29fc05579c5..5e4671cf8e2c3257a42623b58df7613008a28152 100644 (file)
@@ -49,6 +49,38 @@ namespace SettingCore.Views
             AddText(primaryText, subText, secondaryText, secondarySubText);
         }
 
+        public override void OnChangeSelected(bool selected)
+        {
+            if (selected)
+            {
+                base.BackgroundColor = BackgroundColors.Selected;
+
+                primary.TextColor = TextColors.Selected;
+                if (secondary != null)
+                {
+                    secondary.TextColor = TextColors.Selected;
+                }
+                if(primarySubText != null)
+                {
+                    primarySubText.TextColor = TextColors.Selected;
+                }
+            }
+            else
+            {
+                base.BackgroundColor = BackgroundColors.Normal;
+
+                primary.TextColor = TextColors.Normal;
+                if (secondary != null)
+                {
+                    secondary.TextColor = TextColors.Normal;
+                }
+                if (primarySubText != null)
+                {
+                    primarySubText.TextColor = TextColors.Normal;
+                }
+            }
+        }
+
         private void AddIcon(Color color, string iconPath)
         {
             var iconBackground = new View
index 7a7d13437cb839f06e32c812674c73ad425b56ce..89455fb73aa4738115d5a7590fd1ba375bba8cda 100644 (file)
@@ -106,10 +106,8 @@ namespace Setting.Menu.Storage
                 }
 
                 var appItem = new TextWithIconListItem(appInfo.Name, Color.Transparent, iconPath: appInfo.IconPath, subText: NUIGadgetResourceManager.GetString(nameof(Resources.IDS_SM_SBODY_CALCULATING_ING)));
-                appItem.Clicked += (s, e) =>
-                {
-                    // TODO : goto app info by AppId
-                };
+                // TODO : goto app info by AppId
+                //appItem.Clicked += (s, e) => {};
 
                 content.Add(appItem);
                 listItems.Add(appInfo.AppId, appItem);