gpt4 book ai didi

android - 如何在 Android 设备中使用 native 指纹扫描仪 UI?

转载 作者:行者123 更新时间:2023-11-29 22:55:22 25 4
gpt4 key购买 nike

要求:如何为屏幕传感器 android 设备(如三星 s10 plus)使用 native 指纹扫描仪 UI。

指纹认证的工作流程是可以理解的。但是是否有任何方法或库可用于获取 native 指纹扫描仪 UI?

最佳答案

解决方案是创建一个自定义 UI 并替换它,以便它对所有设备都是相同的 UI

public class MyFingerPrintDialog extends BottomSheetDialog implements 
View.OnClickListener {

private Context context;

private Button btnCancel;
private TextView itemTitle;

private BiometricCallback biometricCallback;

public MyFingerPrintDialog(@NonNull Context context) {
super(context, R.style.BottomSheetDialogTheme);
this.context = context.getApplicationContext();
setDialogView();
}

public MyFingerPrintDialog(@NonNull Context context, BiometricCallback biometricCallback) {
super(context, R.style.BottomSheetDialogTheme);
this.context = context.getApplicationContext();
this.biometricCallback = biometricCallback;
setDialogView();
}

public MyFingerPrintDialog(@NonNull Context context, int theme) {
super(context, theme);
}

protected MyFingerPrintDialog(@NonNull Context context, boolean cancelable, OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
}

private void setDialogView() {
View bottomSheetView = getLayoutInflater().inflate(R.layout.view_bottom_sheet, null);
setContentView(bottomSheetView);

btnCancel = findViewById(R.id.btn_cancel);
btnCancel.setOnClickListener(this);

itemTitle = findViewById(R.id.item_title);
}

生物识别回调

public interface BiometricCallback {

void onAuthenticationFailed();

void onAuthenticationCancelled();

void onAuthenticationSuccessful();
}

关于android - 如何在 Android 设备中使用 native 指纹扫描仪 UI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57472412/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com