1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-22 11:13:49 +00: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

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