<?xml version="1.0" encoding="UTF-8" ?>
<pages:BaseContentPage
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:pages="clr-namespace:Bit.App.Pages"
    x:DataType="pages:OtherSettingsPageViewModel"
    xmlns:controls="clr-namespace:Bit.App.Controls"
    xmlns:u="clr-namespace:Bit.App.Utilities"
    x:Class="Bit.App.Pages.OtherSettingsPage"
    Title="{u:I18n Other}">
    
    <ContentPage.BindingContext>
        <pages:OtherSettingsPageViewModel />
    </ContentPage.BindingContext>

    <ContentPage.Resources>
        <u:InverseBoolConverter x:Key="inverseBoolConverter" />
    </ContentPage.Resources>

    <ScrollView Padding="0, 0, 0, 20">
        <StackLayout Padding="0" Spacing="5">
            <controls:SwitchItemView
                Title="{u:I18n EnableSyncOnRefresh}"
                IsToggled="{Binding EnableSyncOnRefresh}"
                Subtitle="{u:I18n EnableSyncOnRefreshDescription}"
                AutomationId="SyncOnRefreshSwitch"
                StyleClass="settings-item-view"
                HorizontalOptions="FillAndExpand" />

            <StackLayout StyleClass="box" Margin="0,12,0,0">
                <Button
                    Text="{u:I18n SyncNow}"
                    Command="{Binding SyncCommand}"
                    AutomationId="SyncNowButton"></Button>
                <Label
                    Text="{Binding LastSyncDisplay}"
                    StyleClass="text-muted, text-sm"
                    HorizontalTextAlignment="Start"
                    Margin="0,10"
                    AutomationId="LastSyncLabel" />
            </StackLayout>

            <controls:SettingChooserItemView
                Title="{u:I18n ClearClipboard}"
                Subtitle="{u:I18n ClearClipboardDescription}"
                DisplayValue="{Binding ClearClipboardPickerViewModel.SelectedValue}"
                ChooseCommand="{Binding ClearClipboardPickerViewModel.SelectOptionCommand}"
                AutomationId="ClearClipboardChooser"
                StyleClass="settings-item-view"
                HorizontalOptions="FillAndExpand"/>
            
            <controls:SwitchItemView
                Title="{u:I18n AllowScreenCapture}"
                IsToggled="{Binding IsScreenCaptureAllowed}"
                IsEnabled="{Binding CanToggleeScreenCaptureAllowed}"
                IsVisible="{OnPlatform Android=True, iOS=False}"
                AutomationId="AllowScreenCaptureSwitch"
                StyleClass="settings-item-view"
                HorizontalOptions="FillAndExpand" />
            
            <controls:SwitchItemView
                Title="{u:I18n ConnectToWatch}"
                IsToggled="{Binding ShouldConnectToWatch}"
                IsEnabled="{Binding CanToggleShouldConnectToWatch}"
                IsVisible="{OnPlatform iOS=True, Android=False}"
                AutomationId="ConnectToWatchSwitch"
                StyleClass="settings-item-view"
                HorizontalOptions="FillAndExpand" />

        </StackLayout>
    </ScrollView>

</pages:BaseContentPage>
