use bio strings for native android bio

This commit is contained in:
Kyle Spearrin 2019-10-23 09:24:34 -04:00
parent 4b989b01e9
commit f951fea555
6 changed files with 48 additions and 6 deletions

View file

@ -378,7 +378,7 @@ namespace Bit.Droid.Services
{
if(string.IsNullOrWhiteSpace(text))
{
text = AppResources.BiometricDirection;
text = AppResources.BiometricsDirection;
}
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;

View file

@ -127,8 +127,18 @@ namespace Bit.App.Pages
if(FingerprintLock)
{
var supportsFace = await _deviceActionService.SupportsFaceBiometricAsync();
FingerprintButtonText = supportsFace ? AppResources.UseFaceIDToUnlock :
AppResources.UseFingerprintToUnlock;
if(Device.RuntimePlatform == Device.iOS && supportsFace)
{
FingerprintButtonText = AppResources.UseFaceIDToUnlock;
}
else if(Device.RuntimePlatform == Device.Android && _deviceActionService.UseNativeBiometric())
{
FingerprintButtonText = AppResources.UseBiometricsToUnlock;
}
else
{
FingerprintButtonText = AppResources.UseFingerprintToUnlock;
}
if(autoPromptFingerprint)
{
var tasks = Task.Run(async () =>

View file

@ -145,6 +145,10 @@ namespace Bit.App.Pages
var supportsFace = await _deviceActionService.SupportsFaceBiometricAsync();
fingerprintName = supportsFace ? AppResources.FaceID : AppResources.TouchID;
}
else if(Device.RuntimePlatform == Device.Android && _deviceActionService.UseNativeBiometric())
{
fingerprintName = AppResources.Biometrics;
}
if(item.Name == string.Format(AppResources.UnlockWith, fingerprintName))
{
await _vm.UpdateFingerprintAsync();

View file

@ -331,6 +331,10 @@ namespace Bit.App.Pages
fingerprintName = _deviceActionService.SupportsFaceBiometric() ? AppResources.FaceID :
AppResources.TouchID;
}
else if(Device.RuntimePlatform == Device.Android && _deviceActionService.UseNativeBiometric())
{
fingerprintName = AppResources.Biometrics;
}
var item = new SettingsPageListItem
{
Name = string.Format(AppResources.UnlockWith, fingerprintName),

View file

@ -537,12 +537,21 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Biometrics.
/// </summary>
public static string Biometrics {
get {
return ResourceManager.GetString("Biometrics", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use biometrics to verify..
/// </summary>
public static string BiometricDirection {
public static string BiometricsDirection {
get {
return ResourceManager.GetString("BiometricDirection", resourceCulture);
return ResourceManager.GetString("BiometricsDirection", resourceCulture);
}
}
@ -3831,6 +3840,15 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Use Biometrics To Unlock.
/// </summary>
public static string UseBiometricsToUnlock {
get {
return ResourceManager.GetString("UseBiometricsToUnlock", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Use Face ID To Unlock.
/// </summary>

View file

@ -1578,7 +1578,13 @@
<data name="LoginExpired" xml:space="preserve">
<value>Your login session has expired.</value>
</data>
<data name="BiometricDirection" xml:space="preserve">
<data name="BiometricsDirection" xml:space="preserve">
<value>Use biometrics to verify.</value>
</data>
<data name="Biometrics" xml:space="preserve">
<value>Biometrics</value>
</data>
<data name="UseBiometricsToUnlock" xml:space="preserve">
<value>Use Biometrics To Unlock</value>
</data>
</root>