protected void NavigateBack() => GadgetNavigation.NavigateBack();
protected void NavigateTo(string menuPath) => GadgetNavigation.NavigateTo(menuPath);
+ protected bool IsLightTheme => ThemeManager.PlatformThemeId == "org.tizen.default-light-theme";
+
protected string GetResourcePath(string relativeFilePath)
{
string callingAssemblyName = System.Reflection.Assembly.GetCallingAssembly().GetName().Name;
public class MainMenuItem : BaseComponent
{
private readonly ThemeColor BackgroundColors = new ThemeColor(Color.Transparent, Color.Transparent, new Color("#FF6400").WithAlpha(0.16f), Color.White.WithAlpha(0.16f));
- private readonly ThemeColor TextColors = new ThemeColor(new Color("#090E21"), new Color("#CACACA"), new Color("#FF6200"), new Color("#FF8A00"));
+ private readonly ThemeColor TextColors = new ThemeColor(new Color("#090E21"), new Color("#FDFDFD"), new Color("#FF6200"), new Color("#FF8A00"));
private readonly ThemeColor IconColors = new ThemeColor(Color.White, Color.Black, Color.White, Color.Black);
private readonly ThemeColor IconBackgroundColors;
Text = title,
PixelSize = 24.SpToPx(),
TextColor = TextColors.Normal,
+ Margin = new Extents(16, 16, 16, 16).SpToPx(),
};
FlexLayout.SetFlexGrow(titleTextLabel, 1);
private string deviceName;
private bool isLightTheme => ThemeManager.PlatformThemeId == "org.tizen.default-light-theme";
- public override Color ProvideIconColor() => new Color("#301A4B");
+ public override Color ProvideIconColor() => new Color(IsLightTheme ? "#301A4B" : "#CAB4E5");
public override string ProvideIconPath() => GetResourcePath("about.svg");
{
public class DateTimeGadget : SettingCore.MainMenuGadget
{
- public override Color ProvideIconColor() => new Color("#205493");
+ public override Color ProvideIconColor() => new Color(IsLightTheme ? "#205493" : "#2560A8");
public override string ProvideIconPath() => GetResourcePath("datetime.svg");
{
public class DisplayGadget : SettingCore.MainMenuGadget
{
- public override Color ProvideIconColor() => new Color("#0075FF");
+ public override Color ProvideIconColor() => new Color(IsLightTheme ? "#0075FF" : "#1A85FF");
public override string ProvideIconPath() => GetResourcePath("display.svg");
{
public class LanguageInputGadget : SettingCore.MainMenuGadget
{
- public override Color ProvideIconColor() => new Color("#205493");
+ public override Color ProvideIconColor() => new Color(IsLightTheme ? "#205493" : "#2560A8");
public override string ProvideIconPath() => GetResourcePath("language_input.svg");
private TextListItem soundMode;
private TextListItem notificationSound;
- public override Color ProvideIconColor() => new Color("#DB3069");
+ public override Color ProvideIconColor() => new Color(IsLightTheme ? "#DB3069" : "#DF4679");
public override string ProvideIconPath() => GetResourcePath("sound.svg");
GetDefaultWindow().GetDefaultNavigator().Push(mMainPage);
Tizen.System.SystemSettings.LocaleLanguageChanged += SystemSettings_LocaleLanguageChanged;
+ ThemeManager.ThemeChanged += ThemeManager_ThemeChanged;
GadgetManager.Instance.CustomizationChanged += CustomizationChanged;
LogScalableInfo();
}
}
+ private void ThemeManager_ThemeChanged(object sender, ThemeChangedEventArgs e)
+ {
+ if (mMainPage != null)
+ {
+ // recreate main page content just to apply new colors from gadgets
+ mMainPage.Content = CreateContent();
+ }
+ }
+
private static AppBar CreateAppBar()
{
// TODO: remove style customization with scalable unit, when merged to TizenFX