From: Piotr Czaja
Date: Wed, 25 Oct 2023 13:44:53 +0000 (+0200)
Subject: Change background color when list item is clicked.
X-Git-Tag: accepted/tizen/unified/20231120.023124~12
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c207875b4ffacbe51b0fa3933010e327b2d06701;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsettings.git
Change background color when list item is clicked.
Change-Id: I3613db81b92ad789c76a10cd1db6dfcb6fcfdc22
---
diff --git a/SettingCore/Views/TextWithIconListItem.cs b/SettingCore/Views/TextWithIconListItem.cs
index 2e7e0de..5e4671c 100644
--- a/SettingCore/Views/TextWithIconListItem.cs
+++ b/SettingCore/Views/TextWithIconListItem.cs
@@ -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
diff --git a/SettingMainGadget/SettingMainGadget/Storage/AppsStorageGadget.cs b/SettingMainGadget/SettingMainGadget/Storage/AppsStorageGadget.cs
index 7a7d134..89455fb 100644
--- a/SettingMainGadget/SettingMainGadget/Storage/AppsStorageGadget.cs
+++ b/SettingMainGadget/SettingMainGadget/Storage/AppsStorageGadget.cs
@@ -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);