Watch 1 Star 1 Fork 0

guoqi / FingerDemoKotlin

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
指纹识别Demo spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

FingerDemo

项目介绍

仿招商银行APP指纹识别弹框

效果图

1

验证是否有指纹识别模块

  • 权限 <uses-permission android:name="android.permission.USE_FINGERPRINT" />
private fun checkFingerModule(): Boolean {
        return try {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                (getSystemService(Context.FINGERPRINT_SERVICE) as FingerprintManager).isHardwareDetected
            } else {
                false
            }
        } catch (e: Exception) {
            false
        }
    }

##监听识别

mFingerListen = object : FingerprintManagerCompat.AuthenticationCallback(){
    //识别成功
    override fun onAuthenticationSucceeded(){}
    //识别识别
    override fun onAuthenticationFailed() {}
    //错误次数过多
    override fun onAuthenticationError(){}
}

Comments ( 0 )

You need to Sign in for post a comment

Help Search

Gitee_you_jiang_zheng_wen Zheng_wen_close