show a toast if fingerprint authentication fails

This commit is contained in:
tibbi 2017-09-27 19:55:19 +02:00
parent 705812c8bf
commit c00cf61626
2 changed files with 6 additions and 1 deletions

View file

@ -8,7 +8,9 @@ import android.widget.RelativeLayout
import com.github.ajalt.reprint.core.AuthenticationFailureReason
import com.github.ajalt.reprint.core.AuthenticationListener
import com.github.ajalt.reprint.core.Reprint
import com.simplemobiletools.commons.R
import com.simplemobiletools.commons.extensions.baseConfig
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.helpers.PROTECTION_FINGERPRINT
import com.simplemobiletools.commons.interfaces.HashListener
@ -37,7 +39,9 @@ class FingerprintTab(context: Context, attrs: AttributeSet) : RelativeLayout(con
}
override fun onFailure(failureReason: AuthenticationFailureReason, fatal: Boolean, errorMessage: CharSequence?, moduleTag: Int, errorCode: Int) {
if (failureReason == AuthenticationFailureReason.AUTHENTICATION_FAILED) {
context.toast(R.string.authentication_failed)
}
}
})
} else {

View file

@ -168,6 +168,7 @@
<string name="fingerprint">Fingerprint</string>
<string name="add_fingerprint">Add fingerprint</string>
<string name="place_finger">Please place your finger on the fingerprint sensor</string>
<string name="authentication_failed">Authentication failed</string>
<string name="protection_setup_successfully">Password setup successfully. Please reinstall the app in case you forget it.</string>
<!-- Times -->