mirror of
https://github.com/bitwarden/android.git
synced 2025-01-03 23:07:34 +03:00
f8a7eb4c94
* WIP Add Share app extension on iOS for Send * Added Share app extension on iOS for Send and some code fixes as well * Updated iOS csprojs configs to linkskip the new extension project and also added AdHoc and AppStore configurations to iOS.ShareExtension.csproj * Code clean up and transformed bundle resources into links to the already used pngs of the main iOS project on ShareExtension * Updated build.yml to include provisioning profile for iOS Share extension * Adding in the missing provisioning profile * Removed .DS_Store from the iOS.ShareExtension csproj Resources * switching out the share extension profile * Added Share extension provisioning profile configuration on export options app store for github and also removed custom info.plist config for localhost which is not necessary * Moved property so that it's grouped with the full ones * Added AppCenter Crashes package to Core and updated FireAndForget Task Extension * Updated bundle reference of FontAwesome.ttf to bwi-font.ttf in order for it to compile on ShareExtension Co-authored-by: Joseph Flinn <joseph.s.flinn@gmail.com> Co-authored-by: Álison Fernandes <vvolkgang@users.noreply.github.com>
512 lines
29 KiB
XML
512 lines
29 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.SendAddEditPage"
|
|
xmlns:pages="clr-namespace:Bit.App.Pages"
|
|
xmlns:u="clr-namespace:Bit.App.Utilities"
|
|
xmlns:controls="clr-namespace:Bit.App.Controls"
|
|
xmlns:behaviors="clr-namespace:Bit.App.Behaviors"
|
|
xmlns:effects="clr-namespace:Bit.App.Effects"
|
|
xmlns:core="clr-namespace:Bit.Core;assembly=BitwardenCore"
|
|
x:DataType="pages:SendAddEditPageViewModel"
|
|
x:Name="_page"
|
|
Title="{Binding PageTitle}">
|
|
<ContentPage.BindingContext>
|
|
<pages:SendAddEditPageViewModel />
|
|
</ContentPage.BindingContext>
|
|
|
|
<ContentPage.ToolbarItems>
|
|
<ToolbarItem Text="{u:I18n Save}" Clicked="Save_Clicked" Order="Primary"
|
|
x:Key="saveItem" x:Name="_saveItem"/>
|
|
</ContentPage.ToolbarItems>
|
|
|
|
<ContentPage.Resources>
|
|
<ResourceDictionary>
|
|
<u:InverseBoolConverter x:Key="inverseBool" />
|
|
<u:IsNullConverter x:Key="null" />
|
|
<u:IsNotNullConverter x:Key="notNull" />
|
|
<ToolbarItem Text="{u:I18n Cancel}" Clicked="Close_Clicked" Order="Primary" Priority="-1"
|
|
x:Key="closeItem" x:Name="_closeItem" />
|
|
<ToolbarItem Icon="more_vert.png" Clicked="More_Clicked" Order="Primary" x:Name="_moreItem"
|
|
x:Key="moreItem"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n Options}" />
|
|
<ToolbarItem Text="{u:I18n RemovePassword}"
|
|
Clicked="RemovePassword_Clicked"
|
|
Order="Secondary"
|
|
IsDestructive="True"
|
|
x:Name="_removePassword"
|
|
x:Key="removePassword" />
|
|
<ToolbarItem Text="{u:I18n CopyLink}"
|
|
Clicked="CopyLink_Clicked"
|
|
Order="Secondary"
|
|
IsDestructive="True"
|
|
x:Name="_copyLink"
|
|
x:Key="copyLink" />
|
|
<ToolbarItem Text="{u:I18n ShareLink}"
|
|
Clicked="ShareLink_Clicked"
|
|
Order="Secondary"
|
|
IsDestructive="True"
|
|
x:Name="_shareLink"
|
|
x:Key="shareLink" />
|
|
<ToolbarItem Text="{u:I18n Delete}"
|
|
Clicked="Delete_Clicked"
|
|
Order="Secondary"
|
|
IsDestructive="True"
|
|
x:Name="_deleteItem"
|
|
x:Key="deleteItem" />
|
|
|
|
<ScrollView x:Key="scrollView" x:Name="_scrollView">
|
|
<StackLayout Spacing="20">
|
|
<StackLayout StyleClass="box">
|
|
<Frame
|
|
IsVisible="{Binding SendEnabled, Converter={StaticResource inverseBool}}"
|
|
Padding="10"
|
|
Margin="0, 12, 0, 0"
|
|
HasShadow="False"
|
|
BackgroundColor="Transparent"
|
|
BorderColor="Accent">
|
|
<Label
|
|
Text="{u:I18n SendDisabledWarning}"
|
|
StyleClass="text-muted, text-sm, text-bold"
|
|
HorizontalTextAlignment="Center" />
|
|
</Frame>
|
|
<Frame
|
|
IsVisible="{Binding SendOptionsPolicyInEffect}"
|
|
Padding="10"
|
|
Margin="0, 12, 0, 0"
|
|
HasShadow="False"
|
|
BackgroundColor="Transparent"
|
|
BorderColor="Accent">
|
|
<Label
|
|
Text="{u:I18n SendOptionsPolicyInEffect}"
|
|
StyleClass="text-muted, text-sm, text-bold"
|
|
HorizontalTextAlignment="Center" />
|
|
</Frame>
|
|
<StackLayout StyleClass="box-row">
|
|
<Label
|
|
Text="{u:I18n Name}"
|
|
StyleClass="box-label" />
|
|
<Entry
|
|
x:Name="_nameEntry"
|
|
Text="{Binding Send.Name}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-value" />
|
|
<Label
|
|
Text="{u:I18n NameInfo}"
|
|
StyleClass="box-footer-label"
|
|
Margin="0,5,0,0" />
|
|
</StackLayout>
|
|
<StackLayout
|
|
StyleClass="box-row"
|
|
IsVisible="{Binding ShowTypeButtons}">
|
|
<Label
|
|
Text="{u:I18n Type}"
|
|
StyleClass="box-label" />
|
|
<Grid
|
|
RowSpacing="0"
|
|
ColumnSpacing="0"
|
|
Margin="{Binding SegmentedButtonMargins}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Button
|
|
Text="{u:I18n TypeFile}"
|
|
StyleClass="segmented-button"
|
|
IsEnabled="{Binding IsText}"
|
|
HeightRequest="{Binding SegmentedButtonHeight}"
|
|
FontSize="{Binding SegmentedButtonFontSize}"
|
|
Clicked="FileType_Clicked"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n File}"
|
|
Grid.Column="0">
|
|
</Button>
|
|
<Button
|
|
Text="{u:I18n TypeText}"
|
|
StyleClass="segmented-button"
|
|
IsEnabled="{Binding IsFile}"
|
|
HeightRequest="{Binding SegmentedButtonHeight}"
|
|
FontSize="{Binding SegmentedButtonFontSize}"
|
|
Clicked="TextType_Clicked"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n Text}"
|
|
Grid.Column="1">
|
|
</Button>
|
|
</Grid>
|
|
</StackLayout>
|
|
<StackLayout
|
|
StyleClass="box-row"
|
|
IsVisible="{Binding IsFile}">
|
|
<Label
|
|
Text="{u:I18n TypeFile}"
|
|
StyleClass="box-label" />
|
|
<StackLayout
|
|
IsVisible="{Binding EditMode}"
|
|
Orientation="Horizontal">
|
|
<Label
|
|
Text="{Binding Send.File.FileName, Mode=OneWay}"
|
|
StyleClass="box-value"
|
|
VerticalTextAlignment="Center"
|
|
HorizontalOptions="StartAndExpand" />
|
|
<Label
|
|
Text="{Binding Send.File.SizeName, Mode=OneWay}"
|
|
StyleClass="box-sub-label"
|
|
HorizontalTextAlignment="End"
|
|
VerticalTextAlignment="Center" />
|
|
</StackLayout>
|
|
<StackLayout
|
|
IsVisible="{Binding EditMode, Converter={StaticResource inverseBool}}"
|
|
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" />
|
|
<Button
|
|
Text="{u:I18n ChooseFile}"
|
|
IsVisible="{Binding IsAddFromShare, Converter={StaticResource inverseBool}}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-button-row"
|
|
Clicked="ChooseFile_Clicked" />
|
|
<Label
|
|
Margin="0, 5, 0, 0"
|
|
Text="{u:I18n MaxFileSize}"
|
|
StyleClass="text-sm, text-muted"
|
|
HorizontalOptions="FillAndExpand"
|
|
HorizontalTextAlignment="Center" />
|
|
</StackLayout>
|
|
<Label
|
|
Text="{u:I18n TypeFileInfo}"
|
|
IsVisible="{Binding ShowTypeButtons}"
|
|
StyleClass="box-footer-label"
|
|
Margin="0,5,0,0" />
|
|
</StackLayout>
|
|
<StackLayout
|
|
StyleClass="box-row"
|
|
IsVisible="{Binding IsText}">
|
|
<Label
|
|
Text="{u:I18n TypeText}"
|
|
StyleClass="box-label" />
|
|
<Editor
|
|
x:Name="_textEditor"
|
|
AutoSize="TextChanges"
|
|
Text="{Binding Send.Text.Text}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-value"
|
|
Margin="{Binding EditorMargins}"
|
|
effects:ScrollEnabledEffect.IsScrollEnabled="false" >
|
|
<Editor.Behaviors>
|
|
<behaviors:EditorPreventAutoBottomScrollingOnFocusedBehavior ParentScrollView="{x:Reference _scrollView}" />
|
|
</Editor.Behaviors>
|
|
<Editor.Effects>
|
|
<effects:ScrollEnabledEffect />
|
|
</Editor.Effects>
|
|
</Editor>
|
|
<BoxView
|
|
StyleClass="box-row-separator"
|
|
IsVisible="{Binding ShowEditorSeparators}" />
|
|
<Label
|
|
Text="{u:I18n TypeTextInfo}"
|
|
StyleClass="box-footer-label"
|
|
Margin="0,5,0,10" />
|
|
<StackLayout
|
|
StyleClass="box-row, box-row-switch"
|
|
Margin="0,10,0,0">
|
|
<Label
|
|
Text="{u:I18n HideTextByDefault}"
|
|
StyleClass="box-label-regular"
|
|
VerticalOptions="Center"
|
|
HorizontalOptions="StartAndExpand" />
|
|
<Switch
|
|
IsToggled="{Binding Send.Text.Hidden}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
HorizontalOptions="End"
|
|
Margin="10,0,0,0" />
|
|
</StackLayout>
|
|
</StackLayout>
|
|
<StackLayout
|
|
StyleClass="box-row, box-row-switch">
|
|
<Label
|
|
Text="{Binding ShareOnSaveText}"
|
|
StyleClass="box-label-regular"
|
|
VerticalOptions="Center"
|
|
HorizontalOptions="StartAndExpand" />
|
|
<Switch
|
|
IsToggled="{Binding ShareOnSave}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
HorizontalOptions="End"
|
|
Margin="10,0,0,0" />
|
|
</StackLayout>
|
|
<StackLayout
|
|
Orientation="Horizontal"
|
|
Spacing="0">
|
|
<Button
|
|
Text="{u:I18n Options}"
|
|
x:Name="_btnOptions"
|
|
StyleClass="box-row-button"
|
|
TextColor="{DynamicResource PrimaryColor}"
|
|
Margin="0" />
|
|
<controls:IconButton
|
|
x:Name="_btnOptionsUp"
|
|
Text="{Binding Source={x:Static core:BitwardenIcons.ChevronUp}}"
|
|
StyleClass="box-row-button"
|
|
TextColor="{DynamicResource PrimaryColor}"
|
|
Clicked="ToggleOptions_Clicked"
|
|
IsVisible="False" />
|
|
<controls:IconButton
|
|
x:Name="_btnOptionsDown"
|
|
Text="{Binding Source={x:Static core:BitwardenIcons.AngleDown}}"
|
|
StyleClass="box-row-button"
|
|
TextColor="{DynamicResource PrimaryColor}"
|
|
Clicked="ToggleOptions_Clicked"
|
|
IsVisible="False" />
|
|
</StackLayout>
|
|
<StackLayout IsVisible="True">
|
|
<StackLayout
|
|
StyleClass="box-row"
|
|
Margin="0,10,0,0">
|
|
<Label
|
|
Text="{u:I18n DeletionDate}"
|
|
StyleClass="box-label" />
|
|
<Picker
|
|
x:Name="_deletionDateTypePicker"
|
|
IsVisible="{Binding EditMode, Converter={StaticResource inverseBool}}"
|
|
ItemsSource="{Binding DeletionTypeOptions, Mode=OneTime}"
|
|
SelectedIndex="{Binding DeletionDateTypeSelectedIndex}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-value"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n DeletionTime}" />
|
|
<Grid
|
|
IsVisible="{Binding ShowDeletionCustomPickers}"
|
|
Margin="0,5,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<controls:ExtendedDatePicker
|
|
NullableDate="{Binding DeletionDate, Mode=TwoWay}"
|
|
Format="d"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n DeletionDate}"
|
|
Grid.Column="0" />
|
|
<controls:ExtendedTimePicker
|
|
NullableTime="{Binding DeletionTime, Mode=TwoWay}"
|
|
Format="t"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n DeletionTime}"
|
|
Grid.Column="1" />
|
|
</Grid>
|
|
<Label
|
|
Text="{u:I18n DeletionDateInfo}"
|
|
StyleClass="box-footer-label"
|
|
Margin="0,5,0,0" />
|
|
</StackLayout>
|
|
<StackLayout StyleClass="box-row" Margin="0,5,0,0">
|
|
<Label
|
|
Text="{u:I18n ExpirationDate}"
|
|
StyleClass="box-label" />
|
|
<Picker
|
|
x:Name="_expirationDateTypePicker"
|
|
IsVisible="{Binding EditMode, Converter={StaticResource inverseBool}}"
|
|
ItemsSource="{Binding ExpirationTypeOptions, Mode=OneTime}"
|
|
SelectedIndex="{Binding ExpirationDateTypeSelectedIndex}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-value"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n ExpirationTime}" />
|
|
<Grid
|
|
IsVisible="{Binding ShowExpirationCustomPickers}"
|
|
Margin="0,5,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<controls:ExtendedDatePicker
|
|
NullableDate="{Binding ExpirationDate, Mode=TwoWay}"
|
|
PlaceHolder="mm/dd/yyyy"
|
|
Format="d"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n ExpirationDate}"
|
|
Grid.Column="0" />
|
|
<controls:ExtendedTimePicker
|
|
NullableTime="{Binding ExpirationTime, Mode=TwoWay}"
|
|
PlaceHolder="--:-- --"
|
|
Format="t"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n ExpirationTime}"
|
|
Grid.Column="1" />
|
|
</Grid>
|
|
<StackLayout
|
|
Orientation="Horizontal"
|
|
Margin="0,5,0,0">
|
|
<Label
|
|
Text="{u:I18n ExpirationDateInfo}"
|
|
StyleClass="box-footer-label"
|
|
HorizontalOptions="StartAndExpand" />
|
|
<Button
|
|
Text="{u:I18n Clear}"
|
|
IsVisible="{Binding EditMode}"
|
|
WidthRequest="110"
|
|
HeightRequest="{Binding SegmentedButtonHeight}"
|
|
FontSize="{Binding SegmentedButtonFontSize}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-row-button"
|
|
Clicked="ClearExpirationDate_Clicked" />
|
|
</StackLayout>
|
|
</StackLayout>
|
|
<StackLayout
|
|
StyleClass="box-row"
|
|
Margin="0,5,0,0">
|
|
<Label
|
|
Text="{u:I18n MaximumAccessCount}"
|
|
StyleClass="box-label" />
|
|
<StackLayout
|
|
StyleClass="box-row"
|
|
Orientation="Horizontal">
|
|
<Entry
|
|
Text="{Binding MaxAccessCount}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-value"
|
|
Keyboard="Numeric"
|
|
MaxLength="9"
|
|
TextChanged="OnMaxAccessCountTextChanged"
|
|
HorizontalOptions="FillAndExpand" />
|
|
<controls:ExtendedStepper
|
|
x:Name="_maxAccessCountStepper"
|
|
Value="{Binding MaxAccessCount}"
|
|
Maximum="999999999"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
Margin="10,0,0,0" />
|
|
</StackLayout>
|
|
<Label
|
|
Text="{u:I18n MaximumAccessCountInfo}"
|
|
StyleClass="box-footer-label" />
|
|
<StackLayout
|
|
IsVisible="{Binding EditMode}"
|
|
StyleClass="box-row"
|
|
Orientation="Horizontal">
|
|
<Label
|
|
Text="{u:I18n CurrentAccessCount}"
|
|
StyleClass="box-footer-label"
|
|
VerticalTextAlignment="Center" />
|
|
<Label
|
|
Text=": "
|
|
StyleClass="box-footer-label"
|
|
VerticalTextAlignment="Center" />
|
|
<Label
|
|
Text="{Binding Send.AccessCount, Mode=OneWay}"
|
|
StyleClass="box-label"
|
|
VerticalTextAlignment="Center" />
|
|
</StackLayout>
|
|
</StackLayout>
|
|
<StackLayout
|
|
StyleClass="box-row"
|
|
Margin="0,5,0,0">
|
|
<Label
|
|
Text="{u:I18n NewPassword}"
|
|
StyleClass="box-label" />
|
|
<StackLayout Orientation="Horizontal">
|
|
<Entry
|
|
Text="{Binding NewPassword}"
|
|
IsPassword="{Binding ShowPassword, Converter={StaticResource inverseBool}}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-value"
|
|
IsSpellCheckEnabled="False"
|
|
IsTextPredictionEnabled="False"
|
|
HorizontalOptions="FillAndExpand" />
|
|
<controls:IconButton
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-row-button, box-row-button-platform"
|
|
Text="{Binding ShowPasswordIcon}"
|
|
Command="{Binding TogglePasswordCommand}"
|
|
Margin="10,0,0,0"
|
|
AutomationProperties.IsInAccessibleTree="True"
|
|
AutomationProperties.Name="{u:I18n ToggleVisibility}" />
|
|
</StackLayout>
|
|
<Label
|
|
Text="{u:I18n PasswordInfo}"
|
|
StyleClass="box-footer-label"
|
|
Margin="0,5,0,0" />
|
|
</StackLayout>
|
|
<StackLayout
|
|
StyleClass="box-row"
|
|
Margin="0,5,0,0">
|
|
<Label
|
|
Text="{u:I18n Notes}"
|
|
StyleClass="box-label" />
|
|
<Editor
|
|
AutoSize="TextChanges"
|
|
Text="{Binding Send.Notes}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
StyleClass="box-value"
|
|
Margin="{Binding EditorMargins}"
|
|
effects:ScrollEnabledEffect.IsScrollEnabled="false" >
|
|
<Editor.Behaviors>
|
|
<behaviors:EditorPreventAutoBottomScrollingOnFocusedBehavior ParentScrollView="{x:Reference _scrollView}" />
|
|
</Editor.Behaviors>
|
|
<Editor.Effects>
|
|
<effects:ScrollEnabledEffect />
|
|
</Editor.Effects>
|
|
</Editor>
|
|
<BoxView
|
|
StyleClass="box-row-separator"
|
|
IsVisible="{Binding ShowEditorSeparators}" />
|
|
<Label
|
|
Text="{u:I18n NotesInfo}"
|
|
StyleClass="box-footer-label"
|
|
Margin="0,5,0,0" />
|
|
</StackLayout>
|
|
<StackLayout
|
|
StyleClass="box-row, box-row-switch"
|
|
Margin="0,5,0,0">
|
|
<Label
|
|
Text="{u:I18n HideEmail}"
|
|
StyleClass="box-label-regular"
|
|
VerticalOptions="Center"
|
|
HorizontalOptions="StartAndExpand" />
|
|
<Switch
|
|
IsToggled="{Binding Send.HideEmail}"
|
|
IsEnabled="{Binding DisableHideEmailControl, Converter={StaticResource inverseBool}}"
|
|
HorizontalOptions="End"
|
|
Margin="10,0,0,0" />
|
|
</StackLayout>
|
|
<StackLayout
|
|
StyleClass="box-row, box-row-switch"
|
|
Margin="0,5,0,0">
|
|
<Label
|
|
Text="{u:I18n DisableSend}"
|
|
StyleClass="box-label-regular"
|
|
VerticalOptions="Center"
|
|
HorizontalOptions="StartAndExpand" />
|
|
<Switch
|
|
IsToggled="{Binding Send.Disabled}"
|
|
IsEnabled="{Binding SendEnabled}"
|
|
HorizontalOptions="End"
|
|
Margin="10,0,0,0" />
|
|
</StackLayout>
|
|
</StackLayout>
|
|
|
|
</StackLayout>
|
|
</StackLayout>
|
|
</ScrollView>
|
|
|
|
</ResourceDictionary>
|
|
</ContentPage.Resources>
|
|
|
|
</pages:BaseContentPage>
|