1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-06-27 10:44:49 +02:00

autofill tools page for ios 12

This commit is contained in:
Kyle Spearrin 2018-09-21 16:03:34 -04:00
parent fce2a7ba94
commit 89c2f62f11
11 changed files with 116 additions and 5 deletions

View 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 };
}
}
}

View File

@ -41,9 +41,18 @@ namespace Bit.App.Pages
if(Device.RuntimePlatform == Device.iOS)
{
ExtensionCell = new ToolsViewCell(AppResources.BitwardenAppExtension,
AppResources.BitwardenAppExtensionDescription, "upload.png");
section.Add(ExtensionCell);
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)
{
@ -152,14 +161,21 @@ namespace Bit.App.Pages
private void ExtensionCell_Tapped(object sender, EventArgs e)
{
Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsExtensionPage()));
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));
}

View File

@ -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 &gt; System &gt; Languages and input &gt; Advanced &gt; Autofill service..
/// </summary>

View File

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

BIN
src/iOS/Resources/magic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -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>