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

@ -1,11 +1,11 @@
using Billing.Languages;
using Billing.Models;
using Billing.Store;
using Billing.Themes;
using Billing.UI;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Billing.Views
@ -68,9 +68,9 @@ namespace Billing.Views
Icon = category.Icon,
Name = category.Name,
IsTopCategory = IsTopCategory,
TintColor = category.TintColor == Color.Transparent || category.TintColor == default ?
TintColor = category.TintColor.IsTransparent() ?
BaseTheme.CurrentPrimaryColor :
category.TintColor
category.TintColor.ToColor()
};
}
@ -112,7 +112,7 @@ namespace Billing.Views
Categories.Remove(c);
groupLayout.Refresh(Categories);
App.Categories.Remove(c.Category);
_ = Task.Run(App.WriteCategories);
await StoreHelper.DeleteCategoryItemAsync(c.Category);
}
}
}
@ -144,7 +144,7 @@ namespace Billing.Views
}
}
private void OnCategoryChecked(object sender, Category category)
private async void OnCategoryChecked(object sender, Category category)
{
if (category.Id < 0)
{
@ -183,16 +183,16 @@ namespace Billing.Views
}
groupLayout.Refresh(Categories);
Task.Run(App.WriteCategories);
await StoreHelper.SaveCategoryItemAsync(category);
}
private void UpdateCategory(UICategory c)
{
c.Name = c.Category.Name;
c.Icon = c.Category.Icon;
c.TintColor = c.Category.TintColor == Color.Transparent || c.Category.TintColor == default ?
c.TintColor = c.Category.TintColor.IsTransparent() ?
BaseTheme.CurrentPrimaryColor :
c.Category.TintColor;
c.Category.TintColor.ToColor();
}
}