(ToDo : navigation & bookmark for cover)homepage-05-09
parent
34191293d5
commit
4cdfd6a42d
Before Width: | Height: | Size: 3.7 KiB |
@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="LivreLand.View.ContentViews.EmpruntsPretsButtonView">
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Grid.Column="1">
|
||||
<Grid BackgroundColor="{StaticResource Gray}"
|
||||
Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button x:Name="pretsClicked"
|
||||
Text="Prêts"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"
|
||||
BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}"
|
||||
Clicked="OnPretsClicked"
|
||||
Margin="2"
|
||||
Grid.Column="0"/>
|
||||
<Button x:Name="empruntsButton"
|
||||
Text="Emprunts"
|
||||
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"
|
||||
BackgroundColor="Transparent"
|
||||
Clicked="OnEmpruntsClicked"
|
||||
Margin="2"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
<Border.StrokeShape>
|
||||
<RoundRectangle CornerRadius="10" />
|
||||
</Border.StrokeShape>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
</ContentView>
|
@ -0,0 +1,25 @@
|
||||
namespace LivreLand.View.ContentViews;
|
||||
|
||||
public partial class EmpruntsPretsButtonView : ContentView
|
||||
{
|
||||
public EmpruntsPretsButtonView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void OnPretsClicked(object sender, EventArgs e)
|
||||
{
|
||||
pretsClicked.BackgroundColor = Colors.Transparent;
|
||||
pretsClicked.IsEnabled = false;
|
||||
empruntsButton.BackgroundColor = Colors.White;
|
||||
empruntsButton.IsEnabled = true;
|
||||
}
|
||||
|
||||
public void OnEmpruntsClicked(object sender, EventArgs e)
|
||||
{
|
||||
pretsClicked.BackgroundColor = Colors.White;
|
||||
pretsClicked.IsEnabled = true;
|
||||
empruntsButton.BackgroundColor = Colors.Transparent;
|
||||
empruntsButton.IsEnabled = false;
|
||||
}
|
||||
}
|
@ -0,0 +1,205 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:view="clr-namespace:LivreLand.View"
|
||||
xmlns:contentView="clr-namespace:LivreLand.View.ContentViews"
|
||||
x:Class="LivreLand.View.EmpruntsPretsView"
|
||||
Title="EmpruntsPretsView">
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<view:HeaderPage HeaderTitle="Tous"
|
||||
HeaderBackButtonText="Mes livres"
|
||||
HeaderPlusButtonVisible="True"
|
||||
HeaderSwitchButtonVisible="True"
|
||||
Grid.Row="0"/>
|
||||
<contentView:EmpruntsPretsButtonView Grid.Row="2"/>
|
||||
<ScrollView Grid.Row="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="10"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid BackgroundColor="{AppThemeBinding Light={StaticResource HeaderGray}, Dark={StaticResource Gray900}}"
|
||||
Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Text="Antoine"
|
||||
VerticalOptions="Center"
|
||||
Style="{StaticResource HeaderCollectionViewText}"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
<CollectionView ItemsSource="{Binding AntoineBooks}"
|
||||
SelectionMode="Single"
|
||||
SelectionChanged="OnSelectionChanged"
|
||||
Grid.Row="2">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<VerticalStackLayout Margin="10"
|
||||
Spacing="20">
|
||||
<VisualStateManager.VisualStateGroups x:Name="SelectionStates">
|
||||
<VisualStateGroup>
|
||||
<VisualState x:Name="Selected">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Padding="-5,-5,-5,1"
|
||||
Margin="10,0,0,0"
|
||||
HeightRequest="100"
|
||||
WidthRequest="62"
|
||||
HorizontalOptions="Center"
|
||||
Stroke="{StaticResource Gray}"
|
||||
StrokeShape="RoundRectangle 3"
|
||||
StrokeThickness="3"
|
||||
Grid.Column="0"
|
||||
Grid.RowSpan="5">
|
||||
<Border HorizontalOptions="Center"
|
||||
Stroke="{StaticResource Gray}"
|
||||
StrokeShape="RoundRectangle 3"
|
||||
StrokeThickness="3">
|
||||
<Image Source="couverture_la_horde_du_contrevent.png"
|
||||
Aspect="AspectFill"
|
||||
Grid.Column="0"
|
||||
Grid.RowSpan="5"/>
|
||||
</Border>
|
||||
</Border>
|
||||
<Label Text="{Binding Title}"
|
||||
Style="{StaticResource MasterTitleBookText}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="0"/>
|
||||
<Label Text="{Binding Author}"
|
||||
Style="{StaticResource MasterAuthorBookText}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="1"/>
|
||||
<Label Text="{Binding State}"
|
||||
Style="{StaticResource MasterStateBookText}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="2"/>
|
||||
<contentView:StarNotationView Grid.Column="2"
|
||||
Grid.Row="4"/>
|
||||
</Grid>
|
||||
<contentView:SeparatorCutStartView/>
|
||||
</VerticalStackLayout>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
<Grid BackgroundColor="{AppThemeBinding Light={StaticResource HeaderGray}, Dark={StaticResource Gray900}}"
|
||||
Grid.Row="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Text="Audrey Pouclet"
|
||||
VerticalOptions="Center"
|
||||
Style="{StaticResource HeaderCollectionViewText}"
|
||||
Grid.Column="1"/>
|
||||
</Grid>
|
||||
<CollectionView ItemsSource="{Binding AudreyPoucletBooks}"
|
||||
SelectionMode="Single"
|
||||
SelectionChanged="OnSelectionChanged"
|
||||
Grid.Row="6">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<VerticalStackLayout Margin="10"
|
||||
Spacing="20">
|
||||
<VisualStateManager.VisualStateGroups x:Name="SelectionStates">
|
||||
<VisualStateGroup>
|
||||
<VisualState x:Name="Selected">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
<ColumnDefinition Width="10"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Padding="-5,-5,-5,1"
|
||||
Margin="10,0,0,0"
|
||||
HeightRequest="100"
|
||||
WidthRequest="62"
|
||||
HorizontalOptions="Center"
|
||||
Stroke="{StaticResource Gray}"
|
||||
StrokeShape="RoundRectangle 3"
|
||||
StrokeThickness="3"
|
||||
Grid.Column="0"
|
||||
Grid.RowSpan="5">
|
||||
<Border HorizontalOptions="Center"
|
||||
Stroke="{StaticResource Gray}"
|
||||
StrokeShape="RoundRectangle 3"
|
||||
StrokeThickness="3">
|
||||
<Image Source="couverture_la_horde_du_contrevent.png"
|
||||
Aspect="AspectFill"
|
||||
Grid.Column="0"
|
||||
Grid.RowSpan="5"/>
|
||||
</Border>
|
||||
</Border>
|
||||
<Label Text="{Binding Title}"
|
||||
Style="{StaticResource MasterTitleBookText}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="0"/>
|
||||
<Label Text="{Binding Author}"
|
||||
Style="{StaticResource MasterAuthorBookText}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="1"/>
|
||||
<Label Text="{Binding State}"
|
||||
Style="{StaticResource MasterStateBookText}"
|
||||
Grid.Column="2"
|
||||
Grid.Row="2"/>
|
||||
<contentView:StarNotationView Grid.Column="2"
|
||||
Grid.Row="4"/>
|
||||
</Grid>
|
||||
<contentView:SeparatorCutStartView/>
|
||||
</VerticalStackLayout>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
</Grid>
|
||||
</ScrollView>
|
||||
</Grid>
|
||||
|
||||
</ContentPage>
|
@ -0,0 +1,27 @@
|
||||
using LivreLand.Model;
|
||||
|
||||
namespace LivreLand.View;
|
||||
|
||||
public partial class EmpruntsPretsView : ContentPage
|
||||
{
|
||||
public List<BookModel> AntoineBooks { get; set; } = new List<BookModel>()
|
||||
{
|
||||
new BookModel("The Wake","Scott Snyder","Terminé", 0),
|
||||
};
|
||||
|
||||
public List<BookModel> AudreyPoucletBooks { get; set; } = new List<BookModel>()
|
||||
{
|
||||
new BookModel("Les feux de Cibola","James S. A. Corey","Terminé", 0),
|
||||
};
|
||||
|
||||
public EmpruntsPretsView()
|
||||
{
|
||||
BindingContext = this;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView());
|
||||
}
|
||||
}
|
Loading…
Reference in new issue