release new version
This commit is contained in:
@ -14,7 +14,6 @@ namespace Billing
|
|||||||
public class App : Application
|
public class App : Application
|
||||||
{
|
{
|
||||||
internal const string NewBillAction = "/newbill";
|
internal const string NewBillAction = "/newbill";
|
||||||
private const string SaveLocationKey = nameof(SaveLocationKey);
|
|
||||||
|
|
||||||
public static AppTheme CurrentTheme { get; private set; }
|
public static AppTheme CurrentTheme { get; private set; }
|
||||||
public static PlatformCulture CurrentCulture { get; private set; }
|
public static PlatformCulture CurrentCulture { get; private set; }
|
||||||
@ -36,7 +35,9 @@ namespace Billing
|
|||||||
{
|
{
|
||||||
if (url == NewBillAction)
|
if (url == NewBillAction)
|
||||||
{
|
{
|
||||||
|
#if __ANDROID__
|
||||||
mainRoute = "//Bills/Details";
|
mainRoute = "//Bills/Details";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -44,6 +45,7 @@ namespace Billing
|
|||||||
initialUrl = url;
|
initialUrl = url;
|
||||||
}
|
}
|
||||||
CurrentCulture = new PlatformCulture();
|
CurrentCulture = new PlatformCulture();
|
||||||
|
saveLocation = Preferences.Get(Definition.SaveLocationKey, false);
|
||||||
InitResources();
|
InitResources();
|
||||||
|
|
||||||
MainPage = new MainShell();
|
MainPage = new MainShell();
|
||||||
@ -101,7 +103,6 @@ namespace Billing
|
|||||||
public static void SetSaveLocation(bool flag)
|
public static void SetSaveLocation(bool flag)
|
||||||
{
|
{
|
||||||
saveLocation = flag;
|
saveLocation = flag;
|
||||||
Preferences.Set(SaveLocationKey, flag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task InitializeData()
|
public static async Task InitializeData()
|
||||||
@ -113,7 +114,11 @@ namespace Billing
|
|||||||
Task.Run(async () => bills = await instance.GetListAsync<Bill>()));
|
Task.Run(async () => bills = await instance.GetListAsync<Bill>()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __ANDROID
|
||||||
public static async Task<bool> OpenUrl(string url)
|
public static async Task<bool> OpenUrl(string url)
|
||||||
|
#elif __IOS__
|
||||||
|
public static bool OpenUrl(string url)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(url))
|
if (string.IsNullOrEmpty(url))
|
||||||
{
|
{
|
||||||
@ -121,11 +126,13 @@ namespace Billing
|
|||||||
}
|
}
|
||||||
if (File.Exists(url))
|
if (File.Exists(url))
|
||||||
{
|
{
|
||||||
|
#if __ANDROID__
|
||||||
var status = await Helper.CheckAndRequestPermissionAsync<Permissions.StorageRead>();
|
var status = await Helper.CheckAndRequestPermissionAsync<Permissions.StorageRead>();
|
||||||
if (status != PermissionStatus.Granted)
|
if (status != PermissionStatus.Granted)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
_ = Task.Run(async () =>
|
_ = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var result = await StoreHelper.ReloadDatabase(url);
|
var result = await StoreHelper.ReloadDatabase(url);
|
||||||
|
@ -11,10 +11,13 @@ namespace Billing
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override async void OnLoaded()
|
protected override async void OnLoaded()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(App.MainRoute))
|
||||||
{
|
{
|
||||||
await App.InitializeData();
|
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 static partial class Definition
|
||||||
{
|
{
|
||||||
|
public const string SaveLocationKey = "SaveLocationKey";
|
||||||
public const string PrimaryColorKey = "PrimaryColor";
|
public const string PrimaryColorKey = "PrimaryColor";
|
||||||
public const string DefaultIcon = "ic_default";
|
public const string DefaultIcon = "ic_default";
|
||||||
public const long TransparentColor = 0x00ffffffL;
|
public const long TransparentColor = 0x00ffffffL;
|
||||||
|
@ -61,6 +61,7 @@ namespace Billing.Views
|
|||||||
base.OnDisappearing();
|
base.OnDisappearing();
|
||||||
|
|
||||||
App.SetSaveLocation(SaveLocation);
|
App.SetSaveLocation(SaveLocation);
|
||||||
|
Preferences.Set(Definition.SaveLocationKey, SaveLocation);
|
||||||
Preferences.Set(Definition.PrimaryColorKey, PrimaryColor);
|
Preferences.Set(Definition.PrimaryColorKey, PrimaryColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.2.317" package="org.tsanie.billing" android:installLocation="auto" android:versionCode="16">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.2.317" package="org.tsanie.billing" android:installLocation="auto" android:versionCode="17">
|
||||||
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="30" />
|
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="30" />
|
||||||
<application android:label="@string/applabel" android:theme="@style/MainTheme" android:requestLegacyExternalStorage="true"></application>
|
<application android:label="@string/applabel" android:theme="@style/MainTheme" android:requestLegacyExternalStorage="true"></application>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using Foundation;
|
using Foundation;
|
||||||
using ObjCRuntime;
|
|
||||||
using UIKit;
|
using UIKit;
|
||||||
|
|
||||||
namespace Billing.iOS
|
namespace Billing.iOS
|
||||||
@ -38,18 +37,36 @@ namespace Billing.iOS
|
|||||||
{
|
{
|
||||||
if (url?.IsFileUrl == true)
|
if (url?.IsFileUrl == true)
|
||||||
{
|
{
|
||||||
return App.OpenUrl(url.Path).Result;
|
return App.OpenUrl(url.Path);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PerformActionForShortcutItem(UIApplication application, UIApplicationShortcutItem shortcutItem, UIOperationHandler completionHandler)
|
public override async void PerformActionForShortcutItem(UIApplication application, UIApplicationShortcutItem shortcutItem, UIOperationHandler completionHandler)
|
||||||
{
|
{
|
||||||
if (shortcutItem == null || string.IsNullOrEmpty(shortcutItem.Type))
|
if (shortcutItem == null || string.IsNullOrEmpty(shortcutItem.Type))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Xamarin.Essentials.MainThread.BeginInvokeOnMainThread(async () => await Xamarin.Forms.Shell.Current.GoToAsync("//Bills/Details"));
|
if (App.Accounts.Count == 0)
|
||||||
|
{
|
||||||
|
await App.InitializeData();
|
||||||
|
}
|
||||||
|
Xamarin.Essentials.MainThread.BeginInvokeOnMainThread(async () =>
|
||||||
|
{
|
||||||
|
var state = Xamarin.Forms.Shell.Current.CurrentState.Location;
|
||||||
|
var route = state.OriginalString;
|
||||||
|
var current = Xamarin.Forms.Shell.Current;
|
||||||
|
if (!route.StartsWith("//Bills"))
|
||||||
|
{
|
||||||
|
await current.GoToAsync("//Bills");
|
||||||
|
}
|
||||||
|
else if (route.EndsWith("/Details") || route.StartsWith("//Bills/D_FAULT_AddBillPage"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await current.GoToAsync("Details");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -80,7 +80,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>16</string>
|
<string>17</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.2.317</string>
|
<string>1.2.317</string>
|
||||||
<key>LSApplicationQueriesSchemes</key>
|
<key>LSApplicationQueriesSchemes</key>
|
||||||
|
Reference in New Issue
Block a user