1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-06-25 10:26:02 +02:00
bitwarden-mobile/src/App/Pages/Generator/GeneratorPage.xaml

224 lines
11 KiB
Plaintext
Raw Normal View History

2019-03-28 22:10:10 +01:00
<?xml version="1.0" encoding="utf-8" ?>
<pages:BaseContentPage
2019-03-28 22:10:10 +01:00
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
2019-03-29 04:52:33 +01:00
x:Class="Bit.App.Pages.GeneratorPage"
xmlns:pages="clr-namespace:Bit.App.Pages"
xmlns:controls="clr-namespace:Bit.App.Controls"
2019-04-22 19:47:45 +02:00
xmlns:u="clr-namespace:Bit.App.Utilities"
2019-03-29 14:16:22 +01:00
x:DataType="pages:GeneratorPageViewModel"
2019-03-29 04:52:33 +01:00
Title="{Binding PageTitle}">
2019-03-28 22:10:10 +01:00
<ContentPage.BindingContext>
2019-03-29 04:52:33 +01:00
<pages:GeneratorPageViewModel />
2019-03-28 22:10:10 +01:00
</ContentPage.BindingContext>
2019-05-13 20:43:23 +02:00
<ContentPage.Resources>
<ResourceDictionary>
<u:InverseBoolConverter x:Key="inverseBool" />
<ToolbarItem Text="{u:I18n Select}"
Clicked="Select_Clicked"
Order="Primary"
x:Name="_selectItem"
x:Key="selectItem" />
<ToolbarItem Text="{u:I18n PasswordHistory}"
Clicked="History_Clicked"
Order="Secondary"
x:Name="_historyItem"
x:Key="historyItem" />
<ToolbarItem Icon="more_vert.png"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Options}"
Clicked="More_Clicked"
x:Name="_moreItem"
x:Key="moreItem" />
2019-05-13 20:43:23 +02:00
</ResourceDictionary>
</ContentPage.Resources>
2019-06-04 04:19:51 +02:00
<ScrollView Padding="0, 0, 0, 20">
2019-06-05 14:19:36 +02:00
<StackLayout Spacing="0" Padding="0">
2019-05-13 20:43:23 +02:00
<StackLayout StyleClass="box">
<controls:MonoLabel
Text="{Binding Password}"
Margin="0, 20"
StyleClass="text-lg"
2019-05-13 22:06:56 +02:00
HorizontalTextAlignment="Center"
2019-05-13 21:24:38 +02:00
LineBreakMode="CharacterWrap" />
2019-06-05 14:19:36 +02:00
<Button Text="{u:I18n RegeneratePassword}"
2019-05-13 20:43:23 +02:00
HorizontalOptions="FillAndExpand"
Clicked="Regenerate_Clicked"></Button>
2019-06-05 14:19:36 +02:00
<Button Text="{u:I18n CopyPassword}"
2019-05-13 20:43:23 +02:00
HorizontalOptions="FillAndExpand"
Clicked="Copy_Clicked"></Button>
</StackLayout>
2019-05-13 20:43:23 +02:00
<StackLayout StyleClass="box">
<StackLayout StyleClass="box-row-header">
2019-06-20 23:05:28 +02:00
<Label Text="{u:I18n Options, Header=True}"
2019-05-13 20:43:23 +02:00
StyleClass="box-header, box-header-platform" />
</StackLayout>
<StackLayout StyleClass="box-row, box-row-input">
<Label
Text="{u:I18n Type}"
StyleClass="box-label" />
<Picker
ItemsSource="{Binding TypeOptions, Mode=OneTime}"
SelectedIndex="{Binding TypeSelectedIndex}"
StyleClass="box-value" />
</StackLayout>
<StackLayout Spacing="0"
Padding="0"
IsVisible="{Binding IsPassword, Converter={StaticResource inverseBool}}">
<StackLayout StyleClass="box-row, box-row-stepper">
<Label
Text="{u:I18n NumberOfWords}"
StyleClass="box-label, box-label-regular"
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center" />
<Label
Text="{Binding NumWords}"
StyleClass="box-label, box-sub-label"
HorizontalOptions="FillAndExpand"
HorizontalTextAlignment="End"
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center" />
<Stepper
Value="{Binding NumWords}"
Maximum="20"
2019-05-13 22:06:56 +02:00
Minimum="3"
2019-05-13 20:43:23 +02:00
Increment="1" />
</StackLayout>
<BoxView StyleClass="box-row-separator" />
<StackLayout StyleClass="box-row, box-row-input">
<Label
Text="{u:I18n WordSeparator}"
StyleClass="box-label" />
<Entry
Text="{Binding WordSeparator}"
IsSpellCheckEnabled="False"
IsTextPredictionEnabled="False"
2019-05-13 20:43:23 +02:00
StyleClass="box-value" />
</StackLayout>
</StackLayout>
<StackLayout Spacing="0" Padding="0" IsVisible="{Binding IsPassword}">
2019-05-13 21:24:38 +02:00
<StackLayout StyleClass="box-row, box-row-slider">
<Label
Text="{u:I18n Length}"
StyleClass="box-label, box-label-regular"
VerticalOptions="CenterAndExpand" />
<Label
Text="{Binding Length}"
StyleClass="box-label, box-sub-label"
2019-05-14 14:37:27 +02:00
WidthRequest="30"
2019-05-13 21:24:38 +02:00
VerticalOptions="CenterAndExpand"
HorizontalTextAlignment="End" />
<controls:ExtendedSlider
2019-05-31 17:13:46 +02:00
DragCompleted="LengthSlider_DragCompleted"
2019-05-13 21:24:38 +02:00
Value="{Binding Length}"
StyleClass="box-value"
VerticalOptions="CenterAndExpand"
HorizontalOptions="FillAndExpand"
2019-05-13 22:06:56 +02:00
Maximum="128"
Minimum="5" />
2019-05-13 21:24:38 +02:00
</StackLayout>
<BoxView StyleClass="box-row-separator" />
2019-05-13 20:43:23 +02:00
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="A-Z"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding Uppercase}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
<BoxView StyleClass="box-row-separator" />
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="a-z"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding Lowercase}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
<BoxView StyleClass="box-row-separator" />
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="0-9"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding Number}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
<BoxView StyleClass="box-row-separator" />
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="!@#$%^&amp;*"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding Special}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
<BoxView StyleClass="box-row-separator" />
<StackLayout StyleClass="box-row, box-row-stepper">
<Label
Text="{u:I18n MinNumbers}"
StyleClass="box-label, box-label-regular"
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center" />
<Label
Text="{Binding MinNumber}"
StyleClass="box-label, box-sub-label"
HorizontalOptions="FillAndExpand"
HorizontalTextAlignment="End"
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center" />
<Stepper
Value="{Binding MinNumber}"
Maximum="5"
2019-05-13 22:06:56 +02:00
Minimum="0"
2019-05-13 20:43:23 +02:00
Increment="1" />
</StackLayout>
<BoxView StyleClass="box-row-separator" />
<StackLayout StyleClass="box-row, box-row-stepper">
<Label
Text="{u:I18n MinSpecial}"
StyleClass="box-label, box-label-regular"
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center" />
<Label
Text="{Binding MinSpecial}"
StyleClass="box-label, box-sub-label"
HorizontalOptions="FillAndExpand"
HorizontalTextAlignment="End"
VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center" />
<Stepper
Value="{Binding MinSpecial}"
Maximum="5"
2019-05-13 22:06:56 +02:00
Minimum="0"
2019-05-13 20:43:23 +02:00
Increment="1" />
</StackLayout>
<BoxView StyleClass="box-row-separator" />
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="{u:I18n AvoidAmbiguousCharacters}"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding AvoidAmbiguous}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
<BoxView StyleClass="box-row-separator" />
</StackLayout>
</StackLayout>
</StackLayout>
2019-05-13 20:43:23 +02:00
</ScrollView>
2019-03-28 22:10:10 +01:00
</pages:BaseContentPage>