release new version

This commit is contained in:
2022-03-17 21:34:26 +08:00
parent ef5e91aad1
commit 5cbcfbcd56
7 changed files with 41 additions and 12 deletions

View File

@@ -14,7 +14,6 @@ namespace Billing
public class App : Application
{
internal const string NewBillAction = "/newbill";
private const string SaveLocationKey = nameof(SaveLocationKey);
public static AppTheme CurrentTheme { get; private set; }
public static PlatformCulture CurrentCulture { get; private set; }
@@ -35,8 +34,10 @@ namespace Billing
public App(string url = null)
{
if (url == NewBillAction)
{
mainRoute = "//Bills/Details";
{
#if __ANDROID__
mainRoute = "//Bills/Details";
#endif
}
else
{
@@ -44,6 +45,7 @@ namespace Billing
initialUrl = url;
}
CurrentCulture = new PlatformCulture();
saveLocation = Preferences.Get(Definition.SaveLocationKey, false);
InitResources();
MainPage = new MainShell();
@@ -101,7 +103,6 @@ namespace Billing
public static void SetSaveLocation(bool flag)
{
saveLocation = flag;
Preferences.Set(SaveLocationKey, flag);
}
public static async Task InitializeData()
@@ -113,7 +114,11 @@ namespace Billing
Task.Run(async () => bills = await instance.GetListAsync<Bill>()));
}
#if __ANDROID
public static async Task<bool> OpenUrl(string url)
#elif __IOS__
public static bool OpenUrl(string url)
#endif
{
if (string.IsNullOrEmpty(url))
{
@@ -121,11 +126,13 @@ namespace Billing
}
if (File.Exists(url))
{
#if __ANDROID__
var status = await Helper.CheckAndRequestPermissionAsync<Permissions.StorageRead>();
if (status != PermissionStatus.Granted)
{
return false;
}
#endif
_ = Task.Run(async () =>
{
var result = await StoreHelper.ReloadDatabase(url);