From 31a77a6e199ffa176b3da2e0b9e9e4041826d20d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 10 Jun 2019 23:18:34 -0400 Subject: [PATCH] autofocus prompt input --- src/Android/Services/DeviceActionService.cs | 6 +++++- src/App/Abstractions/IDeviceActionService.cs | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Android/Services/DeviceActionService.cs b/src/Android/Services/DeviceActionService.cs index 05d0a3657..3f9bb70c4 100644 --- a/src/Android/Services/DeviceActionService.cs +++ b/src/Android/Services/DeviceActionService.cs @@ -229,7 +229,7 @@ namespace Bit.Droid.Services public Task DisplayPromptAync(string title = null, string description = null, string text = null, string okButtonText = null, string cancelButtonText = null, - bool numericKeyboard = false) + bool numericKeyboard = false, bool autofocus = true) { var activity = (MainActivity)CrossCurrentActivity.Current.Activity; if(activity == null) @@ -278,6 +278,10 @@ namespace Bit.Droid.Services var alert = alertBuilder.Create(); alert.Window.SetSoftInputMode(Android.Views.SoftInput.StateVisible); alert.Show(); + if(autofocus) + { + input.RequestFocus(); + } return result.Task; } diff --git a/src/App/Abstractions/IDeviceActionService.cs b/src/App/Abstractions/IDeviceActionService.cs index 6e0126ee5..6f033c7fc 100644 --- a/src/App/Abstractions/IDeviceActionService.cs +++ b/src/App/Abstractions/IDeviceActionService.cs @@ -16,7 +16,8 @@ namespace Bit.App.Abstractions Task ClearCacheAsync(); Task SelectFileAsync(); Task DisplayPromptAync(string title = null, string description = null, string text = null, - string okButtonText = null, string cancelButtonText = null, bool numericKeyboard = false); + string okButtonText = null, string cancelButtonText = null, bool numericKeyboard = false, + bool autofocus = true); void RateApp(); bool SupportsFaceId(); bool SupportsNfc();