Bitwarden-app-android-iphon.../src/App/Pages/Accounts/TwoFactorPage.xaml

133 lines
6.0 KiB
Plaintext
Raw Normal View History

2019-05-24 03:19:45 +02:00
<?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.TwoFactorPage"
xmlns:pages="clr-namespace:Bit.App.Pages"
xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:u="clr-namespace:Bit.App.Utilities"
x:DataType="pages:TwoFactorPageViewModel"
Title="{Binding PageTitle}">
<ContentPage.BindingContext>
<pages:TwoFactorPageViewModel />
</ContentPage.BindingContext>
<ContentPage.Resources>
<ResourceDictionary>
<u:InverseBoolConverter x:Key="inverseBool" />
2019-05-27 17:57:10 +02:00
<u:IsNullConverter x:Key="isNull" />
2019-05-28 15:12:05 +02:00
<ToolbarItem Text="{u:I18n Continue}" Clicked="Continue_Clicked"
x:Name="_continueItem" x:Key="continueItem" />
2019-05-24 03:19:45 +02:00
</ResourceDictionary>
</ContentPage.Resources>
2019-06-12 03:31:51 +02:00
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Cancel}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
</ContentPage.ToolbarItems>
2019-05-28 15:04:20 +02:00
<ScrollView x:Name="_scrollView">
<StackLayout Spacing="10" Padding="0, 0, 0, 10" VerticalOptions="FillAndExpand">
<StackLayout Spacing="20" Padding="0" IsVisible="{Binding TotpMethod, Mode=OneWay}">
2019-05-27 17:57:10 +02:00
<Label
Text="{Binding TotpInstruction, Mode=OneWay}"
2019-05-28 15:04:20 +02:00
Margin="10, 20, 10, 0"
2019-05-27 17:57:10 +02:00
HorizontalTextAlignment="Center" />
<StackLayout StyleClass="box">
<StackLayout StyleClass="box-row, box-row-input">
<Label
Text="{u:I18n VerificationCode}"
StyleClass="box-label" />
<Entry
Text="{Binding Token}"
2019-05-28 16:12:51 +02:00
x:Name="_totpEntry"
2019-05-27 17:57:10 +02:00
Keyboard="Numeric"
2019-05-31 18:13:14 +02:00
StyleClass="box-value"
ReturnType="Go"
ReturnCommand="{Binding SubmitCommand}" />
2019-05-27 17:57:10 +02:00
</StackLayout>
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="{u:I18n RememberMe}"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding Remember}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
</StackLayout>
</StackLayout>
2019-05-28 15:04:20 +02:00
<StackLayout Spacing="20" Padding="0" IsVisible="{Binding YubikeyMethod, Mode=OneWay}">
2019-05-27 17:57:10 +02:00
<Label
Text="{Binding YubikeyInstruction, Mode=OneWay}"
2019-05-28 15:04:20 +02:00
Margin="10, 20, 10, 0"
2019-05-27 17:57:10 +02:00
HorizontalTextAlignment="Center" />
<Image
Source="yubikey.png"
2019-05-28 15:04:20 +02:00
Margin="10, 0"
2019-05-27 17:57:10 +02:00
WidthRequest="266"
HeightRequest="160"
HorizontalOptions="Center" />
<StackLayout StyleClass="box">
<StackLayout StyleClass="box-row, box-row-input">
<Entry
2019-06-01 07:08:18 +02:00
x:Name="_yubikeyTokenEntry"
2019-05-27 17:57:10 +02:00
Text="{Binding Token}"
2019-05-31 18:13:14 +02:00
StyleClass="box-value"
ReturnType="Go"
ReturnCommand="{Binding SubmitCommand}" />
2019-05-27 17:57:10 +02:00
</StackLayout>
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="{u:I18n RememberMe}"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding Remember}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
</StackLayout>
</StackLayout>
2019-05-28 15:04:20 +02:00
<StackLayout Spacing="0" Padding="0" IsVisible="{Binding DuoMethod, Mode=OneWay}"
VerticalOptions="FillAndExpand">
2019-05-27 17:57:10 +02:00
<controls:HybridWebView
x:Name="_duoWebView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
MinimumHeightRequest="400" />
2019-05-28 15:04:20 +02:00
<StackLayout StyleClass="box" VerticalOptions="End">
2019-05-27 17:57:10 +02:00
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="{u:I18n RememberMe}"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding Remember}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
</StackLayout>
</StackLayout>
<StackLayout
Spacing="0"
Padding="0"
IsVisible="{Binding SelectedProviderType, Mode=OneWay, Converter={StaticResource isNull}}">
<Label
Text="{u:I18n NoTwoStepAvailable}"
2019-05-28 15:12:05 +02:00
Margin="10, 20, 10, 10"
2019-05-27 17:57:10 +02:00
HorizontalTextAlignment="Center" />
</StackLayout>
2019-05-28 16:12:51 +02:00
<Button Text="{u:I18n SendVerificationCodeAgain}"
IsVisible="{Binding EmailMethod}"
Clicked="ResendEmail_Clicked"
Margin="10, 0"></Button>
2019-05-27 17:57:10 +02:00
<Button Text="{u:I18n UseAnotherTwoStepMethod}"
2019-05-28 15:04:20 +02:00
Clicked="Methods_Clicked"
Margin="10, 0"></Button>
2019-05-27 17:57:10 +02:00
</StackLayout>
2019-05-24 03:19:45 +02:00
</ScrollView>
</pages:BaseContentPage>