From c29d902b8e520ee3c2c1b8a2a1e47ca7af3e18e6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 9 Feb 2017 21:43:03 -0500 Subject: [PATCH] Autofill service alert when adding new login for the first time and autofill isnt turned on. Added fi language to project. --- src/App/App.csproj | 9 +++++++++ src/App/Pages/Vault/VaultAddLoginPage.cs | 15 +++++++++++++-- src/App/Resources/AppResources.Designer.cs | 9 +++++++++ src/App/Resources/AppResources.fi.Designer.cs | 0 src/App/Resources/AppResources.resx | 3 +++ 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/App/Resources/AppResources.fi.Designer.cs diff --git a/src/App/App.csproj b/src/App/App.csproj index a3d4e6917..28d73e6f9 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -173,6 +173,11 @@ True AppResources.es.resx + + True + True + AppResources.fi.resx + True True @@ -226,6 +231,10 @@ PublicResXFileCodeGenerator AppResources.es.Designer.cs + + ResXFileCodeGenerator + AppResources.fi.Designer.cs + ResXFileCodeGenerator AppResources.fr.Designer.cs diff --git a/src/App/Pages/Vault/VaultAddLoginPage.cs b/src/App/Pages/Vault/VaultAddLoginPage.cs index 2651a16c3..5a64c5f59 100644 --- a/src/App/Pages/Vault/VaultAddLoginPage.cs +++ b/src/App/Pages/Vault/VaultAddLoginPage.cs @@ -23,6 +23,7 @@ namespace Bit.App.Pages private readonly IConnectivity _connectivity; private readonly IGoogleAnalyticsService _googleAnalyticsService; private readonly ISettings _settings; + private readonly IAppInfoService _appInfoService; private readonly string _defaultUri; private readonly string _defaultName; private readonly bool _fromAutofill; @@ -39,6 +40,7 @@ namespace Bit.App.Pages _connectivity = Resolver.Resolve(); _googleAnalyticsService = Resolver.Resolve(); _settings = Resolver.Resolve(); + _appInfoService = Resolver.Resolve(); Init(); } @@ -201,10 +203,19 @@ namespace Bit.App.Pages AlertNoConnection(); } - if(Device.OS == TargetPlatform.iOS && !_settings.GetValueOrDefault(AddedLoginAlertKey, false)) + if(!_fromAutofill && !_settings.GetValueOrDefault(AddedLoginAlertKey, false)) { _settings.AddOrUpdateValue(AddedLoginAlertKey, true); - DisplayAlert(AppResources.BitwardenAppExtension, AppResources.BitwardenAppExtensionAlert, AppResources.Ok); + if(Device.OS == TargetPlatform.iOS) + { + DisplayAlert(AppResources.BitwardenAppExtension, AppResources.BitwardenAppExtensionAlert, + AppResources.Ok); + } + else if(Device.OS == TargetPlatform.Android && !_appInfoService.AutofillServiceEnabled) + { + DisplayAlert(AppResources.BitwardenAutofillService, AppResources.BitwardenAutofillServiceAlert, + AppResources.Ok); + } } } diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index 5db48d75d..b549d374f 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -232,6 +232,15 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to The easiest way to add new logins to your vault is from the bitwarden Auto-fill Service. Learn more about using the bitwarden Auto-fill Service by navigating to the "Tools" screen.. + /// + public static string BitwardenAutofillServiceAlert { + get { + return ResourceManager.GetString("BitwardenAutofillServiceAlert", resourceCulture); + } + } + /// /// Looks up a localized string similar to Use the bitwarden accessibility service to auto-fill your logins.. /// diff --git a/src/App/Resources/AppResources.fi.Designer.cs b/src/App/Resources/AppResources.fi.Designer.cs new file mode 100644 index 000000000..e69de29bb diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index 13c78f377..d23dc4d51 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -792,4 +792,7 @@ Beta + + The easiest way to add new logins to your vault is from the bitwarden Auto-fill Service. Learn more about using the bitwarden Auto-fill Service by navigating to the "Tools" screen. + \ No newline at end of file