release new version
This commit is contained in:
@@ -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);
|
||||
|
@@ -12,9 +12,12 @@ namespace Billing
|
||||
|
||||
protected override async void OnLoaded()
|
||||
{
|
||||
await App.InitializeData();
|
||||
if (!string.IsNullOrEmpty(App.MainRoute))
|
||||
{
|
||||
await App.InitializeData();
|
||||
|
||||
await Shell.Current.GoToAsync(App.MainRoute);
|
||||
await Shell.Current.GoToAsync(App.MainRoute);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -7,6 +7,7 @@ namespace Billing.UI
|
||||
{
|
||||
public static partial class Definition
|
||||
{
|
||||
public const string SaveLocationKey = "SaveLocationKey";
|
||||
public const string PrimaryColorKey = "PrimaryColor";
|
||||
public const string DefaultIcon = "ic_default";
|
||||
public const long TransparentColor = 0x00ffffffL;
|
||||
|
@@ -61,6 +61,7 @@ namespace Billing.Views
|
||||
base.OnDisappearing();
|
||||
|
||||
App.SetSaveLocation(SaveLocation);
|
||||
Preferences.Set(Definition.SaveLocationKey, SaveLocation);
|
||||
Preferences.Set(Definition.PrimaryColorKey, PrimaryColor);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user