<?xml version="1.0" encoding="UTF-8"?>
<i:IllustDataCollectionPage xmlns="http://xamarin.com/schemas/2014/forms"
                            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                            xmlns:i="clr-namespace:Pixiview.Illust"
                            xmlns:u="clr-namespace:Pixiview.UI"
                            xmlns:r="clr-namespace:Pixiview.Resources"
                            x:Class="Pixiview.Illust.RankingPage"
                            BackgroundColor="{DynamicResource WindowColor}">
    <ContentPage.ToolbarItems>
        <ToolbarItem Order="Primary" Clicked="Refresh_Clicked"
                     IconImageSource="{DynamicResource FontIconRefresh}"/>
    </ContentPage.ToolbarItems>
    <Grid Padding="{Binding PageTopMargin}">
        <ScrollView HorizontalOptions="Fill">
            <u:FlowLayout ItemsSource="{Binding Illusts}"
                          HorizontalOptions="Fill" Column="{Binding Columns}"
                          Margin="16, 10, 16, 16" RowSpacing="16" ColumnSpacing="16"
                          ItemTemplate="{StaticResource cardView}"/>
        </ScrollView>
        <SearchBar Placeholder="{r:Text Search}" VerticalOptions="Start"
                   Margin="0, -46, 0, 0" HeightRequest="50"
                   BackgroundColor="{DynamicResource WindowColor}"
                   CancelButtonColor="{DynamicResource SubTextColor}"
                   Text="{Binding Keywords, Mode=TwoWay}"
                   SearchButtonPressed="SearchBar_SearchButtonPressed"
                   Unfocused="SearchBar_Unfocused"
                   />
        <Frame HasShadow="False" Margin="0" Padding="20" CornerRadius="8"
               IsVisible="{Binding Loading}"
               HorizontalOptions="Center" VerticalOptions="Center"
               BackgroundColor="{DynamicResource MaskColor}">
            <ActivityIndicator IsRunning="True" IsVisible="True"
                               Color="{DynamicResource WindowColor}"/>
        </Frame>
    </Grid>
</i:IllustDataCollectionPage>
