switch to sqlite

This commit is contained in:
2022-03-11 16:10:11 +08:00
parent f5f16d43f4
commit 5ec4119025
25 changed files with 286 additions and 435 deletions

View File

@ -56,14 +56,13 @@ namespace Billing.Views
{
CategoryName = category.Name;
CategoryIcon = category.Icon;
if (category.TintColor == Color.Transparent ||
category.TintColor == default)
if (category.TintColor.IsTransparent())
{
TintColor = BaseTheme.CurrentPrimaryColor;
}
else
{
TintColor = category.TintColor;
TintColor = category.TintColor.ToColor();
}
}
else
@ -103,6 +102,7 @@ namespace Billing.Views
{
var currentColor = BaseTheme.CurrentPrimaryColor;
var tintColor = TintColor;
var color = (tintColor == currentColor ? Color.Transparent : tintColor).ToLong();
var category = App.Categories.FirstOrDefault(c => c.Id == categoryId);
if (category == null)
{
@ -111,7 +111,7 @@ namespace Billing.Views
Id = -1,
Name = CategoryName,
Icon = CategoryIcon,
TintColor = tintColor == currentColor ? Color.Transparent : tintColor,
TintColor = color,
ParentId = parent?.Id,
Type = parent?.Type ?? CategoryType.Spending
});
@ -120,7 +120,7 @@ namespace Billing.Views
{
category.Name = CategoryName;
category.Icon = CategoryIcon;
category.TintColor = tintColor == currentColor ? Color.Transparent : tintColor;
category.TintColor = color;
CategoryChecked?.Invoke(this, category);
}
await Navigation.PopAsync();