mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-27 12:26:31 +01:00
autofill tools page for ios 12
This commit is contained in:
parent
fce2a7ba94
commit
89c2f62f11
65
src/App/Pages/Tools/ToolsAutofillPage.cs
Normal file
65
src/App/Pages/Tools/ToolsAutofillPage.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using Bit.App.Controls;
|
||||
using Xamarin.Forms;
|
||||
using Bit.App.Resources;
|
||||
using FFImageLoading.Forms;
|
||||
|
||||
namespace Bit.App.Pages
|
||||
{
|
||||
public class ToolsAutofillPage : ExtendedContentPage
|
||||
{
|
||||
public ToolsAutofillPage()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
var notStartedLabel = new Label
|
||||
{
|
||||
Text = AppResources.ExtensionInstantAccess,
|
||||
VerticalOptions = LayoutOptions.Start,
|
||||
HorizontalOptions = LayoutOptions.Center,
|
||||
HorizontalTextAlignment = TextAlignment.Center,
|
||||
LineBreakMode = LineBreakMode.WordWrap,
|
||||
FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label))
|
||||
};
|
||||
|
||||
var notStartedSublabel = new Label
|
||||
{
|
||||
Text = AppResources.ExtensionTurnOn,
|
||||
VerticalOptions = LayoutOptions.Start,
|
||||
HorizontalOptions = LayoutOptions.Center,
|
||||
HorizontalTextAlignment = TextAlignment.Center,
|
||||
LineBreakMode = LineBreakMode.WordWrap
|
||||
};
|
||||
|
||||
var keyboardImge = new CachedImage
|
||||
{
|
||||
Source = "autofill-kb.png",
|
||||
VerticalOptions = LayoutOptions.CenterAndExpand,
|
||||
HorizontalOptions = LayoutOptions.Center,
|
||||
Margin = new Thickness(0, -10, 0, 0),
|
||||
WidthRequest = 290,
|
||||
HeightRequest = 252
|
||||
};
|
||||
|
||||
var stackLayout = new StackLayout
|
||||
{
|
||||
Orientation = StackOrientation.Vertical,
|
||||
Spacing = 20,
|
||||
Padding = new Thickness(20, 20, 20, 30),
|
||||
Children = { notStartedLabel, notStartedSublabel, keyboardImge },
|
||||
VerticalOptions = LayoutOptions.FillAndExpand
|
||||
};
|
||||
|
||||
if(Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Close));
|
||||
}
|
||||
|
||||
Title = AppResources.Autofill;
|
||||
Content = new ScrollView { Content = stackLayout };
|
||||
}
|
||||
}
|
||||
}
|
@ -40,11 +40,20 @@ namespace Bit.App.Pages
|
||||
var section = new TableSection(Helpers.GetEmptyTableSectionTitle());
|
||||
|
||||
if(Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
if(_deviceInfoService.Version < 12)
|
||||
{
|
||||
ExtensionCell = new ToolsViewCell(AppResources.BitwardenAppExtension,
|
||||
AppResources.BitwardenAppExtensionDescription, "upload.png");
|
||||
section.Add(ExtensionCell);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExtensionCell = new ToolsViewCell(AppResources.Autofill,
|
||||
AppResources.BitwardenAutofillDescription, "magic.png");
|
||||
section.Add(ExtensionCell);
|
||||
}
|
||||
}
|
||||
if(Device.RuntimePlatform == Device.Android)
|
||||
{
|
||||
var accessibilityDesc = AppResources.BitwardenAutofillAccessibilityServiceDescription;
|
||||
@ -151,15 +160,22 @@ namespace Bit.App.Pages
|
||||
}
|
||||
|
||||
private void ExtensionCell_Tapped(object sender, EventArgs e)
|
||||
{
|
||||
if(_deviceInfoService.Version < 12)
|
||||
{
|
||||
Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsExtensionPage()));
|
||||
}
|
||||
else
|
||||
{
|
||||
Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsAutofillPage()));
|
||||
}
|
||||
}
|
||||
|
||||
private void WebCell_Tapped(object sender, EventArgs e)
|
||||
{
|
||||
_googleAnalyticsService.TrackAppEvent("OpenedTool", "Web");
|
||||
var appSettings = Resolver.Resolve<IAppSettingsService>();
|
||||
if (!string.IsNullOrWhiteSpace(appSettings.BaseUrl))
|
||||
if(!string.IsNullOrWhiteSpace(appSettings.BaseUrl))
|
||||
{
|
||||
Device.OpenUri(new Uri(appSettings.BaseUrl));
|
||||
}
|
||||
|
9
src/App/Resources/AppResources.Designer.cs
generated
9
src/App/Resources/AppResources.Designer.cs
generated
@ -528,6 +528,15 @@ namespace Bit.App.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to AutoFill logins directly from your keyboard when logging into websites and other apps..
|
||||
/// </summary>
|
||||
public static string BitwardenAutofillDescription {
|
||||
get {
|
||||
return ResourceManager.GetString("BitwardenAutofillDescription", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to We were unable to automatically open the Android autofill settings menu for you. You can navigate to the autofill settings menu manually from Android Settings > System > Languages and input > Advanced > Autofill service..
|
||||
/// </summary>
|
||||
|
@ -1325,4 +1325,7 @@
|
||||
<data name="AutofillSetup2" xml:space="preserve">
|
||||
<value>We recommend disabling any other AutoFill apps under Settings if you do not plan to use them.</value>
|
||||
</data>
|
||||
<data name="BitwardenAutofillDescription" xml:space="preserve">
|
||||
<value>AutoFill logins directly from your keyboard when logging into websites and other apps.</value>
|
||||
</data>
|
||||
</root>
|
BIN
src/iOS/Resources/autofill-kb.png
Normal file
BIN
src/iOS/Resources/autofill-kb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 28 KiB |
BIN
src/iOS/Resources/autofill-kb@2x.png
Normal file
BIN
src/iOS/Resources/autofill-kb@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 83 KiB |
BIN
src/iOS/Resources/autofill-kb@3x.png
Normal file
BIN
src/iOS/Resources/autofill-kb@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 136 KiB |
BIN
src/iOS/Resources/magic.png
Normal file
BIN
src/iOS/Resources/magic.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 778 B |
BIN
src/iOS/Resources/magic@2x.png
Normal file
BIN
src/iOS/Resources/magic@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
src/iOS/Resources/magic@3x.png
Normal file
BIN
src/iOS/Resources/magic@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
@ -735,5 +735,23 @@
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\cog_alt%403x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\autofill-kb.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\autofill-kb%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\autofill-kb%403x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\magic.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\magic%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\magic%403x.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user