mirror of
https://github.com/bitwarden/android.git
synced 2025-01-07 08:47:36 +03:00
95 lines
4.7 KiB
XML
95 lines
4.7 KiB
XML
<?xml version="1.0" encoding="utf-8" ?>
|
|
<pages:BaseContentPage
|
|
xmlns="http://xamarin.com/schemas/2014/forms"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
|
x:Class="Bit.App.Pages.AttachmentsPage"
|
|
xmlns:pages="clr-namespace:Bit.App.Pages"
|
|
xmlns:views="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore"
|
|
xmlns:u="clr-namespace:Bit.App.Utilities"
|
|
xmlns:controls="clr-namespace:Bit.App.Controls"
|
|
x:DataType="pages:AttachmentsPageViewModel"
|
|
x:Name="_page"
|
|
Title="{Binding PageTitle}">
|
|
<ContentPage.BindingContext>
|
|
<pages:AttachmentsPageViewModel />
|
|
</ContentPage.BindingContext>
|
|
|
|
<ContentPage.ToolbarItems>
|
|
<ToolbarItem Text="{u:I18n Save}" Clicked="Save_Clicked" />
|
|
</ContentPage.ToolbarItems>
|
|
|
|
<ContentPage.Resources>
|
|
<ResourceDictionary>
|
|
<u:InverseBoolConverter x:Key="inverseBool" />
|
|
<u:IsNotNullConverter x:Key="notNull" />
|
|
<u:IsNullConverter x:Key="null" />
|
|
</ResourceDictionary>
|
|
</ContentPage.Resources>
|
|
|
|
<ScrollView x:Name="_scrollView">
|
|
<StackLayout Spacing="20">
|
|
<StackLayout StyleClass="box">
|
|
<StackLayout StyleClass="box-row"
|
|
IsVisible="{Binding HasAttachments, Converter={StaticResource inverseBool}}">
|
|
<Label Text="{u:I18n NoAttachments}" />
|
|
</StackLayout>
|
|
<controls:RepeaterView ItemsSource="{Binding Attachments}" IsVisible="{Binding HasAttachments}">
|
|
<controls:RepeaterView.ItemTemplate>
|
|
<DataTemplate x:DataType="views:AttachmentView">
|
|
<StackLayout Spacing="0" Padding="0">
|
|
<StackLayout Orientation="Horizontal" StyleClass="box-row" Spacing="10">
|
|
<Label
|
|
Text="{Binding FileName, Mode=OneWay}"
|
|
StyleClass="box-value"
|
|
VerticalTextAlignment="Center"
|
|
HorizontalOptions="StartAndExpand" />
|
|
<Label
|
|
Text="{Binding SizeName, Mode=OneWay}"
|
|
StyleClass="box-sub-label"
|
|
HorizontalTextAlignment="End"
|
|
VerticalTextAlignment="Center" />
|
|
<controls:FaButton
|
|
StyleClass="box-row-button, box-row-button-platform"
|
|
Text=""
|
|
Command="{Binding BindingContext.DeleteAttachmentCommand, Source={x:Reference _page}}"
|
|
CommandParameter="{Binding .}"
|
|
VerticalOptions="Center" />
|
|
</StackLayout>
|
|
<BoxView StyleClass="box-row-separator" />
|
|
</StackLayout>
|
|
</DataTemplate>
|
|
</controls:RepeaterView.ItemTemplate>
|
|
</controls:RepeaterView>
|
|
</StackLayout>
|
|
<StackLayout StyleClass="box">
|
|
<StackLayout StyleClass="box-row-header">
|
|
<Label Text="{u:I18n AddNewAttachment}"
|
|
StyleClass="box-header, box-header-platform" />
|
|
</StackLayout>
|
|
<StackLayout StyleClass="box-row">
|
|
<Label
|
|
IsVisible="{Binding FileName, Converter={StaticResource null}}"
|
|
Text="{u:I18n NoFileChosen}"
|
|
LineBreakMode="CharacterWrap"
|
|
StyleClass="text-sm, text-muted"
|
|
HorizontalOptions="FillAndExpand"
|
|
HorizontalTextAlignment="Center" />
|
|
<Label
|
|
IsVisible="{Binding FileName, Converter={StaticResource notNull}}"
|
|
Text="{Binding FileName}"
|
|
LineBreakMode="CharacterWrap"
|
|
StyleClass="text-sm, text-muted"
|
|
HorizontalOptions="FillAndExpand"
|
|
HorizontalTextAlignment="Center" />
|
|
</StackLayout>
|
|
<Button Text="{u:I18n ChooseFile}" StyleClass="box-button-row"
|
|
Clicked="ChooseFile_Clicked"></Button>
|
|
<Label
|
|
Margin="0, 10, 0, 0"
|
|
Text="{u:I18n MaxFileSize}"
|
|
StyleClass="box-footer-label" />
|
|
</StackLayout>
|
|
</StackLayout>
|
|
</ScrollView>
|
|
|
|
</pages:BaseContentPage>
|