mirror of
https://github.com/bitwarden/mobile
synced 2025-12-30 15:13:24 +00:00
set pin from settings
This commit is contained in:
@@ -10,6 +10,8 @@ using Android.OS;
|
||||
using Android.Provider;
|
||||
using Android.Support.V4.App;
|
||||
using Android.Support.V4.Content;
|
||||
using Android.Text;
|
||||
using Android.Text.Method;
|
||||
using Android.Webkit;
|
||||
using Android.Widget;
|
||||
using Bit.App.Abstractions;
|
||||
@@ -218,7 +220,8 @@ namespace Bit.Droid.Services
|
||||
}
|
||||
|
||||
public Task<string> DisplayPromptAync(string title = null, string description = null,
|
||||
string text = null, string okButtonText = null, string cancelButtonText = null)
|
||||
string text = null, string okButtonText = null, string cancelButtonText = null,
|
||||
bool numericKeyboard = false)
|
||||
{
|
||||
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
||||
if(activity == null)
|
||||
@@ -231,12 +234,19 @@ namespace Bit.Droid.Services
|
||||
alertBuilder.SetMessage(description);
|
||||
var input = new EditText(activity)
|
||||
{
|
||||
InputType = Android.Text.InputTypes.ClassText
|
||||
InputType = InputTypes.ClassText
|
||||
};
|
||||
if(text == null)
|
||||
{
|
||||
text = string.Empty;
|
||||
}
|
||||
if(numericKeyboard)
|
||||
{
|
||||
input.InputType = InputTypes.ClassNumber | InputTypes.NumberFlagDecimal | InputTypes.NumberFlagSigned;
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
input.KeyListener = DigitsKeyListener.GetInstance(false, false);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
}
|
||||
|
||||
input.Text = text;
|
||||
input.SetSelection(text.Length);
|
||||
|
||||
Reference in New Issue
Block a user