bitwarden-android/src/App/Pages/Generator/GeneratorPage.xaml

276 lines
14 KiB
Text
Raw Normal View History

2019-03-29 00:10:10 +03:00
<?xml version="1.0" encoding="utf-8" ?>
<pages:BaseContentPage
2019-03-29 00:10:10 +03:00
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
2019-03-29 06:52:33 +03:00
x:Class="Bit.App.Pages.GeneratorPage"
xmlns:pages="clr-namespace:Bit.App.Pages"
xmlns:controls="clr-namespace:Bit.App.Controls"
2019-04-22 20:47:45 +03:00
xmlns:u="clr-namespace:Bit.App.Utilities"
2019-03-29 16:16:22 +03:00
x:DataType="pages:GeneratorPageViewModel"
2019-03-29 06:52:33 +03:00
Title="{Binding PageTitle}">
2019-03-29 00:10:10 +03:00
<ContentPage.BindingContext>
2019-03-29 06:52:33 +03:00
<pages:GeneratorPageViewModel />
2019-03-29 00:10:10 +03:00
</ContentPage.BindingContext>
2019-05-13 21:43:23 +03:00
<ContentPage.Resources>
<ResourceDictionary>
<u:InverseBoolConverter x:Key="inverseBool" />
2019-06-24 22:22:46 +03:00
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1"
x:Name="_closeItem" x:Key="closeItem" />
<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 21:43:23 +03:00
</ResourceDictionary>
</ContentPage.Resources>
2019-06-04 05:19:51 +03:00
<ScrollView Padding="0, 0, 0, 20">
2019-06-05 15:19:36 +03:00
<StackLayout Spacing="0" Padding="0">
2019-05-13 21:43:23 +03:00
<StackLayout StyleClass="box">
<Grid IsVisible="{Binding IsPolicyInEffect}"
Margin="0, 12, 0, 0"
RowSpacing="0"
ColumnSpacing="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Frame Padding="10"
Margin="0"
HasShadow="False"
BackgroundColor="Transparent"
BorderColor="Accent">
<Label
Text="{u:I18n PasswordGeneratorPolicyInEffect}"
StyleClass="text-muted, text-sm, text-bold"
HorizontalTextAlignment="Center" />
</Frame>
</Grid>
2019-05-13 21:43:23 +03:00
<controls:MonoLabel
Text="{Binding ColoredPassword, Mode=OneWay}"
TextType="Html"
2019-05-13 21:43:23 +03:00
Margin="0, 20"
StyleClass="text-lg"
2019-05-13 23:06:56 +03:00
HorizontalTextAlignment="Center"
2019-05-13 22:24:38 +03:00
LineBreakMode="CharacterWrap" />
2019-06-05 15:19:36 +03:00
<Button Text="{u:I18n RegeneratePassword}"
2019-05-13 21:43:23 +03:00
HorizontalOptions="FillAndExpand"
Clicked="Regenerate_Clicked"></Button>
2019-06-05 15:19:36 +03:00
<Button Text="{u:I18n CopyPassword}"
2019-05-13 21:43:23 +03:00
HorizontalOptions="FillAndExpand"
Clicked="Copy_Clicked"></Button>
</StackLayout>
2019-05-13 21:43:23 +03:00
<StackLayout StyleClass="box">
<StackLayout StyleClass="box-row-header">
2019-06-21 00:05:28 +03:00
<Label Text="{u:I18n Options, Header=True}"
2019-05-13 21:43:23 +03:00
StyleClass="box-header, box-header-platform" />
</StackLayout>
<StackLayout StyleClass="box-row, box-row-input">
<Label
Text="{u:I18n Type}"
StyleClass="box-label" />
<Picker
2019-06-25 00:32:24 +03:00
x:Name="_typePicker"
2019-05-13 21:43:23 +03:00
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 23:06:56 +03:00
Minimum="3"
2019-05-13 21:43:23 +03: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 21:43:23 +03:00
StyleClass="box-value" />
</StackLayout>
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="{u:I18n Capitalize}"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding Capitalize}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
<BoxView StyleClass="box-row-separator" />
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="{u:I18n IncludeNumber}"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding IncludeNumber}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
2019-05-13 21:43:23 +03:00
</StackLayout>
<StackLayout Spacing="0" Padding="0" IsVisible="{Binding IsPassword}">
2019-05-13 22:24:38 +03: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 15:37:27 +03:00
WidthRequest="30"
2019-05-13 22:24:38 +03:00
VerticalOptions="CenterAndExpand"
HorizontalTextAlignment="End" />
<controls:ExtendedSlider
2019-05-31 18:13:46 +03:00
DragCompleted="LengthSlider_DragCompleted"
2019-05-13 22:24:38 +03:00
Value="{Binding Length}"
StyleClass="box-value"
VerticalOptions="CenterAndExpand"
HorizontalOptions="FillAndExpand"
2019-05-13 23:06:56 +03:00
Maximum="128"
Minimum="5" />
2019-05-13 22:24:38 +03:00
</StackLayout>
<BoxView StyleClass="box-row-separator" />
2019-05-13 21:43:23 +03:00
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="A-Z"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding Uppercase}"
IsEnabled="{Binding IsUppercaseSwitchEnabled}"
2019-05-13 21:43:23 +03:00
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}"
IsEnabled="{Binding IsLowercaseSwitchEnabled}"
2019-05-13 21:43:23 +03:00
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}"
IsEnabled="{Binding IsNumberSwitchEnabled}"
2019-05-13 21:43:23 +03:00
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}"
IsEnabled="{Binding IsSpecialSwitchEnabled}"
2019-05-13 21:43:23 +03:00
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 23:06:56 +03:00
Minimum="0"
2019-05-13 21:43:23 +03: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 23:06:56 +03:00
Minimum="0"
2019-05-13 21:43:23 +03: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 21:43:23 +03:00
</ScrollView>
2019-03-29 00:10:10 +03:00
</pages:BaseContentPage>