Skip to content

Commit 2fccdd4

Browse files
Merge pull request #5 from pingidentity/SDKv2.1.1
PingOneVerify Android SDK v2.1.1
2 parents ce43967 + bf6faac commit 2fccdd4

28 files changed

+292
-217
lines changed

DISCLAIMER.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
* Copyright (C) 2022 Ping Identity Corporation
2+
* Copyright (C) 2024 Ping Identity Corporation
33
* All rights reserved.
44
*
55
* Ping Identity Corporation

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
5656

5757
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "\[\]" replaced with your own identifying information. \(Don't include the brackets!\) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
5858

59-
Copyright 2023 Ping Identity Corp.
59+
Copyright 2024 Ping Identity Corp.
6060

6161
Licensed under the Apache License, Version 2.0 \(the "License"\); you may not use this file except in compliance with the License. You may obtain a copy of the License at
6262

SDK/PingOneVerify-2.1.0.aar

-493 KB
Binary file not shown.

SDK/PingOneVerify-2.1.1.aar

466 KB
Binary file not shown.

SDK/id_scanner_sdk.aar

722 KB
Binary file not shown.

SDK/voice_sdk.aar

3.47 MB
Binary file not shown.

SampleCode/LICENSE_SAMPLE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022 Ping Identity Corporation
3+
Copyright (c) 2024 Ping Identity Corporation
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
+2-42
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,2 @@
1-
# Built application files
2-
*.apk
3-
*.ap_
4-
5-
# Files for the ART/Dalvik VM
6-
*.dex
7-
8-
# Java class files
9-
*.class
10-
11-
# Generated files
12-
bin/
13-
gen/
14-
out/
15-
16-
# Gradle files
17-
.gradle/
18-
build/
19-
20-
# Local configuration file (sdk path, etc)
21-
local.properties
22-
23-
# Proguard folder generated by Eclipse
24-
proguard/
25-
26-
# Log Files
27-
*.log
28-
29-
# Android Studio Navigation editor temp files
30-
.navigation/
31-
32-
# Android Studio captures folder
33-
captures/
34-
35-
# Intellij
36-
*.iml
37-
.idea/libraries/*
38-
.idea/*
39-
40-
.DS_store
41-
.idea/*
42-
/projectFilesBackup
1+
/build
2+
/release

SampleCode/PingOneVerify/app/build.gradle

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
11
plugins {
22
id 'com.android.application'
3-
id 'com.google.android.gms.strict-version-matcher-plugin'
3+
id 'kotlin-android'
4+
id 'kotlin-kapt'
45
}
56

67
android {
7-
compileSdk 33
8-
9-
buildFeatures {
10-
dataBinding true
11-
}
8+
compileSdk 34
9+
namespace 'com.pingidentity.sdk.pingoneverify.sample'
10+
buildToolsVersion = '34.0.0'
1211

1312
defaultConfig {
14-
1513
applicationId "com.pingidentity.sdk.pingoneverify.sample"
16-
minSdk 24
17-
targetSdk 33
18-
versionCode 1
19-
versionName "1.0.0"
14+
minSdkVersion 24
15+
targetSdkVersion 34
16+
versionCode 2
17+
versionName "2.1.1"
2018

2119
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2220
}
2321

22+
buildFeatures {
23+
dataBinding true
24+
}
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_17
27+
targetCompatibility JavaVersion.VERSION_17
28+
}
29+
kotlinOptions {
30+
jvmTarget = '17'
31+
}
2432
buildTypes {
2533
debug {
2634
minifyEnabled true
@@ -31,21 +39,13 @@ android {
3139
proguardFiles 'proguard-rules.pro'
3240
}
3341
}
34-
35-
compileOptions {
36-
sourceCompatibility JavaVersion.VERSION_1_8
37-
targetCompatibility JavaVersion.VERSION_1_8
38-
}
39-
namespace 'com.pingidentity.sdk.pingoneverify.sample'
40-
4142
}
4243

4344
dependencies {
44-
4545
implementation fileTree(dir: '../../../SDK/', include: ['*.aar'], exclude: [])
4646

4747
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
48-
implementation 'androidx.fragment:fragment:1.6.1'
48+
implementation 'androidx.fragment:fragment-ktx:1.6.1'
4949
implementation 'androidx.appcompat:appcompat:1.6.1'
5050
implementation 'androidx.camera:camera-camera2:1.2.3'
5151
implementation 'androidx.camera:camera-core:1.2.3'
@@ -74,7 +74,6 @@ dependencies {
7474
implementation("androidx.fragment:fragment-ktx:1.6.1")
7575

7676
implementation("com.appmattus.certificatetransparency:certificatetransparency-android:1.1.1")
77-
7877
}
7978

8079
configurations.implementation {

SampleCode/PingOneVerify/app/proguard-rules.pro

+2-7
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
-dontwarn com.squareup.moshi.**
100100
-keep class com.google.code.gson.** { *; }
101101
-dontwarn com.google.code.gson.**
102+
-keep class net.idrnd.voicesdk.** { *; }
103+
-dontwarn net.idrnd.voicesdk.**
102104
-keep class com.appmattus.certificatetransparency.** {*;}
103105
-dontwarn com.appmattus.certificatetransparency.**
104106

@@ -111,10 +113,3 @@
111113

112114
-keep public class com.google.android.gms.* { public *; }
113115
-dontwarn com.google.android.gms.**
114-
115-
-ignorewarnings
116-
117-
# gradle 8.0
118-
-dontwarn android.test.**
119-
-dontwarn junit.runner.**
120-
-dontwarn junit.framework.**

SampleCode/PingOneVerify/app/src/main/AndroidManifest.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
android:label="@string/app_name"
1010
android:supportsRtl="true"
1111
android:theme="@style/Theme.PingOneVerify"
12-
tools:targetApi="31">
12+
tools:replace="android:allowBackup">
1313

1414
<meta-data
1515
android:name="com.google.android.gms.vision.DEPENDENCIES"
@@ -19,7 +19,8 @@
1919
<activity
2020
android:name=".MainActivity"
2121
android:exported="true"
22-
android:screenOrientation="portrait">
22+
android:screenOrientation="portrait"
23+
android:windowSoftInputMode="adjustResize">
2324
<intent-filter>
2425
<action android:name="android.intent.action.MAIN" />
2526

SampleCode/PingOneVerify/app/src/main/java/com/pingidentity/sdk/pingoneverify/sample/CompletedFragment.java

+15
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
import android.view.LayoutInflater;
55
import android.view.View;
66
import android.view.ViewGroup;
7+
import android.widget.Button;
8+
import android.widget.TextView;
79

810
import androidx.annotation.NonNull;
911
import androidx.annotation.Nullable;
1012
import androidx.fragment.app.Fragment;
13+
import androidx.fragment.app.FragmentTransaction;
1114

1215
public class CompletedFragment extends Fragment {
1316

17+
private Button mBtnClose;
18+
1419
@Nullable
1520
@Override
1621
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@@ -20,5 +25,15 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
2025
@Override
2126
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
2227
super.onViewCreated(view, savedInstanceState);
28+
mBtnClose = view.findViewById(R.id.btn_close);
29+
mBtnClose.setOnClickListener(mView -> moveToMainFragment());
30+
}
31+
32+
private void moveToMainFragment() {
33+
FragmentTransaction fragmentTransaction = getParentFragmentManager().beginTransaction();
34+
MainFragment mainFragment = new MainFragment();
35+
fragmentTransaction.replace(R.id.frame_layout, mainFragment)
36+
.addToBackStack(null)
37+
.commit();
2338
}
2439
}

SampleCode/PingOneVerify/app/src/main/java/com/pingidentity/sdk/pingoneverify/sample/MainActivity.java

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
1414
setContentView(R.layout.activity_main);
1515
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
1616
fragmentTransaction.replace(R.id.frame_layout, new MainFragment());
17+
fragmentTransaction.addToBackStack(null);
1718
fragmentTransaction.commit();
1819
}
1920

SampleCode/PingOneVerify/app/src/main/java/com/pingidentity/sdk/pingoneverify/sample/MainFragment.java

+13-17
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
package com.pingidentity.sdk.pingoneverify.sample;
22

33
import android.app.AlertDialog;
4-
import android.graphics.Bitmap;
54
import android.os.Bundle;
65
import android.util.Log;
76
import android.view.LayoutInflater;
87
import android.view.View;
98
import android.view.ViewGroup;
109
import android.widget.Button;
11-
import android.widget.ProgressBar;
1210

1311
import androidx.annotation.NonNull;
1412
import androidx.annotation.Nullable;
1513
import androidx.fragment.app.Fragment;
1614
import androidx.fragment.app.FragmentTransaction;
1715

1816
import com.pingidentity.sdk.pingoneverify.PingOneVerifyClient;
19-
import com.pingidentity.sdk.pingoneverify.documentcapture.utils.BitmapUtils;
2017
import com.pingidentity.sdk.pingoneverify.errors.DocumentSubmissionError;
2118
import com.pingidentity.sdk.pingoneverify.listeners.DocumentSubmissionListener;
2219
import com.pingidentity.sdk.pingoneverify.models.DocumentSubmissionResponse;
@@ -29,7 +26,7 @@ public class MainFragment extends Fragment implements DocumentSubmissionListener
2926
public static final String TAG = MainFragment.class.getCanonicalName();
3027

3128
private Button mBtnVerify;
32-
private ProgressBar mProgress;
29+
private View waitOverlay;
3330

3431
@Nullable
3532
@Override
@@ -41,8 +38,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
4138
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
4239
super.onViewCreated(view, savedInstanceState);
4340
mBtnVerify = view.findViewById(R.id.btn_verify);
44-
mProgress = view.findViewById(R.id.progress);
45-
41+
waitOverlay = view.findViewById(R.id.wait_spinner);
4642
mBtnVerify.setOnClickListener(mView -> initPingOneClient());
4743
}
4844

@@ -53,22 +49,24 @@ public void onDocumentSubmitted(DocumentSubmissionResponse response) {
5349

5450
@Override
5551
public void onSubmissionComplete(DocumentSubmissionStatus status) {
52+
setInProgress(false);
5653
FragmentTransaction fragmentTransaction = getParentFragmentManager().beginTransaction();
5754
CompletedFragment completedFragment = new CompletedFragment();
5855
fragmentTransaction.replace(R.id.frame_layout, completedFragment)
5956
.addToBackStack(null)
6057
.commit();
61-
setInProgress(false);
6258
}
6359

6460
@Override
6561
public void onSubmissionError(DocumentSubmissionError error) {
66-
Log.e("onSubmissionError", error.getMessage());
62+
Log.e(TAG, error.getMessage() != null ? error.getMessage() : "Unknown Error");
6763
showAlert("Document Submission Error", error.getLocalizedMessage());
6864
setInProgress(false);
6965
}
7066

7167
private void initPingOneClient() {
68+
waitOverlay.setVisibility(View.VISIBLE);
69+
7270
new PingOneVerifyClient.Builder(false)
7371
.setRootActivity(getActivity())
7472
.setListener(this)
@@ -78,12 +76,16 @@ private void initPingOneClient() {
7876
public void onSuccess(PingOneVerifyClient client) {
7977
Log.d("initPingOneClient", "success");
8078
setInProgress(true);
79+
waitOverlay.setVisibility(View.GONE);
8180
}
8281

8382
@Override
8483
public void onError(String errorMessage) {
85-
showAlert("Client Builder Error", errorMessage);
84+
if (errorMessage != null) {
85+
showAlert("Client Builder Error", errorMessage);
86+
}
8687
setInProgress(false);
88+
waitOverlay.setVisibility(View.GONE);
8789
}
8890
});
8991
}
@@ -97,14 +99,8 @@ private void showAlert(String title, String message) {
9799
}
98100

99101
private void setInProgress(boolean inProgress) {
100-
mBtnVerify.setVisibility(inProgress ? View.INVISIBLE : View.VISIBLE);
101-
mProgress.setVisibility(inProgress ? View.VISIBLE : View.GONE);
102-
}
103-
104-
private UIAppearanceSettings getUiAppearanceSettings() {
105-
return new UIAppearanceSettings()
106-
.setSolidButtonAppearance(new ButtonAppearance("#F1C40F","#F1C40F","#95A5A6"))
107-
.setBorderedButtonAppearance(new ButtonAppearance("#00FFFFFF","#28B463","#28B463"));
102+
mBtnVerify.setClickable(!inProgress);
103+
mBtnVerify.setAlpha(inProgress ? 0.4f : 1f);
108104
}
109105

110106
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="32dp"
3+
android:height="32dp"
4+
android:viewportWidth="32"
5+
android:viewportHeight="32">
6+
<path
7+
android:pathData="M16,2.667C8.667,2.667 2.667,8.667 2.667,16C2.667,23.333 8.667,29.333 16,29.333C23.333,29.333 29.333,23.333 29.333,16C29.333,8.667 23.333,2.667 16,2.667ZM13.333,22.667L6.667,16L8.547,14.12L13.333,18.893L23.453,8.773L25.333,10.667L13.333,22.667Z"
8+
android:fillColor="#00AF18"/>
9+
</vector>

0 commit comments

Comments
 (0)