mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-21 11:25:56 +01:00
auto-fill service tools page
This commit is contained in:
parent
18ff80875a
commit
16058c5efb
@ -125,6 +125,7 @@
|
||||
<Compile Include="Pages\Settings\SettingsEditFolderPage.cs" />
|
||||
<Compile Include="Pages\Lock\LockFingerprintPage.cs" />
|
||||
<Compile Include="Pages\Settings\SettingsAboutPage.cs" />
|
||||
<Compile Include="Pages\Tools\ToolsAutofillServicePage.cs" />
|
||||
<Compile Include="Pages\Tools\ToolsExtensionPage.cs" />
|
||||
<Compile Include="Pages\Tools\ToolsPasswordGeneratorSettingsPage.cs" />
|
||||
<Compile Include="Pages\Tools\ToolsPasswordGeneratorPage.cs" />
|
||||
|
69
src/App/Pages/Tools/ToolsAutofillServicePage.cs
Normal file
69
src/App/Pages/Tools/ToolsAutofillServicePage.cs
Normal file
@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using Bit.App.Controls;
|
||||
using Xamarin.Forms;
|
||||
using XLabs.Ioc;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.App.Pages
|
||||
{
|
||||
public class ToolsAutofillServicePage : ExtendedContentPage
|
||||
{
|
||||
private readonly IGoogleAnalyticsService _googleAnalyticsService;
|
||||
|
||||
public ToolsAutofillServicePage()
|
||||
{
|
||||
_googleAnalyticsService = Resolver.Resolve<IGoogleAnalyticsService>();
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
var serviceLabel = new Label
|
||||
{
|
||||
Text = "Use the bitwarden accessibility service to auto-fill your logins across apps and the web.",
|
||||
VerticalOptions = LayoutOptions.Start,
|
||||
HorizontalOptions = LayoutOptions.Center,
|
||||
HorizontalTextAlignment = TextAlignment.Center,
|
||||
LineBreakMode = LineBreakMode.WordWrap,
|
||||
FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
|
||||
};
|
||||
|
||||
var comingSoonLabel = new Label
|
||||
{
|
||||
Text = "Coming Soon!",
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||
HorizontalOptions = LayoutOptions.Center,
|
||||
HorizontalTextAlignment = TextAlignment.Center,
|
||||
LineBreakMode = LineBreakMode.WordWrap,
|
||||
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
|
||||
TextColor = Color.Black
|
||||
};
|
||||
|
||||
var progressButton = new ExtendedButton
|
||||
{
|
||||
Text = "See Development Progress",
|
||||
Command = new Command(() =>
|
||||
{
|
||||
_googleAnalyticsService.TrackAppEvent("SeeProgress");
|
||||
Device.OpenUri(new Uri("https://github.com/bitwarden/mobile/issues/1"));
|
||||
}),
|
||||
VerticalOptions = LayoutOptions.End,
|
||||
HorizontalOptions = LayoutOptions.Fill,
|
||||
Style = (Style)Application.Current.Resources["btn-primary"]
|
||||
};
|
||||
|
||||
var stackLayout = new StackLayout
|
||||
{
|
||||
Children = { serviceLabel, comingSoonLabel, progressButton },
|
||||
Orientation = StackOrientation.Vertical,
|
||||
Spacing = 10,
|
||||
Padding = new Thickness(20, 30),
|
||||
VerticalOptions = LayoutOptions.FillAndExpand
|
||||
};
|
||||
|
||||
Title = "Auto-fill Service";
|
||||
Content = new ScrollView { Content = stackLayout };
|
||||
}
|
||||
}
|
||||
}
|
@ -24,24 +24,38 @@ namespace Bit.App.Pages
|
||||
|
||||
public void Init()
|
||||
{
|
||||
var generatorCell = new ToolsViewCell("Password Generator", "Automatically generate strong, unique passwords for your logins.", "refresh");
|
||||
var generatorCell = new ToolsViewCell("Password Generator",
|
||||
"Automatically generate strong, unique passwords for your logins.", "refresh");
|
||||
generatorCell.Tapped += GeneratorCell_Tapped;
|
||||
var webCell = new ToolsViewCell("bitwarden Web Vault", "Manage your logins from any web browser with the bitwarden web vault.", "globe");
|
||||
var webCell = new ToolsViewCell("bitwarden Web Vault",
|
||||
"Manage your logins from any web browser with the bitwarden web vault.", "globe");
|
||||
webCell.Tapped += WebCell_Tapped;
|
||||
var importCell = new ToolsViewCell("Import Logins", "Quickly bulk import your logins from other password management apps.", "cloudup");
|
||||
var importCell = new ToolsViewCell("Import Logins",
|
||||
"Quickly bulk import your logins from other password management apps.", "cloudup");
|
||||
importCell.Tapped += ImportCell_Tapped;
|
||||
|
||||
var section = new TableSection { generatorCell };
|
||||
|
||||
if(Device.OS == TargetPlatform.iOS)
|
||||
{
|
||||
var extensionCell = new ToolsViewCell("bitwarden App Extension", "Use bitwarden in Safari and other apps to auto-fill your logins.", "upload");
|
||||
var extensionCell = new ToolsViewCell("bitwarden App Extension",
|
||||
"Use bitwarden in Safari and other apps to auto-fill your logins.", "upload");
|
||||
extensionCell.Tapped += (object sender, EventArgs e) =>
|
||||
{
|
||||
Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsExtensionPage()));
|
||||
};
|
||||
section.Add(extensionCell);
|
||||
}
|
||||
else
|
||||
{
|
||||
var autofillServiceCell = new ToolsViewCell("bitwarden Auto-fill Service",
|
||||
"Use the bitwarden accessibility service to auto-fill your logins.", "upload");
|
||||
autofillServiceCell.Tapped += (object sender, EventArgs e) =>
|
||||
{
|
||||
Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsAutofillServicePage()));
|
||||
};
|
||||
section.Add(autofillServiceCell);
|
||||
}
|
||||
|
||||
section.Add(webCell);
|
||||
section.Add(importCell);
|
||||
@ -80,7 +94,9 @@ namespace Bit.App.Pages
|
||||
|
||||
private async void ImportCell_Tapped(object sender, EventArgs e)
|
||||
{
|
||||
if(!await _userDialogs.ConfirmAsync("You can bulk import logins from the bitwarden.com web vault. Do you want to visit the website now?", null, AppResources.Yes, AppResources.Cancel))
|
||||
if(!await _userDialogs.ConfirmAsync(
|
||||
"You can bulk import logins from the bitwarden.com web vault. Do you want to visit the website now?",
|
||||
null, AppResources.Yes, AppResources.Cancel))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user