├── kotlinApp ├── settings.gradle ├── screenshots │ ├── big-icon.png │ ├── 1-purchase-screen.png │ ├── 2-fingerprint-dialog.png │ ├── 3-fingerprint-authenticated.png │ └── 4-new-fingerprint-enrolled.png ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── app │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_fp_40px.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_fp_40px.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_fp_40px.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_fp_40px.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ └── ic_fp_40px.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-nodpi │ │ │ │ └── android_robot.png │ │ │ ├── drawable │ │ │ │ ├── card.xml │ │ │ │ ├── ic_fingerprint_success.xml │ │ │ │ └── ic_fingerprint_error.xml │ │ │ ├── xml │ │ │ │ └── preferences.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── strings.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── layout │ │ │ │ ├── fingerprint_dialog_container.xml │ │ │ │ ├── fingerprint_dialog_content.xml │ │ │ │ ├── fingerprint_dialog_backup.xml │ │ │ │ └── activity_main.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── android │ │ │ │ └── fingerprintdialog │ │ │ │ ├── ActivityExtensions.kt │ │ │ │ ├── Constants.kt │ │ │ │ ├── SettingsFragment.kt │ │ │ │ ├── SettingsActivity.kt │ │ │ │ ├── FingerprintUiHelper.kt │ │ │ │ ├── FingerprintAuthenticationDialogFragment.kt │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── build.gradle ├── gradle.properties ├── packaging.yaml ├── .google │ └── packaging.yaml ├── gradlew.bat ├── README.md └── gradlew ├── settings.gradle ├── screenshots ├── big-icon.png ├── 1-purchase-screen.png ├── 2-fingerprint-dialog.png ├── 3-fingerprint-authenticated.png └── 4-new-fingerprint-enrolled.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── Application ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── tile.9.png │ │ │ └── ic_fp_40px.png │ │ ├── drawable-mdpi │ │ │ └── ic_fp_40px.png │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_fp_40px.png │ │ ├── drawable-xxhdpi │ │ │ └── ic_fp_40px.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-nodpi │ │ │ └── android_robot.png │ │ ├── drawable-xxxhdpi │ │ │ └── ic_fp_40px.png │ │ ├── values-v21 │ │ │ ├── base-colors.xml │ │ │ └── base-template-styles.xml │ │ ├── values-v11 │ │ │ └── template-styles.xml │ │ ├── values-sw600dp │ │ │ ├── template-dimens.xml │ │ │ └── template-styles.xml │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── base-strings.xml │ │ │ ├── template-dimens.xml │ │ │ ├── template-styles.xml │ │ │ └── strings.xml │ │ ├── drawable │ │ │ ├── card.xml │ │ │ ├── ic_fingerprint_success.xml │ │ │ └── ic_fingerprint_error.xml │ │ ├── xml │ │ │ └── preferences.xml │ │ ├── menu │ │ │ └── menu_main.xml │ │ └── layout │ │ │ ├── fingerprint_dialog_container.xml │ │ │ ├── fingerprint_dialog_content.xml │ │ │ ├── fingerprint_dialog_backup.xml │ │ │ └── activity_main.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── android │ │ │ └── fingerprintdialog │ │ │ ├── SettingsActivity.java │ │ │ ├── FingerprintUiHelper.java │ │ │ ├── FingerprintAuthenticationDialogFragment.java │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml └── build.gradle ├── README.md ├── .google └── packaging.yaml ├── CONTRIBUTING.md ├── gradlew.bat ├── gradlew └── LICENSE /kotlinApp/settings.gradle: -------------------------------------------------------------------------------- 1 | include 'app' 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'Application' 2 | -------------------------------------------------------------------------------- /screenshots/big-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/screenshots/big-icon.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /screenshots/1-purchase-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/screenshots/1-purchase-screen.png -------------------------------------------------------------------------------- /kotlinApp/screenshots/big-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/screenshots/big-icon.png -------------------------------------------------------------------------------- /screenshots/2-fingerprint-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/screenshots/2-fingerprint-dialog.png -------------------------------------------------------------------------------- /kotlinApp/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /kotlinApp/screenshots/1-purchase-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/screenshots/1-purchase-screen.png -------------------------------------------------------------------------------- /screenshots/3-fingerprint-authenticated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/screenshots/3-fingerprint-authenticated.png -------------------------------------------------------------------------------- /screenshots/4-new-fingerprint-enrolled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/screenshots/4-new-fingerprint-enrolled.png -------------------------------------------------------------------------------- /kotlinApp/screenshots/2-fingerprint-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/screenshots/2-fingerprint-dialog.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-hdpi/tile.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/drawable-hdpi/tile.9.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-hdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/drawable-hdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-mdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/drawable-mdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/screenshots/3-fingerprint-authenticated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/screenshots/3-fingerprint-authenticated.png -------------------------------------------------------------------------------- /kotlinApp/screenshots/4-new-fingerprint-enrolled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/screenshots/4-new-fingerprint-enrolled.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xhdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/drawable-xhdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxhdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/drawable-xxhdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/drawable-hdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/drawable-hdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/drawable-mdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/drawable-mdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-nodpi/android_robot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/drawable-nodpi/android_robot.png -------------------------------------------------------------------------------- /Application/src/main/res/drawable-xxxhdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/Application/src/main/res/drawable-xxxhdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/drawable-xhdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/drawable-xhdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/drawable-xxhdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/drawable-xxhdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/drawable-xxxhdpi/ic_fp_40px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/drawable-xxxhdpi/ic_fp_40px.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/drawable-nodpi/android_robot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-FingerprintDialog/master/kotlinApp/app/src/main/res/drawable-nodpi/android_robot.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | Android FingerprintDialog Sample 3 | ================================ 4 | 5 | This repo has been migrated to [github.com/android/security][1]. Please check that repo for future updates. Thank you! 6 | 7 | [1]: https://github.com/android/security 8 | 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Apr 27 11:28:32 JST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /kotlinApp/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Oct 16 16:01:34 PDT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /kotlinApp/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.1.60' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.0.0' 9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | jcenter() 17 | } 18 | } 19 | 20 | task clean(type: Delete) { 21 | delete rootProject.buildDir 22 | } -------------------------------------------------------------------------------- /Application/src/main/res/values-v21/base-colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /kotlinApp/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | 5 | android { 6 | compileSdkVersion 27 7 | defaultConfig { 8 | applicationId "com.example.android.fingerprintdialog" 9 | minSdkVersion 24 10 | targetSdkVersion 27 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation "com.android.support:appcompat-v7:27.0.0" 24 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 25 | } -------------------------------------------------------------------------------- /kotlinApp/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | 19 | -------------------------------------------------------------------------------- /Application/src/main/res/values-v11/template-styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /.google/packaging.yaml: -------------------------------------------------------------------------------- 1 | 2 | # GOOGLE SAMPLE PACKAGING DATA 3 | # 4 | # This file is used by Google as part of our samples packaging process. 5 | # End users may safely ignore this file. It has no relevance to other systems. 6 | --- 7 | status: PUBLISHED 8 | technologies: [Android] 9 | categories: [security] 10 | languages: [Java] 11 | solutions: [Mobile] 12 | github: android-FingerprintDialog 13 | level: INTERMEDIATE 14 | icon: screenshots/big-icon.png 15 | apiRefs: 16 | - android:android.hardware.fingerprint.FingerprintManager 17 | - android:android.hardware.fingerprint.FingerprintManager.AuthenticationCallback 18 | - android:android.hardware.fingerprint.FingerprintManager.CryptoObject 19 | - android:android.security.KeyGenParameterSpec 20 | - android:java.security.KeyStore 21 | - android:javax.crypto.Cipher 22 | - android:javax.crypto.KeyGenerator 23 | license: apache2 24 | -------------------------------------------------------------------------------- /kotlinApp/packaging.yaml: -------------------------------------------------------------------------------- 1 | 2 | # GOOGLE SAMPLE PACKAGING DATA 3 | # 4 | # This file is used by Google as part of our samples packaging process. 5 | # End users may safely ignore this file. It has no relevance to other systems. 6 | --- 7 | status: PUBLISHED 8 | technologies: [Android] 9 | categories: [security] 10 | languages: [Kotlin] 11 | solutions: [Mobile] 12 | github: android-FingerprintDialog 13 | level: INTERMEDIATE 14 | icon: screenshots/big-icon.png 15 | apiRefs: 16 | - android:android.hardware.fingerprint.FingerprintManager 17 | - android:android.hardware.fingerprint.FingerprintManager.AuthenticationCallback 18 | - android:android.hardware.fingerprint.FingerprintManager.CryptoObject 19 | - android:android.security.KeyGenParameterSpec 20 | - android:java.security.KeyStore 21 | - android:javax.crypto.Cipher 22 | - android:javax.crypto.KeyGenerator 23 | license: apache2 24 | -------------------------------------------------------------------------------- /kotlinApp/.google/packaging.yaml: -------------------------------------------------------------------------------- 1 | 2 | # GOOGLE SAMPLE PACKAGING DATA 3 | # 4 | # This file is used by Google as part of our samples packaging process. 5 | # End users may safely ignore this file. It has no relevance to other systems. 6 | --- 7 | status: PUBLISHED 8 | technologies: [Android] 9 | categories: [security] 10 | languages: [Kotlin] 11 | solutions: [Mobile] 12 | github: android-FingerprintDialog 13 | level: INTERMEDIATE 14 | icon: screenshots/big-icon.png 15 | apiRefs: 16 | - android:android.hardware.fingerprint.FingerprintManager 17 | - android:android.hardware.fingerprint.FingerprintManager.AuthenticationCallback 18 | - android:android.hardware.fingerprint.FingerprintManager.CryptoObject 19 | - android:android.security.KeyGenParameterSpec 20 | - android:java.security.KeyStore 21 | - android:javax.crypto.Cipher 22 | - android:javax.crypto.KeyGenerator 23 | license: apache2 24 | -------------------------------------------------------------------------------- /Application/src/main/res/values-sw600dp/template-dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | @dimen/margin_huge 22 | @dimen/margin_medium 23 | 24 | 25 | -------------------------------------------------------------------------------- /Application/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | #f4511e 19 | #42000000 20 | #009688 21 | 22 | -------------------------------------------------------------------------------- /Application/src/main/res/drawable/card.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 21 | 22 | 24 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/drawable/card.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 21 | 22 | 24 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/java/com/example/android/fingerprintdialog/ActivityExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.android.fingerprintdialog 18 | 19 | import android.support.v7.app.AppCompatActivity 20 | import android.widget.Toast 21 | 22 | fun AppCompatActivity.showToast(text: String) { 23 | Toast.makeText(this, text, Toast.LENGTH_LONG).show() 24 | } -------------------------------------------------------------------------------- /Application/src/main/res/values-sw600dp/template-styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/java/com/example/android/fingerprintdialog/Constants.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | @file:JvmName("Constants") 18 | 19 | package com.example.android.fingerprintdialog 20 | 21 | @JvmField val DEFAULT_KEY_NAME = "default_key" 22 | 23 | /** 24 | * Enumeration to indicate which authentication method the user is trying to authenticate with. 25 | */ 26 | enum class Stage { FINGERPRINT, NEW_FINGERPRINT_ENROLLED, PASSWORD } 27 | -------------------------------------------------------------------------------- /Application/src/main/res/xml/preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/xml/preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /Application/src/main/res/values/base-strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | FingerprintDialog 20 | 21 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/java/com/example/android/fingerprintdialog/SettingsFragment.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package com.example.android.fingerprintdialog 18 | 19 | import android.os.Bundle 20 | import android.preference.PreferenceFragment 21 | 22 | class SettingsFragment : PreferenceFragment() { 23 | 24 | override fun onCreate(savedInstanceState: Bundle?) { 25 | super.onCreate(savedInstanceState) 26 | addPreferencesFromResource(R.xml.preferences) 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | #f4511e 19 | #42000000 20 | #009688 21 | #009688 22 | #F4511E 23 | #FFFFFF 24 | #fefefe 25 | 26 | -------------------------------------------------------------------------------- /Application/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/java/com/example/android/fingerprintdialog/SettingsActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package com.example.android.fingerprintdialog 18 | 19 | import android.os.Bundle 20 | import android.support.v7.app.AppCompatActivity 21 | 22 | class SettingsActivity : AppCompatActivity() { 23 | 24 | override fun onCreate(savedInstanceState: Bundle?) { 25 | super.onCreate(savedInstanceState) 26 | fragmentManager.beginTransaction() 27 | .replace(android.R.id.content, SettingsFragment()) 28 | .commit() 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Application/src/main/res/values/template-dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 4dp 22 | 8dp 23 | 16dp 24 | 32dp 25 | 64dp 26 | 27 | 28 | 29 | @dimen/margin_medium 30 | @dimen/margin_medium 31 | 32 | 33 | -------------------------------------------------------------------------------- /Application/src/main/res/drawable/ic_fingerprint_success.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /Application/src/main/res/drawable/ic_fingerprint_error.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/drawable/ic_fingerprint_success.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/drawable/ic_fingerprint_error.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /Application/src/main/res/values/template-styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 34 | 35 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Application/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | buildscript { 3 | repositories { 4 | jcenter() 5 | google() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.0.1' 10 | } 11 | } 12 | 13 | apply plugin: 'com.android.application' 14 | 15 | repositories { 16 | jcenter() 17 | google() 18 | } 19 | 20 | dependencies { 21 | compile "com.android.support:support-v4:27.0.2" 22 | compile "com.android.support:support-v13:27.0.2" 23 | compile "com.android.support:cardview-v7:27.0.2" 24 | compile "com.android.support:appcompat-v7:27.0.2" 25 | } 26 | 27 | // The sample build uses multiple directories to 28 | // keep boilerplate and common code separate from 29 | // the main sample code. 30 | List dirs = [ 31 | 'main', // main sample code; look here for the interesting stuff. 32 | 'common', // components that are reused by multiple samples 33 | 'template'] // boilerplate code that is generated by the sample template process 34 | 35 | android { 36 | compileSdkVersion 26 37 | 38 | buildToolsVersion "27.0.2" 39 | 40 | defaultConfig { 41 | minSdkVersion 23 42 | targetSdkVersion 26 43 | } 44 | 45 | compileOptions { 46 | sourceCompatibility JavaVersion.VERSION_1_7 47 | targetCompatibility JavaVersion.VERSION_1_7 48 | } 49 | 50 | sourceSets { 51 | main { 52 | dirs.each { dir -> 53 | java.srcDirs "src/${dir}/java" 54 | res.srcDirs "src/${dir}/res" 55 | } 56 | } 57 | androidTest.setRoot('tests') 58 | androidTest.java.srcDirs = ['tests/src'] 59 | 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to become a contributor and submit your own code 2 | 3 | ## Contributor License Agreements 4 | 5 | We'd love to accept your sample apps and patches! Before we can take them, we 6 | have to jump a couple of legal hurdles. 7 | 8 | Please fill out either the individual or corporate Contributor License Agreement (CLA). 9 | 10 | * If you are an individual writing original source code and you're sure you 11 | own the intellectual property, then you'll need to sign an [individual CLA] 12 | (https://cla.developers.google.com). 13 | * If you work for a company that wants to allow you to contribute your work, 14 | then you'll need to sign a [corporate CLA] 15 | (https://cla.developers.google.com). 16 | 17 | Follow either of the two links above to access the appropriate CLA and 18 | instructions for how to sign and return it. Once we receive it, we'll be able to 19 | accept your pull requests. 20 | 21 | ## Contributing A Patch 22 | 23 | 1. Submit an issue describing your proposed change to the repo in question. 24 | 1. The repo owner will respond to your issue promptly. 25 | 1. If your proposed change is accepted, and you haven't already done so, sign a 26 | Contributor License Agreement (see details above). 27 | 1. Fork the desired repo, develop and test your code changes. 28 | 1. Ensure that your code adheres to the existing style in the sample to which 29 | you are contributing. Refer to the 30 | [Android Code Style Guide] 31 | (https://source.android.com/source/code-style.html) for the 32 | recommended coding standards for this organization. 33 | 1. Ensure that your code has an appropriate set of unit tests which all pass. 34 | 1. Submit a pull request. 35 | 36 | -------------------------------------------------------------------------------- /Application/src/main/java/com/example/android/fingerprintdialog/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package com.example.android.fingerprintdialog; 18 | 19 | import android.os.Bundle; 20 | import android.preference.PreferenceFragment; 21 | import android.support.v7.app.AppCompatActivity; 22 | 23 | public class SettingsActivity extends AppCompatActivity { 24 | 25 | @Override 26 | protected void onCreate(Bundle savedInstanceState) { 27 | super.onCreate(savedInstanceState); 28 | 29 | // Display the fragment as the main content. 30 | getFragmentManager().beginTransaction().replace(android.R.id.content, 31 | new SettingsFragment()).commit(); 32 | } 33 | 34 | /** 35 | * Fragment for settings. 36 | */ 37 | public static class SettingsFragment extends PreferenceFragment { 38 | 39 | @Override 40 | public void onCreate(Bundle savedInstanceState) { 41 | super.onCreate(savedInstanceState); 42 | addPreferencesFromResource(R.xml.preferences); 43 | } 44 | } 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 40dp 19 | 40.0 20 | 2dp 21 | 4dp 22 | 150dp 23 | 32dp 24 | 16dp 25 | 16dp 26 | 4dp 27 | 8dp 28 | 12dp 29 | 4dp 30 | 24dp 31 | 8dp 32 | 20dp 33 | 16dp 34 | 24dp 35 | -------------------------------------------------------------------------------- /Application/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 22 | 23 | 24 | 31 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 23 | 24 | 25 | 32 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Application/src/main/res/layout/fingerprint_dialog_container.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 45 | 46 | 52 |