<?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.MainPage"
                            BackgroundColor="{DynamicResource WindowColor}"
                            Title="{r:Text Follow}">
    <ContentPage.ToolbarItems>
        <ToolbarItem Order="Primary" Clicked="Refresh_Clicked"
                     IconImageSource="{DynamicResource FontIconRefresh}"/>
    </ContentPage.ToolbarItems>
    <Grid>
        <ScrollView x:Name="scrollView" Scrolled="ScrollView_Scrolled"
                    HorizontalOptions="Fill" HorizontalScrollBarVisibility="Never">
            <StackLayout>
                <ActivityIndicator x:Name="activityLoading" Margin="0, 10, 0, 0"
                                   HeightRequest="40"
                                   IsRunning="{Binding IsLoading}"
                                   IsVisible="{Binding IsLoading}"/>
                <u:FlowLayout ItemsSource="{Binding Illusts}"
                              HorizontalOptions="Fill" Column="{Binding Columns}"
                              RowSpacing="16" ColumnSpacing="16"
                              ItemTemplate="{StaticResource cardView}">
                    <u:FlowLayout.Margin>
                        <OnPlatform x:TypeArguments="Thickness"
                                    iOS="16, 66, 16, 16"
                                    Android="16, 56, 16, 16"/>
                    </u:FlowLayout.Margin>
                </u:FlowLayout>
            </StackLayout>
        </ScrollView>
        <u:BlurryPanel x:Name="panelBar" VerticalOptions="Start"
                       HeightRequest="{OnPlatform Android=40, iOS=50}"/>
        <SearchBar x:Name="searchBar" Placeholder="{r:Text Search}"
                   HeightRequest="{OnPlatform Android=40, iOS=50}"
                   VerticalOptions="Start"
                   CancelButtonColor="{DynamicResource TintColor}"
                   Text="{Binding Keywords, Mode=TwoWay}"
                   SearchButtonPressed="SearchBar_SearchButtonPressed"/>
    </Grid>
</i:IllustDataCollectionPage>
