mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +00:00
* PM-2320 Added new view for block autofill URIs on Android * PM-2320 Fix formatting * PM-2320 Improved validations on block autofill uris * PM-2320 Improved autofill block uris placeholder colors on different themes
54 lines
1.9 KiB
C#
54 lines
1.9 KiB
C#
using Bit.Core.Abstractions;
|
|
using Bit.Core.Utilities;
|
|
using Xamarin.Forms;
|
|
using Xamarin.Forms.PlatformConfiguration;
|
|
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
|
|
|
|
namespace Bit.App.Pages
|
|
{
|
|
public partial class OptionsPage : BaseContentPage
|
|
{
|
|
private readonly IAutofillHandler _autofillHandler;
|
|
private readonly OptionsPageViewModel _vm;
|
|
|
|
public OptionsPage()
|
|
{
|
|
_autofillHandler = ServiceContainer.Resolve<IAutofillHandler>();
|
|
InitializeComponent();
|
|
_vm = BindingContext as OptionsPageViewModel;
|
|
_vm.Page = this;
|
|
_themePicker.ItemDisplayBinding = new Binding("Value");
|
|
_autoDarkThemePicker.ItemDisplayBinding = new Binding("Value");
|
|
_uriMatchPicker.ItemDisplayBinding = new Binding("Value");
|
|
_clearClipboardPicker.ItemDisplayBinding = new Binding("Value");
|
|
if (Device.RuntimePlatform == Device.Android)
|
|
{
|
|
ToolbarItems.RemoveAt(0);
|
|
_vm.ShowAndroidAutofillSettings = _autofillHandler.SupportsAutofillService();
|
|
}
|
|
else
|
|
{
|
|
_themePicker.On<iOS>().SetUpdateMode(UpdateMode.WhenFinished);
|
|
_autoDarkThemePicker.On<iOS>().SetUpdateMode(UpdateMode.WhenFinished);
|
|
_uriMatchPicker.On<iOS>().SetUpdateMode(UpdateMode.WhenFinished);
|
|
_clearClipboardPicker.On<iOS>().SetUpdateMode(UpdateMode.WhenFinished);
|
|
_languagePicker.On<iOS>().SetUpdateMode(UpdateMode.WhenFinished);
|
|
}
|
|
}
|
|
|
|
protected async override void OnAppearing()
|
|
{
|
|
base.OnAppearing();
|
|
await _vm.InitAsync();
|
|
}
|
|
|
|
private async void Close_Clicked(object sender, System.EventArgs e)
|
|
{
|
|
if (DoOnce())
|
|
{
|
|
await Navigation.PopModalAsync();
|
|
}
|
|
}
|
|
}
|
|
}
|