diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index 7d938bd12..ba87adba9 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -990,5 +990,20 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Android/Resources/Resource.Designer.cs b/src/Android/Resources/Resource.Designer.cs index 81cb43c92..0b02de05c 100644 --- a/src/Android/Resources/Resource.Designer.cs +++ b/src/Android/Resources/Resource.Designer.cs @@ -4685,26 +4685,26 @@ namespace Bit.Android // aapt resource value: 0x7f02005b public const int avd_hide_password = 2130837595; - // aapt resource value: 0x7f02015c - public const int avd_hide_password_1 = 2130837852; - // aapt resource value: 0x7f02015d - public const int avd_hide_password_2 = 2130837853; + public const int avd_hide_password_1 = 2130837853; // aapt resource value: 0x7f02015e - public const int avd_hide_password_3 = 2130837854; + public const int avd_hide_password_2 = 2130837854; + + // aapt resource value: 0x7f02015f + public const int avd_hide_password_3 = 2130837855; // aapt resource value: 0x7f02005c public const int avd_show_password = 2130837596; - // aapt resource value: 0x7f02015f - public const int avd_show_password_1 = 2130837855; - // aapt resource value: 0x7f020160 - public const int avd_show_password_2 = 2130837856; + public const int avd_show_password_1 = 2130837856; // aapt resource value: 0x7f020161 - public const int avd_show_password_3 = 2130837857; + public const int avd_show_password_2 = 2130837857; + + // aapt resource value: 0x7f020162 + public const int avd_show_password_3 = 2130837858; // aapt resource value: 0x7f02005d public const int bottom_nav_bg = 2130837597; @@ -5411,11 +5411,11 @@ namespace Bit.Android // aapt resource value: 0x7f020147 public const int notification_sm = 2130837831; - // aapt resource value: 0x7f02015a - public const int notification_template_icon_bg = 2130837850; - // aapt resource value: 0x7f02015b - public const int notification_template_icon_low_bg = 2130837851; + public const int notification_template_icon_bg = 2130837851; + + // aapt resource value: 0x7f02015c + public const int notification_template_icon_low_bg = 2130837852; // aapt resource value: 0x7f020148 public const int notification_tile_bg = 2130837832; @@ -5466,10 +5466,13 @@ namespace Bit.Android public const int upload = 2130837847; // aapt resource value: 0x7f020158 - public const int user = 2130837848; + public const int upload2 = 2130837848; // aapt resource value: 0x7f020159 - public const int yubikey = 2130837849; + public const int user = 2130837849; + + // aapt resource value: 0x7f02015a + public const int yubikey = 2130837850; static Drawable() { @@ -6506,17 +6509,17 @@ namespace Bit.Android // aapt resource value: 0x7f0a0051 public const int ApplicationName = 2131361873; - // aapt resource value: 0x7f0a00b2 - public const int AutoFillServiceDescription = 2131361970; + // aapt resource value: 0x7f0a00ab + public const int AutoFillServiceDescription = 2131361963; - // aapt resource value: 0x7f0a00b1 - public const int AutoFillServiceSummary = 2131361969; + // aapt resource value: 0x7f0a00aa + public const int AutoFillServiceSummary = 2131361962; // aapt resource value: 0x7f0a0050 public const int Hello = 2131361872; - // aapt resource value: 0x7f0a00b3 - public const int MyVault = 2131361971; + // aapt resource value: 0x7f0a00ac + public const int MyVault = 2131361964; // aapt resource value: 0x7f0a0027 public const int abc_action_bar_home_description = 2131361831; @@ -6671,27 +6674,6 @@ namespace Bit.Android // aapt resource value: 0x7f0a000f public const int common_signin_button_text_long = 2131361807; - // aapt resource value: 0x7f0a00ac - public const int default_web_client_id = 2131361964; - - // aapt resource value: 0x7f0a00ad - public const int firebase_database_url = 2131361965; - - // aapt resource value: 0x7f0a00aa - public const int gcm_defaultSenderId = 2131361962; - - // aapt resource value: 0x7f0a00ae - public const int google_api_key = 2131361966; - - // aapt resource value: 0x7f0a00ab - public const int google_app_id = 2131361963; - - // aapt resource value: 0x7f0a00af - public const int google_crash_reporting_api_key = 2131361967; - - // aapt resource value: 0x7f0a00b0 - public const int google_storage_bucket = 2131361968; - // aapt resource value: 0x7f0a0052 public const int hockeyapp_crash_dialog_app_name_fallback = 2131361874; diff --git a/src/Android/Resources/drawable-hdpi/upload2.png b/src/Android/Resources/drawable-hdpi/upload2.png new file mode 100644 index 000000000..f115db1a5 Binary files /dev/null and b/src/Android/Resources/drawable-hdpi/upload2.png differ diff --git a/src/Android/Resources/drawable-xhdpi/upload2.png b/src/Android/Resources/drawable-xhdpi/upload2.png new file mode 100644 index 000000000..ad7b0da13 Binary files /dev/null and b/src/Android/Resources/drawable-xhdpi/upload2.png differ diff --git a/src/Android/Resources/drawable-xxhdpi/upload2.png b/src/Android/Resources/drawable-xxhdpi/upload2.png new file mode 100644 index 000000000..225ac20ce Binary files /dev/null and b/src/Android/Resources/drawable-xxhdpi/upload2.png differ diff --git a/src/Android/Resources/drawable-xxxhdpi/upload2.png b/src/Android/Resources/drawable-xxxhdpi/upload2.png new file mode 100644 index 000000000..07a9a0fa9 Binary files /dev/null and b/src/Android/Resources/drawable-xxxhdpi/upload2.png differ diff --git a/src/Android/Resources/drawable/upload2.png b/src/Android/Resources/drawable/upload2.png new file mode 100644 index 000000000..45a46d667 Binary files /dev/null and b/src/Android/Resources/drawable/upload2.png differ diff --git a/src/App/Pages/Tools/ToolsAutofillServicePage.cs b/src/App/Pages/Tools/ToolsAutofillServicePage.cs index 2ba19616e..e9008856a 100644 --- a/src/App/Pages/Tools/ToolsAutofillServicePage.cs +++ b/src/App/Pages/Tools/ToolsAutofillServicePage.cs @@ -104,7 +104,7 @@ namespace Bit.App.Pages DisabledStackLayout = new StackLayout { - Children = { BuildServiceLabel(), statusDisabledLabel, enableImage, goButton, BuildAccessibilityButton() }, + Children = { BuildServiceLabel(), statusDisabledLabel, enableImage, goButton }, Orientation = StackOrientation.Vertical, Spacing = 20, Padding = new Thickness(20, 30), @@ -113,7 +113,7 @@ namespace Bit.App.Pages EnabledStackLayout = new StackLayout { - Children = { BuildServiceLabel(), statusEnabledLabel, useImage, BuildAccessibilityButton() }, + Children = { BuildServiceLabel(), statusEnabledLabel, useImage }, Orientation = StackOrientation.Vertical, Spacing = 20, Padding = new Thickness(20, 30), @@ -166,22 +166,5 @@ namespace Bit.App.Pages FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)) }; } - - private ExtendedButton BuildAccessibilityButton() - { - return new ExtendedButton - { - Text = AppResources.AutofillAccessibilityService, - Command = new Command(async () => - { - await Navigation.PushAsync(new ToolsAccessibilityServicePage()); - }), - VerticalOptions = LayoutOptions.End, - HorizontalOptions = LayoutOptions.Fill, - Style = (Style)Application.Current.Resources["btn-primaryAccent"], - Uppercase = false, - BackgroundColor = Color.Transparent - }; - } } } diff --git a/src/App/Pages/Tools/ToolsPage.cs b/src/App/Pages/Tools/ToolsPage.cs index 0611b4202..8174568d2 100644 --- a/src/App/Pages/Tools/ToolsPage.cs +++ b/src/App/Pages/Tools/ToolsPage.cs @@ -29,6 +29,7 @@ namespace Bit.App.Pages public ToolsViewCell ImportCell { get; set; } public ToolsViewCell ExtensionCell { get; set; } public ToolsViewCell AutofillCell { get; set; } + public ToolsViewCell AccessibilityCell { get; set; } public void Init() { @@ -46,11 +47,17 @@ namespace Bit.App.Pages } if(Device.RuntimePlatform == Device.Android) { - var desc = _deviceInfoService.AutofillServiceSupported ? - AppResources.BitwardenAutofillServiceDescription : - AppResources.BitwardenAutofillAccessibilityServiceDescription; - AutofillCell = new ToolsViewCell(AppResources.BitwardenAutofillService, desc, "upload.png"); - section.Add(AutofillCell); + var accessibilityDesc = AppResources.BitwardenAutofillAccessibilityServiceDescription; + if(_deviceInfoService.AutofillServiceSupported) + { + AutofillCell = new ToolsViewCell(AppResources.AutofillService, + AppResources.BitwardenAutofillServiceDescription, "upload2.png"); + section.Add(AutofillCell); + accessibilityDesc += (" " + AppResources.BitwardenAutofillAccessibilityServiceDescription2); + } + AccessibilityCell = new ToolsViewCell(AppResources.AutofillAccessibilityService, + accessibilityDesc, "upload.png"); + section.Add(AccessibilityCell); } section.Add(WebCell); @@ -96,6 +103,10 @@ namespace Bit.App.Pages { AutofillCell.Tapped += AutofillCell_Tapped; } + if(AccessibilityCell != null) + { + AccessibilityCell.Tapped += AccessibilityCell_Tapped; + } } protected override void OnDisappearing() @@ -112,7 +123,10 @@ namespace Bit.App.Pages { AutofillCell.Tapped -= AutofillCell_Tapped; } - + if(AccessibilityCell != null) + { + AccessibilityCell.Tapped -= AccessibilityCell_Tapped; + } } protected override bool OnBackButtonPressed() @@ -128,14 +142,12 @@ namespace Bit.App.Pages private void AutofillCell_Tapped(object sender, EventArgs e) { - if(_deviceInfoService.AutofillServiceSupported) - { - Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsAutofillServicePage())); - } - else - { - Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsAccessibilityServicePage())); - } + Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsAutofillServicePage())); + } + + private void AccessibilityCell_Tapped(object sender, EventArgs e) + { + Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsAccessibilityServicePage())); } private void ExtensionCell_Tapped(object sender, EventArgs e) diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index 53c6458ed..3783bf0ed 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -492,6 +492,15 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to The accessibility service may be helpful to use when apps do not support the standard auto-fill service.. + /// + public static string BitwardenAutofillAccessibilityServiceDescription2 { + get { + return ResourceManager.GetString("BitwardenAutofillAccessibilityServiceDescription2", resourceCulture); + } + } + /// /// 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.. /// diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index b01266121..70edde364 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -1302,4 +1302,7 @@ To continue, hold your YubiKey NEO against the back of the device. + + The accessibility service may be helpful to use when apps do not support the standard auto-fill service. + \ No newline at end of file