optimized and add diagnostic feature

This commit is contained in:
2022-03-15 15:17:02 +08:00
parent 77b4e54734
commit 5b209cc19c
45 changed files with 380 additions and 122 deletions

View File

@ -1,7 +1,6 @@
using Billing.Languages;
using Billing.Models;
using Billing.Store;
using Billing.Themes;
using Billing.UI;
using System.Collections;
using System.Collections.Generic;
@ -68,9 +67,7 @@ namespace Billing.Views
Icon = category.Icon,
Name = category.Name,
IsTopCategory = IsTopCategory,
TintColor = category.TintColor.IsTransparent() ?
BaseTheme.CurrentPrimaryColor :
category.TintColor.ToColor()
TintColor = category.TintColor
};
}
@ -180,9 +177,7 @@ namespace Billing.Views
{
c.Name = c.Category.Name;
c.Icon = c.Category.Icon;
c.TintColor = c.Category.TintColor.IsTransparent() ?
BaseTheme.CurrentPrimaryColor :
c.Category.TintColor.ToColor();
c.TintColor = c.Category.TintColor;
}
}
@ -191,7 +186,7 @@ namespace Billing.Views
public static readonly BindableProperty IsCheckedProperty = Helper.Create<bool, UICategory>(nameof(IsChecked));
public static readonly BindableProperty IconProperty = Helper.Create<string, UICategory>(nameof(Icon));
public static readonly BindableProperty NameProperty = Helper.Create<string, UICategory>(nameof(Name));
public static readonly BindableProperty TintColorProperty = Helper.Create<Color, UICategory>(nameof(TintColor));
public static readonly BindableProperty TintColorProperty = Helper.Create<long, UICategory>(nameof(TintColor));
public static readonly BindableProperty IsTopCategoryProperty = Helper.Create<bool, UICategory>(nameof(IsTopCategory));
public bool IsChecked
@ -209,9 +204,9 @@ namespace Billing.Views
get => (string)GetValue(NameProperty);
set => SetValue(NameProperty, value);
}
public Color TintColor
public long TintColor
{
get => (Color)GetValue(TintColorProperty);
get => (long)GetValue(TintColorProperty);
set => SetValue(TintColorProperty, value);
}
public bool IsTopCategory
@ -232,6 +227,10 @@ namespace Billing.Views
{
public string Key { get; }
public CategoryGrouping(string key) : base()
{
Key = key;
}
public CategoryGrouping(string key, IEnumerable<UICategory> categories) : base(categories)
{
Key = key;