1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-23 11:45:38 +01:00

autofocus prompt input

This commit is contained in:
Kyle Spearrin 2019-06-10 23:18:34 -04:00
parent 2376489f51
commit 31a77a6e19
2 changed files with 7 additions and 2 deletions

View File

@ -229,7 +229,7 @@ namespace Bit.Droid.Services
public Task<string> 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;
}

View File

@ -16,7 +16,8 @@ namespace Bit.App.Abstractions
Task ClearCacheAsync();
Task SelectFileAsync();
Task<string> 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();