bitwarden-android/src/App/Pages/Settings/OptionsPage.xaml.cs

49 lines
1.6 KiB
C#
Raw Normal View History

using Bit.App.Abstractions;
using Bit.App.Resources;
using Bit.Core.Utilities;
2019-05-29 14:11:15 -04:00
using Xamarin.Forms;
2019-05-29 09:08:47 -04:00
namespace Bit.App.Pages
{
public partial class OptionsPage : BaseContentPage
{
private readonly IDeviceActionService _deviceActionService;
2019-05-29 09:08:47 -04:00
private readonly OptionsPageViewModel _vm;
public OptionsPage()
{
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
2019-05-29 09:08:47 -04:00
InitializeComponent();
_vm = BindingContext as OptionsPageViewModel;
_vm.Page = this;
2019-05-29 14:11:15 -04:00
_themePicker.ItemDisplayBinding = new Binding("Value");
_uriMatchPicker.ItemDisplayBinding = new Binding("Value");
_clearClipboardPicker.ItemDisplayBinding = new Binding("Value");
2019-05-29 23:02:30 -04:00
if(Device.RuntimePlatform == Device.Android)
{
_vm.ShowAndroidAccessibilitySettings = true;
_vm.ShowAndroidAutofillSettings = _deviceActionService.SupportsAutofillService();
2019-05-29 23:02:30 -04:00
_themeDescriptionLabel.Text = string.Concat(_themeDescriptionLabel.Text, " ",
AppResources.RestartIsRequired);
}
2019-05-29 09:08:47 -04:00
}
2019-05-29 09:36:57 -04:00
protected async override void OnAppearing()
2019-05-29 09:08:47 -04:00
{
base.OnAppearing();
2019-05-29 09:36:57 -04:00
await _vm.InitAsync();
2019-05-29 09:08:47 -04:00
}
2019-06-03 10:45:27 -04:00
protected async override void OnDisappearing()
{
base.OnDisappearing();
await _vm.UpdateAutofillBlacklistedUris();
}
private async void BlacklistedUrisEditor_Unfocused(object sender, FocusEventArgs e)
{
await _vm.UpdateAutofillBlacklistedUris();
}
2019-05-29 09:08:47 -04:00
}
}