feature: shortcut
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Billing
|
||||
{
|
||||
public class App : Application
|
||||
{
|
||||
internal const string NewBillAction = "/newbill";
|
||||
private const string SaveLocationKey = nameof(SaveLocationKey);
|
||||
|
||||
public static AppTheme CurrentTheme { get; private set; }
|
||||
@@ -21,17 +22,27 @@ namespace Billing
|
||||
public static List<Account> Accounts => accounts ??= new List<Account>();
|
||||
public static List<Category> Categories => categories ??= new List<Category>();
|
||||
public static bool SaveLocation => saveLocation;
|
||||
public static string MainRoute => mainRoute;
|
||||
|
||||
private static List<Bill> bills;
|
||||
private static List<Account> accounts;
|
||||
private static List<Category> categories;
|
||||
private static bool saveLocation;
|
||||
private static string mainRoute;
|
||||
|
||||
private string initialUrl;
|
||||
|
||||
public App(string url = null)
|
||||
{
|
||||
initialUrl = url;
|
||||
if (url == NewBillAction)
|
||||
{
|
||||
mainRoute = "//Bills/Details";
|
||||
}
|
||||
else
|
||||
{
|
||||
mainRoute = "//Bills";
|
||||
initialUrl = url;
|
||||
}
|
||||
CurrentCulture = new PlatformCulture();
|
||||
InitResources();
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
using Billing.Views;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Billing
|
||||
@@ -6,6 +7,8 @@ namespace Billing
|
||||
{
|
||||
public MainShell()
|
||||
{
|
||||
Routing.RegisterRoute("Bills/Details", typeof(AddBillPage));
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ namespace Billing
|
||||
{
|
||||
await App.InitializeData();
|
||||
|
||||
await Shell.Current.GoToAsync("//Bills");
|
||||
await Shell.Current.GoToAsync(App.MainRoute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@ namespace Billing.Store
|
||||
catch (Exception ex)
|
||||
{
|
||||
Helper.Error("database.close", ex);
|
||||
return false;
|
||||
}
|
||||
try
|
||||
{
|
||||
@@ -54,12 +55,13 @@ namespace Billing.Store
|
||||
SQLiteOpenFlags.ReadWrite |
|
||||
SQLiteOpenFlags.Create |
|
||||
SQLiteOpenFlags.SharedCache);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Helper.Error("database.connect", ex);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static readonly AsyncLazy<StoreHelper> Instance = new(async () =>
|
||||
|
@@ -70,6 +70,7 @@ namespace Billing.Views
|
||||
private CancellationTokenSource tokenSource;
|
||||
private Location location;
|
||||
|
||||
public AddBillPage() : this(DateTime.Today) { }
|
||||
public AddBillPage(DateTime date)
|
||||
{
|
||||
createDate = date;
|
||||
|
@@ -13,25 +13,24 @@
|
||||
Shell.TabBarIsVisible="True">
|
||||
|
||||
<Shell.TitleView>
|
||||
<StackLayout Orientation="Horizontal" Spacing="10">
|
||||
<Grid ColumnSpacing="10" ColumnDefinitions="30, *, 30">
|
||||
<ui:TintImageButton Source="left.png" WidthRequest="20" HeightRequest="20"
|
||||
VerticalOptions="Center" HorizontalOptions="Start"
|
||||
VerticalOptions="Center" HorizontalOptions="Center"
|
||||
Command="{Binding LeftCommand}"/>
|
||||
<Label Text="{Binding Title}"
|
||||
<Label Grid.Column="1" Text="{Binding Title}"
|
||||
TextColor="{DynamicResource PrimaryColor}"
|
||||
FontSize="{OnPlatform Android=20, iOS=18}"
|
||||
FontFamily="{x:Static ui:Definition.SemiBoldFontFamily}"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
HorizontalTextAlignment="Center">
|
||||
HorizontalOptions="Center">
|
||||
<Label.GestureRecognizers>
|
||||
<TapGestureRecognizer Command="{Binding FilterCommand}"/>
|
||||
</Label.GestureRecognizers>
|
||||
</Label>
|
||||
<ui:TintImageButton Source="right.png" WidthRequest="20" HeightRequest="20"
|
||||
VerticalOptions="Center" HorizontalOptions="End"
|
||||
<ui:TintImageButton Grid.Column="2" Source="right.png" WidthRequest="20" HeightRequest="20"
|
||||
VerticalOptions="Center" HorizontalOptions="Center"
|
||||
Command="{Binding RightCommand}"/>
|
||||
</StackLayout>
|
||||
</Grid>
|
||||
</Shell.TitleView>
|
||||
|
||||
<!--<ContentPage.ToolbarItems>
|
||||
|
Reference in New Issue
Block a user