Improved code by using a single call to setPositiveButton.
The positive button is always the same so there's no need to use two different calls, I just brought one outside the if statement. It was an artifact left from a previous test where I was changing both of the buttons.
This commit is contained in:
@@ -904,10 +904,9 @@ namespace keepass2android
|
||||
AlertDialog.Builder b = new AlertDialog.Builder(this);
|
||||
b.SetTitle(Resource.String.fingerprint_prefs);
|
||||
b.SetMessage(btn.Tag.ToString());
|
||||
|
||||
b.SetPositiveButton(Android.Resource.String.Ok, (o, eventArgs) => ((Dialog)o).Dismiss());
|
||||
if (_fingerprintDec != null)
|
||||
{
|
||||
b.SetPositiveButton(Android.Resource.String.Ok, (o, eventArgs) => ((Dialog)o).Dismiss());
|
||||
b.SetNegativeButton(Resource.String.disable_sensor, (senderAlert, alertArgs) =>
|
||||
{
|
||||
btn.SetImageResource(Resource.Drawable.ic_fingerprint_error);
|
||||
@@ -917,7 +916,6 @@ namespace keepass2android
|
||||
}
|
||||
else
|
||||
{
|
||||
b.SetPositiveButton(Android.Resource.String.Ok, (o, eventArgs) => ((Dialog)o).Dismiss());
|
||||
b.SetNegativeButton(Resource.String.enable_sensor, (senderAlert, alertArgs) =>
|
||||
{
|
||||
InitFingerprintUnlock();
|
||||
|
||||
@@ -181,10 +181,9 @@ namespace keepass2android
|
||||
AlertDialog.Builder b = new AlertDialog.Builder(this);
|
||||
b.SetTitle(Resource.String.fingerprint_prefs);
|
||||
b.SetMessage(btn.Tag.ToString());
|
||||
|
||||
b.SetPositiveButton(Android.Resource.String.Ok, (o, eventArgs) => ((Dialog)o).Dismiss());
|
||||
if (_fingerprintIdentifier != null)
|
||||
{
|
||||
b.SetPositiveButton(Android.Resource.String.Ok, (o, eventArgs) => ((Dialog)o).Dismiss());
|
||||
b.SetNegativeButton(Resource.String.disable_sensor, (senderAlert, alertArgs) =>
|
||||
{
|
||||
btn.SetImageResource(Resource.Drawable.ic_fingerprint_error);
|
||||
@@ -194,7 +193,6 @@ namespace keepass2android
|
||||
}
|
||||
else
|
||||
{
|
||||
b.SetPositiveButton(Android.Resource.String.Ok, (o, eventArgs) => ((Dialog)o).Dismiss());
|
||||
b.SetNegativeButton(Resource.String.enable_sensor, (senderAlert, alertArgs) =>
|
||||
{
|
||||
InitFingerprintUnlock();
|
||||
|
||||
Reference in New Issue
Block a user