fix issue
This commit is contained in:
@ -43,7 +43,8 @@
|
|||||||
Text="{Binding Liability, Converter={StaticResource moneyConverter}}"/>
|
Text="{Binding Liability, Converter={StaticResource moneyConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ui:GroupStackLayout x:Name="groupLayout" ItemsSource="{Binding Accounts}" Margin="0, 10, 0, 0" GroupHeight="40">
|
<ui:GroupStackLayout x:Name="groupLayout" ItemsSource="{Binding Accounts}" Margin="0, 10, 0, 0"
|
||||||
|
GroupHeight="36" RowHeight="44">
|
||||||
<ui:GroupStackLayout.GroupHeaderTemplate>
|
<ui:GroupStackLayout.GroupHeaderTemplate>
|
||||||
<DataTemplate x:DataType="v:AccountGrouping">
|
<DataTemplate x:DataType="v:AccountGrouping">
|
||||||
<StackLayout Orientation="Horizontal" Padding="10, 0" VerticalOptions="End">
|
<StackLayout Orientation="Horizontal" Padding="10, 0" VerticalOptions="End">
|
||||||
|
@ -46,8 +46,8 @@ namespace Billing.Views
|
|||||||
AddToAccountGroup(account);
|
AddToAccountGroup(account);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
groupLayout.Refresh(accounts);
|
|
||||||
RefreshBalance(true);
|
RefreshBalance(true);
|
||||||
|
groupLayout.Refresh(accounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RefreshBalance(bool calc = false)
|
private void RefreshBalance(bool calc = false)
|
||||||
@ -127,8 +127,8 @@ namespace Billing.Views
|
|||||||
{
|
{
|
||||||
accounts.Remove(group);
|
accounts.Remove(group);
|
||||||
}
|
}
|
||||||
groupLayout.Refresh(accounts);
|
|
||||||
RefreshBalance();
|
RefreshBalance();
|
||||||
|
groupLayout.Refresh(accounts);
|
||||||
|
|
||||||
_ = Task.Run(App.WriteAccounts);
|
_ = Task.Run(App.WriteAccounts);
|
||||||
}
|
}
|
||||||
@ -144,8 +144,8 @@ namespace Billing.Views
|
|||||||
App.Accounts.Add(e.Account);
|
App.Accounts.Add(e.Account);
|
||||||
AddToAccountGroup(e.Account);
|
AddToAccountGroup(e.Account);
|
||||||
}
|
}
|
||||||
groupLayout.Refresh(accounts);
|
|
||||||
RefreshBalance(!add);
|
RefreshBalance(!add);
|
||||||
|
groupLayout.Refresh(accounts);
|
||||||
|
|
||||||
Task.Run(App.WriteAccounts);
|
Task.Run(App.WriteAccounts);
|
||||||
}
|
}
|
||||||
|
@ -23,12 +23,13 @@
|
|||||||
<Shell.TitleView>
|
<Shell.TitleView>
|
||||||
<Grid ColumnSpacing="16" ColumnDefinitions="20, *">
|
<Grid ColumnSpacing="16" ColumnDefinitions="20, *">
|
||||||
<ui:TintImage Source="calendar.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center"/>
|
<ui:TintImage Source="calendar.png" WidthRequest="20" HeightRequest="20" VerticalOptions="Center"/>
|
||||||
<ui:LongPressButton Grid.Column="1" Text="{Binding SelectedDate, Converter={StaticResource titleDateConverter}}"
|
<ui:LongPressGrid Grid.Column="1" HorizontalOptions="{OnPlatform iOS=Center, Android=Start}"
|
||||||
|
VerticalOptions="Center" LongCommand="{Binding TitleLongPressed}">
|
||||||
|
<Label Text="{Binding SelectedDate, Converter={StaticResource titleDateConverter}}"
|
||||||
TextColor="{DynamicResource PrimaryColor}"
|
TextColor="{DynamicResource PrimaryColor}"
|
||||||
HorizontalOptions="{OnPlatform iOS=Center, Android=Start}"
|
|
||||||
FontFamily="{DynamicResource RobotoCondensedFontBold}"
|
FontFamily="{DynamicResource RobotoCondensedFontBold}"
|
||||||
FontAttributes="Bold" FontSize="20" VerticalOptions="Center"
|
FontAttributes="Bold" FontSize="20"/>
|
||||||
LongPressed="OnTitleDateLongPressed"/>
|
</ui:LongPressGrid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Shell.TitleView>
|
</Shell.TitleView>
|
||||||
|
|
||||||
|
@ -33,11 +33,13 @@ namespace Billing.Views
|
|||||||
public decimal Spending => (decimal)GetValue(SpendingProperty);
|
public decimal Spending => (decimal)GetValue(SpendingProperty);
|
||||||
public decimal Balance => (decimal)GetValue(BalanceProperty);
|
public decimal Balance => (decimal)GetValue(BalanceProperty);
|
||||||
|
|
||||||
|
public Command TitleLongPressed { get; }
|
||||||
public Command EditBilling { get; }
|
public Command EditBilling { get; }
|
||||||
public Command DeleteBilling { get; }
|
public Command DeleteBilling { get; }
|
||||||
|
|
||||||
public BillPage()
|
public BillPage()
|
||||||
{
|
{
|
||||||
|
TitleLongPressed = new Command(OnTitleDateLongPressed);
|
||||||
EditBilling = new Command(OnEditBilling);
|
EditBilling = new Command(OnEditBilling);
|
||||||
DeleteBilling = new Command(OnDeleteBilling);
|
DeleteBilling = new Command(OnDeleteBilling);
|
||||||
|
|
||||||
@ -50,12 +52,15 @@ namespace Billing.Views
|
|||||||
{
|
{
|
||||||
SelectedDate = e.Date;
|
SelectedDate = e.Date;
|
||||||
|
|
||||||
|
Task.Run(() =>
|
||||||
|
{
|
||||||
var bills = App.Bills.Where(b =>
|
var bills = App.Bills.Where(b =>
|
||||||
b.CreateTime.Year == e.Date.Year &&
|
b.CreateTime.Year == e.Date.Year &&
|
||||||
b.CreateTime.Month == e.Date.Month &&
|
b.CreateTime.Month == e.Date.Month &&
|
||||||
b.CreateTime.Day == e.Date.Day);
|
b.CreateTime.Day == e.Date.Day);
|
||||||
Bills = new List<UIBill>(bills.Select(b => WrapBill(b)));
|
Bills = new List<UIBill>(bills.Select(b => WrapBill(b)));
|
||||||
RefreshBalance(Bills);
|
RefreshBalance(Bills);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RefreshBalance(List<UIBill> bills)
|
private void RefreshBalance(List<UIBill> bills)
|
||||||
@ -89,7 +94,7 @@ namespace Billing.Views
|
|||||||
bill.Wallet = App.Accounts.FirstOrDefault(a => a.Id == bill.Bill.WalletId)?.Name;
|
bill.Wallet = App.Accounts.FirstOrDefault(a => a.Id == bill.Bill.WalletId)?.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTitleDateLongPressed(object sender, EventArgs e)
|
private void OnTitleDateLongPressed()
|
||||||
{
|
{
|
||||||
billingDate.SetDateTime(DateTime.Now);
|
billingDate.SetDateTime(DateTime.Now);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
Title="{r:Text Settings}"
|
Title="{r:Text Settings}"
|
||||||
BindingContext="{x:Reference settingPage}">
|
BindingContext="{x:Reference settingPage}">
|
||||||
|
|
||||||
<TableView Intent="Settings" RowHeight="44">
|
<TableView Intent="Settings" RowHeight="36">
|
||||||
<TableSection Title="{r:Text About}">
|
<TableSection Title="{r:Text About}">
|
||||||
<ui:OptionTextCell Title="{r:Text Version}"
|
<ui:OptionTextCell Title="{r:Text Version}"
|
||||||
Detail="{Binding Version}"/>
|
Detail="{Binding Version}"/>
|
||||||
|
Reference in New Issue
Block a user