Answer the question
In order to leave comments, you need to log in
Fingerprint window stylization (biometrics)?
Gentlemen, but do not tell me how to style the fingerprint input window. Couldn't google anything.
I use the androidx.biometric 1.0.0-beta02 library
import androidx.biometric.BiometricPrompt;
....
final BiometricPrompt biometricPrompt = new BiometricPrompt(this, Executors.newSingleThreadExecutor(), new BiometricPrompt.AuthenticationCallback() {
@Override
public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) {
super.onAuthenticationError(errorCode, errString);
if (errorCode == BiometricPrompt.ERROR_NEGATIVE_BUTTON) {
// user clicked negative button
textView1.setText("Cancel");
} else {
textView1.setText("Error " + errorCode);
}
}
@Override
public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationResult result) {
super.onAuthenticationSucceeded(result);
textView1.setText("Success");
}
@Override
public void onAuthenticationFailed() {
super.onAuthenticationFailed();
textView1.setText("Fail");
}
});
final BiometricPrompt.PromptInfo promptInfo = new BiometricPrompt.PromptInfo.Builder()
.setTitle("Подтвердите свою личность")
.setDescription("Используя отпечатки пальцев для проверки личности")
.setNegativeButtonText("Отмена")
.build();
findViewById(R.id.button).setOnClickListener(
new View.OnClickListener() {
public void onClick(View v) {
biometricPrompt.authenticate(promptInfo);
}
}
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question