├── .github └── ISSUE_TEMPLATE │ └── config.yml ├── .gitignore ├── BasicSample ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── regula │ │ │ └── facesamplekotlin │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ ├── layer.json │ │ │ └── notification.json │ │ ├── java │ │ │ └── com │ │ │ │ └── regula │ │ │ │ └── facesamplekotlin │ │ │ │ ├── CategoryAdapter.kt │ │ │ │ ├── CategoryDataProvider.kt │ │ │ │ ├── DetectFacesActivity.kt │ │ │ │ ├── FaceImageQualityActivity.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── MatchFacesActivity.kt │ │ │ │ ├── category │ │ │ │ ├── CategoryItem.kt │ │ │ │ ├── HeaderItem.kt │ │ │ │ └── ICategoryItem.kt │ │ │ │ ├── detection │ │ │ │ ├── FaceImageResultItem.kt │ │ │ │ ├── FaceQualityResultAdapter.kt │ │ │ │ ├── FaceQualityResultItem.kt │ │ │ │ ├── GroupQualityResultItem.kt │ │ │ │ ├── IFaceQualityItem.kt │ │ │ │ └── fragment │ │ │ │ │ ├── FaceImageQualityFragment.kt │ │ │ │ │ └── FaceImageQualityResultFragment.kt │ │ │ │ ├── items │ │ │ │ ├── basic │ │ │ │ │ ├── DetectFacesRequestItem.kt │ │ │ │ │ ├── FaceCaptureDefaultItem.kt │ │ │ │ │ ├── FaceImageQualityRequestItem.kt │ │ │ │ │ ├── LivenessDefaultItem.kt │ │ │ │ │ └── MatchFacesRequestItem.kt │ │ │ │ ├── configuration │ │ │ │ │ ├── FaceCaptureConfigurationItem.kt │ │ │ │ │ └── LivenessScreenConfigurationItem.kt │ │ │ │ ├── customization │ │ │ │ │ ├── HideCloseButtonItem.kt │ │ │ │ │ ├── HideFlashButtonItem.kt │ │ │ │ │ ├── HideNotificationViewItem.kt │ │ │ │ │ ├── LivenessNotificationItem.kt │ │ │ │ │ ├── NotificationViewPositionItem.kt │ │ │ │ │ └── UICustomizationItem.kt │ │ │ │ ├── features │ │ │ │ │ ├── FaceCaptureCameraPositionItem.kt │ │ │ │ │ ├── FaceSdkDeinitItem.kt │ │ │ │ │ ├── FaceSdkInitItem.kt │ │ │ │ │ ├── LivenessAttemptsCountItem.kt │ │ │ │ │ ├── LivenessDisableStepItem.kt │ │ │ │ │ ├── LivenessLandscapePortraitItem.kt │ │ │ │ │ └── LivenessSessionIdItem.kt │ │ │ │ ├── fragments │ │ │ │ │ ├── HideNotificationViewFragment.kt │ │ │ │ │ └── NotificationViewPositionFragment.kt │ │ │ │ └── other │ │ │ │ │ ├── LocalizationItem.kt │ │ │ │ │ ├── NetworkInterceptorItem.kt │ │ │ │ │ └── VideoCompletionItem.kt │ │ │ │ └── util │ │ │ │ ├── FaceCaptureResponseUtil.kt │ │ │ │ ├── LivenessResponseUtil.kt │ │ │ │ ├── RandomColors.kt │ │ │ │ └── ResizeTransformation.kt │ │ └── res │ │ │ ├── drawable-nodpi │ │ │ ├── detect_face1.jpeg │ │ │ ├── detect_face2.jpeg │ │ │ ├── detect_face3.jpeg │ │ │ ├── detect_face4.jpeg │ │ │ ├── face_image_quality1.jpeg │ │ │ ├── face_image_quality2.jpeg │ │ │ ├── face_image_quality3.jpeg │ │ │ └── face_image_quality4.jpeg │ │ │ ├── drawable-v24 │ │ │ ├── ic_launcher_foreground.xml │ │ │ └── rounded_button_corner.xml │ │ │ ├── drawable │ │ │ ├── button_drawable.xml │ │ │ ├── button_drawable_pressed.xml │ │ │ ├── close_button.xml │ │ │ ├── custom_button_drawable.xml │ │ │ ├── done_button.xml │ │ │ ├── flash_light_off.png │ │ │ ├── flash_light_on.png │ │ │ ├── hind_view_background.xml │ │ │ ├── ic_emotions.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── ic_launcher_foreground.xml │ │ │ ├── ic_light.xml │ │ │ ├── ic_looks_1.xml │ │ │ ├── ic_looks_2.xml │ │ │ ├── ic_looks_3.xml │ │ │ ├── notification_background_white.xml │ │ │ ├── notification_view_background_dark.xml │ │ │ ├── notification_view_background_white.xml │ │ │ ├── rounded_background.xml │ │ │ └── swap_button.xml │ │ │ ├── font │ │ │ ├── roboto.ttf │ │ │ └── roboto_italic.ttf │ │ │ ├── layout │ │ │ ├── activity_detect_faces.xml │ │ │ ├── activity_face_quality.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_match_faces.xml │ │ │ ├── custom_liveness_processing_layout.xml │ │ │ ├── custom_liveness_retry_layout.xml │ │ │ ├── custom_liveness_verified.xml │ │ │ ├── fragment_face_quality.xml │ │ │ ├── fragment_face_quality_result.xml │ │ │ ├── fragment_image.xml │ │ │ ├── item_element.xml │ │ │ ├── item_header_image.xml │ │ │ ├── item_header_title.xml │ │ │ └── reg_toolbar_buttons_custom.xml │ │ │ ├── menu │ │ │ └── menu.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values-night │ │ │ ├── colors.xml │ │ │ └── themes.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── regula │ │ └── facesamplekotlin │ │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── BasicSampleJava ├── .gitignore ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── regula │ │ │ └── facesample │ │ │ └── ExampleInstrumentedTest.java │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ └── layer.json │ │ ├── java │ │ │ └── com │ │ │ │ └── regula │ │ │ │ └── facesample │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MatchFacesActivity.java │ │ │ │ ├── adapter │ │ │ │ └── CategoryAdapter.java │ │ │ │ ├── data │ │ │ │ └── CategoryDataProvider.java │ │ │ │ ├── items │ │ │ │ ├── CategoryItem.java │ │ │ │ ├── ICategoryItem.java │ │ │ │ ├── basic │ │ │ │ │ ├── FaceCaptureDefaultItem.java │ │ │ │ │ ├── LivenessDefaultItem.java │ │ │ │ │ └── MatchFacesRequestItem.java │ │ │ │ ├── customization │ │ │ │ │ ├── AdvancedCustomItem.java │ │ │ │ │ ├── BasicCustomItem.java │ │ │ │ │ ├── ButtonsColorItem.java │ │ │ │ │ ├── FlashButtonItem.java │ │ │ │ │ ├── HideCloseButtonItem.java │ │ │ │ │ ├── HideFlashButtonItem.java │ │ │ │ │ ├── HideNotificationViewItem.java │ │ │ │ │ ├── LivenessProcessingCustomItem.java │ │ │ │ │ ├── NotificationViewItem.java │ │ │ │ │ ├── NotificationViewPositionItem.java │ │ │ │ │ ├── OverlayCustomItem.java │ │ │ │ │ ├── SwapButtonItem.java │ │ │ │ │ ├── UICustomizationItem.java │ │ │ │ │ └── fragment │ │ │ │ │ │ ├── AdvancedCustomUiFragment.java │ │ │ │ │ │ ├── BasicCustomUiFragment.java │ │ │ │ │ │ ├── ButtonsColorFragment.java │ │ │ │ │ │ ├── FlashButtonFragment.java │ │ │ │ │ │ ├── HideNotificationViewFragment.java │ │ │ │ │ │ ├── LivenessProcessingCustomFragment.java │ │ │ │ │ │ ├── NotificationViewFragment.java │ │ │ │ │ │ ├── NotificationViewPositionFragment.java │ │ │ │ │ │ └── SwapButtonFragment.java │ │ │ │ ├── features │ │ │ │ │ ├── FaceCaptureCameraPositionItem.java │ │ │ │ │ ├── FaceSdkDeinitItem.java │ │ │ │ │ ├── FaceSdkInitItem.java │ │ │ │ │ ├── LivenessAttemptsCountItem.java │ │ │ │ │ ├── LivenessDisableStepItem.java │ │ │ │ │ └── LivenessSessionIdItem.java │ │ │ │ └── other │ │ │ │ │ ├── LocalizationItem.java │ │ │ │ │ ├── NetworkInterceptorItem.java │ │ │ │ │ └── VideoCompletionItem.java │ │ │ │ └── util │ │ │ │ ├── FaceCaptureResponseUtil.java │ │ │ │ └── LivenessResponseUtil.java │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── close_button.xml │ │ │ ├── done_button.xml │ │ │ ├── flash_light_off.png │ │ │ ├── flash_light_on.png │ │ │ ├── hind_view_background.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── notification_view_background_dark.xml │ │ │ ├── notification_view_background_white.xml │ │ │ ├── rounded_background.xml │ │ │ ├── rounded_button_corner.xml │ │ │ └── swap_button.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── activity_match_faces.xml │ │ │ ├── custom_hint_view_appearance.xml │ │ │ ├── custom_liveness_processing.xml │ │ │ ├── custom_liveness_processing_layout.xml │ │ │ ├── custom_liveness_retry_layout.xml │ │ │ ├── custom_liveness_verified.xml │ │ │ ├── custom_toolbar_appearance.xml │ │ │ ├── item_element.xml │ │ │ ├── item_header_title.xml │ │ │ └── reg_toolbar_buttons_custom.xml │ │ │ ├── menu │ │ │ └── menu.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values-night │ │ │ ├── colors.xml │ │ │ └── themes.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── regula │ │ └── facesample │ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── CertificatePinningSample ├── README.md ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── regula │ │ │ └── facesamplekotlin │ │ │ └── MainActivity.kt │ │ └── res │ │ ├── drawable-v24 │ │ ├── ic_launcher_foreground.xml │ │ └── rounded_button_corner.xml │ │ ├── drawable │ │ ├── ic_launcher_background.xml │ │ └── ic_launcher_foreground.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-night │ │ ├── colors.xml │ │ └── themes.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ └── network_security_config.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── FaceSearchSample ├── .gitignore ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── regula │ │ │ └── facepersonsearch │ │ │ ├── Common.java │ │ │ ├── CreateActivity.java │ │ │ ├── FaceSearchApp.java │ │ │ ├── GroupsActivity.java │ │ │ ├── ItemPositionAdapter.java │ │ │ ├── ItemsAdapter.java │ │ │ ├── PersonImageFragment.java │ │ │ ├── PersonImageRecyclerViewAdapter.java │ │ │ ├── PersonsActivity.java │ │ │ └── SearchActivity.java │ │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── add_btn.xml │ │ ├── ic_launcher_background.xml │ │ └── search_btn.xml │ │ ├── layout │ │ ├── activity_create.xml │ │ ├── activity_items_list.xml │ │ ├── activity_search.xml │ │ ├── fragment_item.xml │ │ ├── fragment_item_list.xml │ │ ├── group_create_update.xml │ │ └── image_vh.xml │ │ ├── menu │ │ ├── menu.xml │ │ └── menu_reset.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-anydpi-v33 │ │ └── ic_launcher.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── themes.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── OfflineMatchFaceSample ├── .gitignore ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── regula │ │ │ └── facesamplekotlin │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── regula │ │ │ │ └── facesamplekotlin │ │ │ │ ├── FileUtil.kt │ │ │ │ ├── MatchFacesActivity.kt │ │ │ │ └── ResizeTransformation.kt │ │ └── res │ │ │ ├── drawable-v24 │ │ │ ├── ic_launcher_foreground.xml │ │ │ └── rounded_button_corner.xml │ │ │ ├── drawable │ │ │ ├── ic_launcher_background.xml │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── layout │ │ │ ├── activity_match_faces.xml │ │ │ └── fragment_image.xml │ │ │ ├── menu │ │ │ └── menu.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values-night │ │ │ ├── colors.xml │ │ │ └── themes.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── regula │ │ └── facesamplekotlin │ │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle └── README.md /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Submit a request 4 | url: https://support.regulaforensics.com/hc/requests/new?utm_source=github 5 | about: Submit any requests to Regula Support Team 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .idea/ 3 | .gradle 4 | /local.properties 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | .cxx 10 | local.properties 11 | -------------------------------------------------------------------------------- /BasicSample/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /BasicSample/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'kotlin-android' 4 | } 5 | 6 | android { 7 | compileSdk 32 8 | 9 | defaultConfig { 10 | applicationId "com.regula.facesamplekotlin" 11 | minSdk 21 12 | targetSdk 32 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | 26 | buildFeatures { 27 | viewBinding true 28 | } 29 | } 30 | 31 | dependencies { 32 | testImplementation 'junit:junit:4.+' 33 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' 34 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 35 | 36 | implementation 'androidx.appcompat:appcompat:1.4.1' 37 | implementation 'com.google.android.material:material:1.5.0' 38 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3' 39 | implementation "androidx.recyclerview:recyclerview:1.2.1" 40 | implementation "androidx.core:core-ktx:1.7.0" 41 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 42 | 43 | implementation ('com.regula.face:api:6.3.+@aar'){ 44 | transitive = true 45 | } 46 | 47 | implementation ('com.regula.face.core:basic:6.3.+@aar') 48 | } 49 | -------------------------------------------------------------------------------- /BasicSample/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /BasicSample/app/src/androidTest/java/com/regula/facesamplekotlin/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.regula.facesamplekotlin", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 16 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/assets/notification.json: -------------------------------------------------------------------------------- 1 | { 2 | "objects": [ 3 | { 4 | "label": { 5 | "text": "", 6 | "fontStyle": "normal", 7 | "fontColor": "#FF000000", 8 | "background": "#FFFF8080", 9 | "fontSize": 16, 10 | "fontName": "Arial", 11 | "alignment": "center", 12 | "borderRadius": 5, 13 | "padding": { 14 | "start": 8, 15 | "end": 8, 16 | "top": 8, 17 | "bottom": 8 18 | }, 19 | "margin": { 20 | "top": 20 21 | }, 22 | "position": { 23 | "h": 1 24 | } 25 | } 26 | } 27 | ], 28 | "version": "1.0" 29 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/FaceImageQualityActivity.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.regula.facesamplekotlin.detection.fragment.FaceImageQualityFragment 6 | import com.regula.facesdk.detection.response.DetectFacesResponse 7 | 8 | class FaceImageQualityActivity : AppCompatActivity() { 9 | 10 | lateinit var response: DetectFacesResponse 11 | 12 | override fun onCreate(savedInstanceState: Bundle?) { 13 | super.onCreate(savedInstanceState) 14 | setContentView(R.layout.activity_face_quality) 15 | if (savedInstanceState == null) { 16 | supportFragmentManager.beginTransaction() 17 | .replace(R.id.container, FaceImageQualityFragment()) 18 | .commitNow() 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin 2 | 3 | import android.os.Bundle 4 | import android.util.Log 5 | import android.widget.Toast 6 | import androidx.appcompat.app.AppCompatActivity 7 | import androidx.recyclerview.widget.LinearLayoutManager 8 | import com.regula.facesamplekotlin.CategoryDataProvider.Companion.getCategoryData 9 | import com.regula.facesamplekotlin.databinding.ActivityMainBinding 10 | import com.regula.facesdk.FaceSDK 11 | import com.regula.facesdk.exception.InitException 12 | 13 | class MainActivity : AppCompatActivity() { 14 | 15 | @Transient 16 | private lateinit var binding: ActivityMainBinding 17 | 18 | override fun onCreate(savedInstanceState: Bundle?) { 19 | super.onCreate(savedInstanceState) 20 | 21 | binding = ActivityMainBinding.inflate(layoutInflater) 22 | setContentView(binding.root) 23 | 24 | binding.recyclerView.layoutManager = LinearLayoutManager(this) 25 | binding.recyclerView.adapter = CategoryAdapter(this, getCategoryData()) 26 | 27 | FaceSDK.Instance().initialize(this) { status: Boolean, e: InitException? -> 28 | if (!status) { 29 | Toast.makeText( 30 | this@MainActivity, 31 | "Init finished with error: " + if (e != null) e.message else "", 32 | Toast.LENGTH_LONG 33 | ).show() 34 | return@initialize 35 | } 36 | Log.d("MainActivity", "FaceSDK init completed successfully") 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/category/CategoryItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.category 2 | 3 | import android.content.Context 4 | 5 | 6 | abstract class CategoryItem : ICategoryItem { 7 | abstract fun onItemSelected(context: Context) 8 | abstract val description: String 9 | 10 | override fun isHeader(): Boolean { 11 | return false 12 | } 13 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/category/HeaderItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.category 2 | 3 | class HeaderItem(override val title: String) : ICategoryItem { 4 | 5 | override fun isHeader(): Boolean { 6 | return true 7 | } 8 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/category/ICategoryItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.category 2 | 3 | interface ICategoryItem { 4 | val title: String 5 | fun isHeader(): Boolean 6 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/detection/FaceImageResultItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.detection 2 | 3 | 4 | class FaceImageResultItem(private val image: String?) : 5 | IFaceQualityItem { 6 | 7 | override fun getTitle(): String { 8 | return "" 9 | } 10 | 11 | override fun getImage(): String? { 12 | return image 13 | } 14 | 15 | override fun isHeader(): Boolean { 16 | return false 17 | } 18 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/detection/FaceQualityResultItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.detection 2 | 3 | import com.regula.facesdk.detection.response.ImageQualityResult 4 | import com.regula.facesdk.enums.ImageQualityResultStatus 5 | 6 | 7 | class FaceQualityResultItem(private val result : ImageQualityResult?, private val image: String?) : 8 | IFaceQualityItem { 9 | 10 | 11 | constructor(result: ImageQualityResult) : this( 12 | result, 13 | null 14 | ) 15 | 16 | override fun getTitle(): String { 17 | var status = "➖" 18 | if(result?.status == ImageQualityResultStatus.IMAGE_QUALITY_RESULT_STATUS_TRUE) { 19 | status = "✅ " 20 | } else if(result?.status == ImageQualityResultStatus.IMAGE_QUALITY_RESULT_STATUS_FALSE){ 21 | status = "❌ " 22 | } 23 | return status + result?.name?.value 24 | } 25 | 26 | fun getDescription(): String { 27 | val value = "Value: " + result?.value 28 | val expectedRange = "\nExpected range: [" + result?.range?.min + " : " + result?.range?.max + "]" 29 | return value + expectedRange 30 | } 31 | 32 | override fun getImage(): String? { 33 | return image 34 | } 35 | 36 | override fun isHeader(): Boolean { 37 | return false 38 | } 39 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/detection/GroupQualityResultItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.detection 2 | 3 | import com.regula.facesdk.enums.ImageQualityGroupName 4 | 5 | class GroupQualityResultItem( 6 | val id: Int, 7 | val compliantCount: Int, 8 | val totalCount: Int, 9 | ) : IFaceQualityItem { 10 | 11 | override fun getImage(): String? { 12 | return null 13 | } 14 | 15 | override fun getTitle(): String { 16 | var status = " ✅ " 17 | if (totalCount != compliantCount) { 18 | status = " ❌ " 19 | } 20 | 21 | return getGroupName() + status + "$compliantCount/$totalCount" 22 | } 23 | 24 | override fun isHeader(): Boolean { 25 | return true 26 | } 27 | 28 | private fun getGroupName(): String { 29 | when (id) { 30 | ImageQualityGroupName.IMAGE_CHARACTERISTICS.value -> return "Image characteristics" 31 | ImageQualityGroupName.HEAD_SIZE_AND_POSITION.value -> return "Head size and position" 32 | ImageQualityGroupName.FACE_QUALITY.value -> return "Face quality" 33 | ImageQualityGroupName.EYES_CHARACTERISTICS.value -> return "Eyes characteristics" 34 | ImageQualityGroupName.SHADOWS_AND_LIGHTNING.value -> return "Shadows and lightning" 35 | ImageQualityGroupName.POSE_AND_EXPRESSION.value -> return "Pose and expression" 36 | ImageQualityGroupName.HEAD_OCCLUSION.value -> return "Head occlusion" 37 | ImageQualityGroupName.BACKGROUND.value -> return "Background" 38 | } 39 | return "unknown" 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/detection/IFaceQualityItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.detection 2 | 3 | interface IFaceQualityItem { 4 | fun getImage(): String? 5 | fun getTitle(): String 6 | fun isHeader(): Boolean 7 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/DetectFacesRequestItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.basic 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import com.regula.facesamplekotlin.DetectFacesActivity 6 | import com.regula.facesamplekotlin.category.CategoryItem 7 | 8 | class DetectFacesRequestItem : CategoryItem() { 9 | 10 | override fun onItemSelected(context: Context) { 11 | val intent = Intent(context, DetectFacesActivity::class.java) 12 | context.startActivity(intent) 13 | } 14 | 15 | override val title: String 16 | get() = "Face Detection" 17 | 18 | override val description: String 19 | get() = "Analyzes images, recognizes faces in them, and returns cropped and aligned portraits of the detected people" 20 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/FaceCaptureDefaultItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.basic 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil 6 | import com.regula.facesdk.FaceSDK 7 | 8 | class FaceCaptureDefaultItem : CategoryItem() { 9 | 10 | override fun onItemSelected(context: Context) { 11 | FaceSDK.Instance().presentFaceCaptureActivity(context) { response -> 12 | // ... check response.image for capture result 13 | FaceCaptureResponseUtil.response(context, response) 14 | } 15 | } 16 | 17 | override val title: String 18 | get() = "FaceCapture" 19 | 20 | override val description: String 21 | get() = "Automatically captures face photo" 22 | 23 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/FaceImageQualityRequestItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.basic 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import com.regula.facesamplekotlin.FaceImageQualityActivity 6 | import com.regula.facesamplekotlin.category.CategoryItem 7 | 8 | class FaceImageQualityRequestItem : CategoryItem() { 9 | 10 | override fun onItemSelected(context: Context) { 11 | val intent = Intent(context, FaceImageQualityActivity::class.java) 12 | context.startActivity(intent) 13 | } 14 | 15 | override val title: String 16 | get() = "Face Image Quality" 17 | 18 | override val description: String 19 | get() = "Checks whether a photo portrait meets certain standards" 20 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/LivenessDefaultItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.basic 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.util.LivenessResponseUtil 6 | import com.regula.facesdk.FaceSDK 7 | import com.regula.facesdk.model.results.LivenessResponse 8 | 9 | class LivenessDefaultItem : CategoryItem() { 10 | 11 | override fun onItemSelected(context: Context) { 12 | FaceSDK.Instance().startLiveness(context) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) } 13 | } 14 | 15 | override val title: String 16 | get() = "Liveness" 17 | 18 | override val description: String 19 | get() = "Detects if a person on camera is alive" 20 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/basic/MatchFacesRequestItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.basic 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import com.regula.facesamplekotlin.MatchFacesActivity 6 | import com.regula.facesamplekotlin.category.CategoryItem 7 | 8 | class MatchFacesRequestItem : CategoryItem() { 9 | 10 | override fun onItemSelected(context: Context) { 11 | val intent = Intent(context, MatchFacesActivity::class.java) 12 | context.startActivity(intent) 13 | } 14 | 15 | override val title: String 16 | get() = "MatchFacesRequest" 17 | 18 | override val description: String 19 | get() = "Checks the likelihood that two faces belong to the same person" 20 | 21 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/customization/HideCloseButtonItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.customization 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil 6 | import com.regula.facesdk.FaceSDK 7 | import com.regula.facesdk.configuration.FaceCaptureConfiguration 8 | import com.regula.facesdk.model.results.FaceCaptureResponse 9 | 10 | class HideCloseButtonItem : CategoryItem() { 11 | 12 | override fun onItemSelected(context: Context) { 13 | val configuration = FaceCaptureConfiguration.Builder() 14 | .setCloseButtonEnabled(false) 15 | .build() 16 | FaceSDK.Instance().presentFaceCaptureActivity( 17 | context, configuration 18 | ) { faceCaptureResponse: FaceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse) } 19 | } 20 | 21 | override val title: String 22 | get() = "Hide close button" 23 | 24 | override val description: String 25 | get() = "Hide close button using default UI" 26 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/customization/HideFlashButtonItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.customization 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil 6 | import com.regula.facesdk.FaceSDK 7 | import com.regula.facesdk.configuration.FaceCaptureConfiguration 8 | import com.regula.facesdk.model.results.FaceCaptureResponse 9 | 10 | class HideFlashButtonItem : CategoryItem() { 11 | 12 | override fun onItemSelected(context: Context) { 13 | val configuration = FaceCaptureConfiguration.Builder() 14 | .setTorchButtonEnabled(false) 15 | .setCameraId(0) 16 | .build() 17 | FaceSDK.Instance().presentFaceCaptureActivity( 18 | context, configuration 19 | ) { faceCaptureResponse: FaceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse) } 20 | } 21 | 22 | override val title: String 23 | get() = "Hide flash button" 24 | 25 | override val description: String 26 | get() = "Hide flash button using default UI" 27 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/customization/HideNotificationViewItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.customization 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.items.fragments.HideNotificationViewFragment 6 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil 7 | import com.regula.facesdk.FaceSDK 8 | import com.regula.facesdk.configuration.FaceCaptureConfiguration 9 | import com.regula.facesdk.model.results.FaceCaptureResponse 10 | 11 | class HideNotificationViewItem : CategoryItem() { 12 | 13 | override fun onItemSelected(context: Context) { 14 | val configuration = FaceCaptureConfiguration.Builder() 15 | .setCameraSwitchEnabled(true) 16 | .registerUiFragmentClass(HideNotificationViewFragment::class.java) 17 | .build() 18 | FaceSDK.Instance().presentFaceCaptureActivity( 19 | context, configuration 20 | ) { faceCaptureResponse: FaceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse) } 21 | } 22 | 23 | override val title: String 24 | get() = "Hide notification text view" 25 | 26 | override val description: String 27 | get() = "Hide notification text view using default UI fragment" 28 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/customization/NotificationViewPositionItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.customization 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.items.fragments.NotificationViewPositionFragment 6 | import com.regula.facesamplekotlin.util.LivenessResponseUtil 7 | import com.regula.facesdk.FaceSDK 8 | import com.regula.facesdk.configuration.LivenessConfiguration 9 | import com.regula.facesdk.model.results.LivenessResponse 10 | 11 | class NotificationViewPositionItem : CategoryItem() { 12 | 13 | override fun onItemSelected(context: Context) { 14 | val configuration = LivenessConfiguration.Builder() 15 | .registerUiFragmentClass(NotificationViewPositionFragment::class.java) 16 | .build() 17 | FaceSDK.Instance().startLiveness( 18 | context, configuration 19 | ) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) } 20 | } 21 | 22 | override val title: String 23 | get() = "Notification text view position" 24 | 25 | override val description: String 26 | get() = "Change notification view position using default UI" 27 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/FaceCaptureCameraPositionItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.features 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.util.FaceCaptureResponseUtil 6 | import com.regula.facesdk.FaceSDK 7 | import com.regula.facesdk.configuration.FaceCaptureConfiguration 8 | import com.regula.facesdk.model.results.FaceCaptureResponse 9 | 10 | class FaceCaptureCameraPositionItem : CategoryItem() { 11 | 12 | override fun onItemSelected(context: Context) { 13 | val configuration = FaceCaptureConfiguration.Builder() 14 | .setCameraSwitchEnabled(true) 15 | .setCameraId(0) 16 | .build() 17 | FaceSDK.Instance().presentFaceCaptureActivity( 18 | context, configuration 19 | ) { faceCaptureResponse: FaceCaptureResponse -> FaceCaptureResponseUtil.response(context, faceCaptureResponse) } 20 | } 21 | 22 | override val title: String 23 | get() = "Face Capture camera position" 24 | 25 | override val description: String 26 | get() = "Changes default camera position to back" 27 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/FaceSdkDeinitItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.features 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesdk.FaceSDK 6 | 7 | class FaceSdkDeinitItem : CategoryItem() { 8 | 9 | override fun onItemSelected(context: Context) { 10 | FaceSDK.Instance().deinitialize() 11 | } 12 | 13 | override val title: String 14 | get() = "Deinitialization SDK" 15 | 16 | override val description: String 17 | get() = "Deinitialization FaceSDK resources" 18 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/FaceSdkInitItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.features 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesdk.FaceSDK 6 | import com.regula.facesdk.exception.InitException 7 | 8 | class FaceSdkInitItem : CategoryItem() { 9 | 10 | override fun onItemSelected(context: Context) { 11 | FaceSDK.Instance().initialize( 12 | context 13 | ) { status: Boolean, exception: InitException? -> } 14 | } 15 | 16 | override val title: String 17 | get() = "Initialization SDK" 18 | 19 | override val description: String 20 | get() = "Initialization FaceSDK resources" 21 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/LivenessAttemptsCountItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.features 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.util.LivenessResponseUtil 6 | import com.regula.facesdk.FaceSDK 7 | import com.regula.facesdk.configuration.LivenessConfiguration 8 | import com.regula.facesdk.model.results.LivenessResponse 9 | 10 | class LivenessAttemptsCountItem : CategoryItem() { 11 | 12 | override fun onItemSelected(context: Context) { 13 | val configuration = LivenessConfiguration.Builder() 14 | .setAttemptsCount(2) 15 | .build() 16 | FaceSDK.Instance().startLiveness( 17 | context, configuration 18 | ) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) } 19 | } 20 | 21 | override val title: String 22 | get() = "Limit Liveness attempts count" 23 | 24 | override val description: String 25 | get() = "Liveness is limited to the number of retries" 26 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/LivenessDisableStepItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.features 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.util.LivenessResponseUtil 6 | import com.regula.facesdk.FaceSDK 7 | import com.regula.facesdk.configuration.LivenessConfiguration 8 | import com.regula.facesdk.enums.LivenessSkipStep 9 | import com.regula.facesdk.model.results.LivenessResponse 10 | 11 | class LivenessDisableStepItem : CategoryItem() { 12 | 13 | override fun onItemSelected(context: Context) { 14 | val configuration = LivenessConfiguration.Builder() 15 | .setSkipStep(LivenessSkipStep.ONBOARDING_STEP, LivenessSkipStep.SUCCESS_STEP) 16 | .build() 17 | FaceSDK.Instance().startLiveness( 18 | context, configuration 19 | ) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) } 20 | } 21 | 22 | override val title: String 23 | get() = "Skip Onbording & Success steps" 24 | 25 | override val description: String 26 | get() = "Liveness will not show onboarding & success screens" 27 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/features/LivenessSessionIdItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.features 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesamplekotlin.util.LivenessResponseUtil 6 | import com.regula.facesdk.FaceSDK 7 | import com.regula.facesdk.configuration.LivenessConfiguration 8 | import com.regula.facesdk.model.results.LivenessResponse 9 | import java.util.* 10 | 11 | class LivenessSessionIdItem : CategoryItem() { 12 | 13 | override fun onItemSelected(context: Context) { 14 | val configuration = LivenessConfiguration.Builder() 15 | .setTag(UUID.randomUUID().toString()) 16 | .build() 17 | FaceSDK.Instance().startLiveness( 18 | context, configuration 19 | ) { livenessResponse: LivenessResponse -> LivenessResponseUtil.response(context, livenessResponse) } 20 | } 21 | 22 | override val title: String 23 | get() = "Liveness Session Tag" 24 | 25 | override val description: String 26 | get() = "Set up session tag for liveness" 27 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/fragments/HideNotificationViewFragment.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.fragments 2 | 3 | import android.view.View 4 | import android.widget.TextView 5 | import com.regula.facesdk.fragment.FaceDefaultUiFragment 6 | 7 | class HideNotificationViewFragment : FaceDefaultUiFragment() { 8 | 9 | override fun getNotificationView(view: View): TextView? { 10 | val textView: TextView = super.getNotificationView(view) 11 | textView.visibility = View.INVISIBLE 12 | return textView 13 | } 14 | 15 | override fun setNotificationStatusText(s: String?) { 16 | // ignore any new status 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/fragments/NotificationViewPositionFragment.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.fragments 2 | 3 | import android.graphics.RectF 4 | import androidx.constraintlayout.widget.Guideline 5 | import com.regula.facesamplekotlin.R 6 | import com.regula.facesdk.fragment.FaceDefaultUiFragment 7 | 8 | class NotificationViewPositionFragment : FaceDefaultUiFragment() { 9 | 10 | override fun onFaceAreaViewPositionUpdated(rect: RectF) { 11 | val view = view ?: return 12 | var topMargin = rect.top.toInt() 13 | topMargin += (rect.height() * 0.4).toInt() 14 | val notificationGuideline: Guideline = view.findViewById(R.id.topNotificationGuideline) 15 | notificationGuideline.setGuidelinePercent(-1f) 16 | notificationGuideline.setGuidelineBegin(topMargin) 17 | } 18 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/other/LocalizationItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.other 2 | 3 | import android.content.Context 4 | import com.regula.facesamplekotlin.category.CategoryItem 5 | import com.regula.facesdk.FaceSDK 6 | import com.regula.facesdk.model.results.LivenessResponse 7 | 8 | class LocalizationItem : CategoryItem() { 9 | 10 | override fun onItemSelected(context: Context) { 11 | // uncomment in res/values/strings.xml: 12 | // hint.fit resource 13 | 14 | //This is another approach of customizing localization by overriding strings in callback 15 | 16 | // uncomment in res/values/strings.xml: 17 | // hint.fit resource 18 | 19 | 20 | //This is another approach of customizing localization by overriding strings in callback 21 | FaceSDK.Instance().setLocalizationCallback { stringId -> 22 | if (stringId.equals("livenessGuide.head")) 23 | return@setLocalizationCallback "this is custom selfie time string string" 24 | null 25 | } 26 | 27 | FaceSDK.Instance().startLiveness(context) { 28 | FaceSDK.Instance().setLocalizationCallback { 29 | null 30 | } 31 | } 32 | } 33 | 34 | override val title: String 35 | get() = "Custom localization" 36 | 37 | override val description: String 38 | get() = "Localization hook example" 39 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/other/NetworkInterceptorItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.other 2 | 3 | import android.content.Context 4 | import com.regula.common.http.HttpRequestBuilder 5 | import com.regula.facesamplekotlin.category.CategoryItem 6 | import com.regula.facesdk.FaceSDK 7 | 8 | class NetworkInterceptorItem : CategoryItem() { 9 | 10 | override fun onItemSelected(context: Context) { 11 | FaceSDK.Instance().setNetworkInterceptorListener { httpRequestBuilder: HttpRequestBuilder -> 12 | httpRequestBuilder.connection.setRequestProperty("fields", "value") 13 | } 14 | FaceSDK.Instance().serviceUrl = FaceSDK.Instance().serviceUrl 15 | FaceSDK.Instance().startLiveness(context) { } 16 | } 17 | 18 | override val title: String 19 | get() = "Network interceptor" 20 | 21 | override val description: String 22 | get() = "Adds custom http fields to the outgoing requests" 23 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/items/other/VideoCompletionItem.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.items.other 2 | 3 | import android.content.Context 4 | import android.util.Log 5 | import com.regula.facesamplekotlin.category.CategoryItem 6 | import com.regula.facesdk.FaceSDK 7 | 8 | class VideoCompletionItem: CategoryItem() { 9 | 10 | override fun onItemSelected(context: Context) { 11 | FaceSDK.Instance().setVideoEncoderCompletion { transactionId, success -> 12 | Log.d("VideoCompletionItem", "Transaction video: $transactionId success: $success") 13 | } 14 | FaceSDK.Instance().startLiveness(context) { } 15 | } 16 | 17 | override val title: String 18 | get() = "Video completion about uploading\nliveness video to service" 19 | 20 | override val description: String 21 | get() = "Video completion" 22 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/util/FaceCaptureResponseUtil.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.util 2 | 3 | import android.content.Context 4 | import android.widget.ImageView 5 | import android.widget.Toast 6 | import androidx.appcompat.app.AlertDialog 7 | import androidx.appcompat.app.AppCompatActivity 8 | import com.regula.facesdk.model.results.FaceCaptureResponse 9 | 10 | object FaceCaptureResponseUtil { 11 | fun response(context: Context?, faceCaptureResponse: FaceCaptureResponse) { 12 | if (faceCaptureResponse.exception != null) 13 | Toast.makeText( 14 | context, 15 | "Error: " + faceCaptureResponse.exception!!.message, 16 | Toast.LENGTH_SHORT 17 | ).show() 18 | else { 19 | if (context is AppCompatActivity) { 20 | faceCaptureResponse.image?.let { 21 | val image = ImageView(context) 22 | image.adjustViewBounds = true 23 | image.setImageBitmap(it.bitmap) 24 | 25 | AlertDialog.Builder(context) 26 | .setMessage("Face Capture") 27 | .setPositiveButton("OK", null) 28 | .setView(image).create().show() 29 | } 30 | } 31 | Toast.makeText(context, "Successfully got an image", Toast.LENGTH_SHORT).show() 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/util/LivenessResponseUtil.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.util 2 | 3 | import android.content.Context 4 | import android.widget.Toast 5 | import com.regula.facesdk.model.results.LivenessResponse 6 | 7 | object LivenessResponseUtil { 8 | fun response(context: Context?, livenessResponse: LivenessResponse) { 9 | if (livenessResponse.exception != null) 10 | Toast.makeText(context, "Error: " + livenessResponse.exception!!.message, Toast.LENGTH_SHORT).show() 11 | else 12 | Toast.makeText(context, "Liveness status: " + livenessResponse.liveness.name, Toast.LENGTH_SHORT).show() 13 | } 14 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/util/RandomColors.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.util 2 | 3 | import java.util.Collections 4 | import java.util.Stack 5 | 6 | class RandomColors { 7 | private val recycle: Stack = Stack() 8 | private val colors: Stack = Stack() 9 | 10 | init { 11 | recycle.addAll( 12 | mutableListOf( 13 | -0xe91e63, -0x9c27b0, -0x673ab7, -0x340000, 14 | -0x3f51b5, -0x2196f3, -0x3a9f4, -0xbcd4, 15 | -0x9688, -0x4caf50, -0x8bc34a, -0xcddc39, 16 | -0x795548, -0xe3dce, -0x3dcd0f, -0x9dcd0f, 17 | -0x3e0ece, -0x1e52f1, -0xa9f890, -0x1ee9a6, 18 | -0xff33ee, -0xffcf34, -0x33ff4f, -0x374af6 19 | ) 20 | ) 21 | } 22 | 23 | val color: Int 24 | get() { 25 | if (colors.size == 0) { 26 | while (!recycle.isEmpty()) colors.push(recycle.pop()) 27 | Collections.shuffle(colors) 28 | } 29 | val c = colors.pop() 30 | recycle.push(c) 31 | return c 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/java/com/regula/facesamplekotlin/util/ResizeTransformation.kt: -------------------------------------------------------------------------------- 1 | package com.regula.facesamplekotlin.util 2 | 3 | import android.graphics.Bitmap 4 | import kotlin.math.max 5 | 6 | class ResizeTransformation(private val maxSize: Int) { 7 | fun transform(source: Bitmap?): Bitmap? { 8 | var result:Bitmap? = null 9 | 10 | 11 | if (source != null) { 12 | var width = source.width 13 | var height = source.height 14 | 15 | if(max(width, height) <= maxSize) 16 | return source 17 | 18 | val bitmapRatio = width.toFloat() / height.toFloat() 19 | 20 | if (bitmapRatio > 1) { 21 | width = maxSize; 22 | height = (width / bitmapRatio).toInt() 23 | } else { 24 | height = maxSize; 25 | width = (height * bitmapRatio).toInt() 26 | } 27 | 28 | result = Bitmap.createScaledBitmap(source, width, height, true) 29 | source.recycle() 30 | } 31 | 32 | return result 33 | } 34 | } -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-nodpi/detect_face1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/detect_face1.jpeg -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-nodpi/detect_face2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/detect_face2.jpeg -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-nodpi/detect_face3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/detect_face3.jpeg -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-nodpi/detect_face4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/detect_face4.jpeg -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-nodpi/face_image_quality1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality1.jpeg -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-nodpi/face_image_quality2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality2.jpeg -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-nodpi/face_image_quality3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality3.jpeg -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-nodpi/face_image_quality4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable-nodpi/face_image_quality4.jpeg -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable-v24/rounded_button_corner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/button_drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/button_drawable_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/close_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/custom_button_drawable.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/done_button.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/flash_light_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable/flash_light_off.png -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/flash_light_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/drawable/flash_light_on.png -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/hind_view_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/ic_emotions.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/ic_light.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/ic_looks_1.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/ic_looks_2.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/ic_looks_3.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/notification_background_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/notification_view_background_dark.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/notification_view_background_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/drawable/rounded_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/font/roboto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/font/roboto.ttf -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/font/roboto_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/regulaforensics/FaceSDK-Android/2f9ba4089615a3a129e8d55ce608c71b4688579d/BasicSample/app/src/main/res/font/roboto_italic.ttf -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/layout/activity_face_quality.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /BasicSample/app/src/main/res/layout/fragment_face_quality_result.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 |