60 lines
2.8 KiB
C#
60 lines
2.8 KiB
C#
using Gallery.Resources.UI;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Gallery.Resources.Theme
|
|
{
|
|
public abstract class Theme : ResourceDictionary
|
|
{
|
|
public const string StatusBarStyle = nameof(StatusBarStyle);
|
|
public const string WindowColor = nameof(WindowColor);
|
|
public const string TintColor = nameof(TintColor);
|
|
public const string TextColor = nameof(TextColor);
|
|
public const string SubTextColor = nameof(SubTextColor);
|
|
public const string CardBackgroundColor = nameof(CardBackgroundColor);
|
|
public const string MaskColor = nameof(MaskColor);
|
|
public const string NavigationColor = nameof(NavigationColor);
|
|
public const string NavigationSelectedColor = nameof(NavigationSelectedColor);
|
|
public const string OptionBackColor = nameof(OptionBackColor);
|
|
public const string OptionTintColor = nameof(OptionTintColor);
|
|
|
|
public const string IconLightFamily = nameof(IconLightFamily);
|
|
public const string IconRegularFamily = nameof(IconRegularFamily);
|
|
public const string IconSolidFamily = nameof(IconSolidFamily);
|
|
public const string ScreenBottomPadding = nameof(ScreenBottomPadding);
|
|
|
|
public const string IconClose = nameof(IconClose);
|
|
public const string FontIconOption = nameof(FontIconOption);
|
|
public const string FontIconRefresh = nameof(FontIconRefresh);
|
|
public const string FontIconLove = nameof(FontIconLove);
|
|
public const string FontIconNotLove = nameof(FontIconNotLove);
|
|
public const string FontIconShare = nameof(FontIconShare);
|
|
|
|
protected void InitResources()
|
|
{
|
|
Add(IconLightFamily, Definition.IconLightFamily);
|
|
Add(IconRegularFamily, Definition.IconRegularFamily);
|
|
Add(IconSolidFamily, Definition.IconSolidFamily);
|
|
Add(ScreenBottomPadding, Definition.ScreenBottomPadding);
|
|
|
|
Add(FontIconOption, GetFontIcon(Definition.IconOption, Definition.IconSolidFamily));
|
|
Add(FontIconRefresh, GetFontIcon(Definition.IconRefresh, Definition.IconSolidFamily));
|
|
Add(FontIconLove, GetFontIcon(Definition.IconLove, Definition.IconSolidFamily, color: Definition.ColorRedBackground));
|
|
Add(FontIconNotLove, GetFontIcon(Definition.IconLove, Definition.IconRegularFamily, color: Definition.ColorRedBackground));
|
|
Add(FontIconShare, GetFontIcon(Definition.IconShare, Definition.IconSolidFamily));
|
|
|
|
Add(IconClose, Definition.IconClose);
|
|
}
|
|
|
|
private FontImageSource GetFontIcon(string icon, string family, Color color = default)
|
|
{
|
|
return new FontImageSource
|
|
{
|
|
FontFamily = family,
|
|
Glyph = icon,
|
|
Size = Definition.FontSizeTitle,
|
|
Color = color
|
|
};
|
|
}
|
|
}
|
|
}
|