1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-24 16:38:22 +01:00

shows both accessibility and autofill from tools

This commit is contained in:
Kyle Spearrin 2018-06-18 13:59:56 -04:00
parent d359547dab
commit 72d1421f1d
11 changed files with 80 additions and 76 deletions

View File

@ -990,5 +990,20 @@
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxxhdpi\icon.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\upload2.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-hdpi\upload2.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xhdpi\upload2.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxhdpi\upload2.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable-xxxhdpi\upload2.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

View File

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

View File

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

View File

@ -492,6 +492,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// 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..
/// </summary>
public static string BitwardenAutofillAccessibilityServiceDescription2 {
get {
return ResourceManager.GetString("BitwardenAutofillAccessibilityServiceDescription2", 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

@ -1302,4 +1302,7 @@
<data name="YubiKeyInstructionIos" xml:space="preserve">
<value>To continue, hold your YubiKey NEO against the back of the device.</value>
</data>
<data name="BitwardenAutofillAccessibilityServiceDescription2" xml:space="preserve">
<value>The accessibility service may be helpful to use when apps do not support the standard auto-fill service.</value>
</data>
</root>