filter conditions

This commit is contained in:
2022-03-10 17:27:49 +08:00
parent 84ec2df987
commit 74053a328e
18 changed files with 330 additions and 95 deletions

View File

@ -4,6 +4,7 @@
xmlns:ui="clr-namespace:Billing.UI"
xmlns:v="clr-namespace:Billing.Views"
xmlns:chart="clr-namespace:Microcharts.Forms;assembly=Microcharts.Forms"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Billing.Views.RankPage"
x:Name="rankPage"
@ -13,7 +14,7 @@
<Shell.TitleView>
<Grid>
<StackLayout Margin="30, 0, 0, 0" HorizontalOptions="Center" VerticalOptions="Center"
<StackLayout HorizontalOptions="Center" VerticalOptions="Center"
Orientation="Horizontal" Spacing="10">
<ui:TintImageButton Source="left.png" WidthRequest="20" HeightRequest="20"
VerticalOptions="Center" HorizontalOptions="Start"
@ -21,6 +22,9 @@
<Label Text="{Binding Title}"
TextColor="{DynamicResource PrimaryColor}"
FontSize="{OnPlatform Android=20, iOS=18}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding FilterCommand}"/>
</Label.GestureRecognizers>
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String"
Android="OpenSans-SemiBold.ttf#OpenSans-SemiBold"
@ -34,9 +38,9 @@
</Grid>
</Shell.TitleView>
<ContentPage.ToolbarItems>
<!--<ContentPage.ToolbarItems>
<ToolbarItem Order="Primary" IconImageSource="filter.png" Command="{Binding FilterCommand}"/>
</ContentPage.ToolbarItems>
</ContentPage.ToolbarItems>-->
<ContentPage.Resources>
<ui:NegativeConverter x:Key="negativeConverter"/>
@ -48,7 +52,7 @@
<Style x:Key="titleLabel" TargetType="Label">
<Setter Property="FontSize" Value="16"/>
<Setter Property="Margin" Value="10, 20, 10, 10"/>
<!--<Setter Property="TextColor" Value="{DynamicResource SecondaryTextColor}"/>-->
<Setter Property="TextColor" Value="{DynamicResource TextColor}"/>
</Style>
<Style x:Key="promptLabel" TargetType="Label">
<Setter Property="HeightRequest" Value="240"/>
@ -58,12 +62,16 @@
<Setter Property="VerticalTextAlignment" Value="Center"/>
<Setter Property="TextColor" Value="{DynamicResource SecondaryTextColor}"/>
</Style>
<Style TargetType="Button">
<Setter Property="TextColor" Value="{DynamicResource TextColor}"/>
<Setter Property="FontSize" Value="14"/>
</Style>
</ContentPage.Resources>
<Grid>
<ScrollView x:Name="scroller">
<ScrollView x:Name="scroller" Scrolled="Scroller_Scrolled">
<StackLayout>
<Grid Margin="0, 10, 0, 0" Padding="8" ColumnSpacing="8" ColumnDefinitions="*, Auto" HeightRequest="24"
<Grid Padding="8" ColumnSpacing="8" ColumnDefinitions="*, Auto" HeightRequest="24"
BackgroundColor="{DynamicResource PromptBackgroundColor}">
<StackLayout Grid.Column="1" Orientation="Horizontal" Spacing="6">
<Label Text="{r:Text Income}" TextColor="{DynamicResource GreenColor}"
@ -133,7 +141,7 @@
<ui:BlurryPanel x:Name="panelFilter" VerticalOptions="Start" Opacity="0"
BackgroundColor="{DynamicResource WindowBackgroundColor}"
HeightRequest="{Binding Height, Source={x:Reference gridFilter}}"/>
<Grid x:Name="gridFilter" VerticalOptions="Start" Opacity="0" Padding="10">
<Grid x:Name="gridFilter" VerticalOptions="Start" Opacity="0" Padding="10" RowDefinitions="Auto, Auto, Auto">
<ui:SegmentedControl Margin="6, 6, 6, 3" VerticalOptions="Center"
SelectedSegmentIndex="{Binding SegmentType, Mode=TwoWay}"
SelectedTextColor="{DynamicResource TextColor}"
@ -143,6 +151,33 @@
<ui:SegmentedControlOption Text="{r:Text Income}"/>
</ui:SegmentedControl.Children>
</ui:SegmentedControl>
<ScrollView Grid.Row="1" Margin="6, 6, 6, 3">
<ui:SegmentedControl SelectedSegmentIndex="{Binding SegmentDate, Mode=TwoWay}"
SelectedTextColor="{DynamicResource TextColor}"
TintColor="{DynamicResource PromptBackgroundColor}">
<ui:SegmentedControl.Children>
<ui:SegmentedControlOption Text="{r:Text Monthly}"/>
<ui:SegmentedControlOption Text="{r:Text Today}"/>
<ui:SegmentedControlOption Text="{r:Text PastMonth}"/>
<ui:SegmentedControlOption Text="{r:Text PastQuarter}"/>
<ui:SegmentedControlOption Text="{r:Text PastSixMonths}"/>
<ui:SegmentedControlOption Text="{r:Text PastYear}"/>
<ui:SegmentedControlOption Text="{r:Text Total}"/>
</ui:SegmentedControl.Children>
</ui:SegmentedControl>
</ScrollView>
<Grid Grid.Row="2" ColumnDefinitions="*, Auto, *" Margin="0, 10">
<ui:OptionDatePicker Date="{Binding StartPickerDate, Mode=TwoWay}"
FontSize="16" TextColor="{DynamicResource TextColor}"
VerticalOptions="Center"
ios:DatePicker.UpdateMode="WhenFinished"/>
<Label Grid.Column="1" Text="{r:Text To}" TextColor="{DynamicResource SecondaryTextColor}"
VerticalOptions="Center"/>
<ui:OptionDatePicker Grid.Column="2" Date="{Binding EndPickerDate, Mode=TwoWay}"
FontSize="16" TextColor="{DynamicResource TextColor}"
VerticalOptions="Center"
ios:DatePicker.UpdateMode="WhenFinished"/>
</Grid>
</Grid>
</Grid>
</ui:BillingPage>