From: Yurii Zinchuk/Tizen Services & IoT (PLT) /SRPOL/Engineer/Samsung Electronics Date: Thu, 13 Apr 2023 15:14:39 +0000 (+0200) Subject: add disabled colors for rb list item X-Git-Tag: accepted/tizen/unified/20230426.062800~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=082cb8d58cac582154758d26656c5df83fd91e09;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsettings.git add disabled colors for rb list item --- diff --git a/SettingCore/Views/RadioButtonListItem.cs b/SettingCore/Views/RadioButtonListItem.cs index d26780d..1e2ab62 100644 --- a/SettingCore/Views/RadioButtonListItem.cs +++ b/SettingCore/Views/RadioButtonListItem.cs @@ -1,4 +1,4 @@ -using System.Text; +using System; using Tizen.NUI; using Tizen.NUI.BaseComponents; using Tizen.NUI.Components; @@ -8,7 +8,7 @@ namespace SettingCore.Views public class RadioButtonListItem : BaseComponent { private readonly ThemeColor BackgroundColors = new ThemeColor(Color.Transparent, Color.Transparent, new Color("#FF6400").WithAlpha(0.16f), new Color("#FFFFFF").WithAlpha(0.16f)); - private readonly ThemeColor TextColors = new ThemeColor(new Color("#090E21"), new Color("#FDFDFD"), new Color("#FF6200"), new Color("#FF8A00")); + private readonly ThemeColor TextColors = new ThemeColor(new Color("#090E21"), new Color("#FDFDFD"), new Color("#FF6200"), new Color("#FF8A00"), new Color("#CACACA"), new Color("#666666")); public RadioButton RadioButton { get; private set; } @@ -73,6 +73,15 @@ namespace SettingCore.Views RadioButton.ApplyStyle(isLightTheme ? style_light : style_dark); OnChangeSelected(false); }; + + Relayout += RadioButtonListItem_Relayout; + } + + private void RadioButtonListItem_Relayout(object sender, EventArgs e) + { + if (!IsEnabled) OnDisabledStateChanged(false); + + Relayout -= RadioButtonListItem_Relayout; } public override void OnChangeSelected(bool selected) @@ -91,6 +100,20 @@ namespace SettingCore.Views } } + public override void OnDisabledStateChanged(bool isEnabled) + { + RadioButton.IsEnabled = isEnabled; + + if (isEnabled) + { + RadioButton.TextColor = TextColors.Normal; + } + else + { + RadioButton.TextColor = TextColors.Disabled; + } + } + private string GetIconPath(string name) { return System.IO.Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, $"radiobutton/{name}");