diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f55cd74d7a17dc1a77e1f160e9161e6dd285783..80f8f8aea5494ca8e83fd97593762d97a3704f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. +## [2.1.6] - 12 Apr, 2023 + +### New features + +- Added new ability to customize the colors, buttons and strings used in the SDK flow. +- Added new Driver license detection. + +### Fixes + +- 🔨 Date of birth bug fixed. + ## [2.1.5] - 25 Mar, 2023 ### Changed features diff --git a/CUSTOMIZATION.md b/CUSTOMIZATION.md new file mode 100644 index 0000000000000000000000000000000000000000..3eb7587971e70a0498be2bac68524a85b1d9ef1b --- /dev/null +++ b/CUSTOMIZATION.md @@ -0,0 +1,62 @@ +#### The Android SDK supports the customization of colors, buttons and strings used in the SDK flow. + +- [Localization](#localization) +- [Custom Organization Details](#custom-organization-details) +- [UI customization](#ui-customization) + +## Localization + +The MyID Android SDK supports translations for the following languages: + +- Uzbek (uz) 🇺🇿 +- English (en) 🇬🇧 +- Russian (ru) 🇷🇺 + +By default, the Uzbek language is used. However, you can also call the `withLocale(Locale)` +method of the `MyIdConfig.Builder` configuration to set the language. + +## Custom Organization Details + +You can customize the SDK, for it to match your organization's brand book, by +providing `MyIdOrganizationDetails` object to `withOrganizationDetails` method. The object allows you to +customize following fields: + +- *phoneNumber* - by default 712022202, which is MyID's call center. If you would like the customer + to call your own call center, you can display your own phone number on the error screen, by + providing it in this field ([sample](images/screen01.jpg)). +- *logo* - the drawable asset, that will be displayed on the input screen. If you would like to + display your own logo on the top of the screen, this is the place to provide it. Make sure it fits + the imageView element, which has the *240x60* size. + +## UI customization + +**Colors** + +You can define custom colors inside your own `colors.xml` file: + +* `myidColorPrimary`: Defines the color of SDK which guides the user through the flow + +* `myidColorSecondary`: Defines the color of the frames + +* `myidColorError`: Defines the color of the error buttons, icons and states + +* `myidPrimaryButtonColor`: Defines the background color of the primary action buttons + +* `myidPrimaryButtonColorDisabled`: Defines the background color of the primary disabled buttons + +* `myidPrimaryButtonTextColor`: Defines the color of the text inside the primary action buttons + +* `myidPrimaryButtonTextColorDisabled`: Defines the color of the text inside the primary disabled buttons + +**Widgets** + +You can customize the appearance of some widgets in your `dimens.xml` file by overriding: + +* `myidButtonCornerRadius`: Defines the radius dimension of all the corners of primary buttons + +# + +![Screenshot](images/frame_1.jpg) +![Screenshot](images/frame_2.jpg) +![Screenshot](images/frame_3.jpg) +![Screenshot](images/frame_4.jpg) \ No newline at end of file diff --git a/README.md b/README.md index d3e8241d8bf1fcc63e57bee2adc2d48b8915f481..762df0ff3cacb4afad1d61d37da5c9a4bb06273a 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,7 @@ - [Methods](#11-methods) - [Handling callbacks](#12-handling-callbacks) - [SDK error codes](#sdk-error-codes) -- [Localization](#localization) -- [Custom Organization Details](#custom-organization-details) +- [UI customization](CUSTOMIZATION.md) ## Important @@ -52,11 +51,11 @@ libraries (For example libs) and copy MyID SDK provided libraries. Add reference to library to module **_build.gradle_**: ``` gradle -implementation(files("libs/myid-sdk-2.1.5-release.aar")) +implementation(files("libs/myid-sdk-2.1.6-release.aar")) ``` -**Note:** You can get `myid-sdk-2.1.5-release.aar` file -from [here](app/libs/myid-sdk-2.1.5-release.aar) +**Note:** You can get `myid-sdk-2.1.6-release.aar` file +from [here](app/libs/myid-sdk-2.1.6-release.aar) After synchronization, You should be able to access to SDK classes from your source code. @@ -64,7 +63,7 @@ MyID Android SDK also requires following libraries to be added: ``` gradle dependencies { - implementation(files("libs/myid-sdk-2.1.5-release.aar")) + implementation(files("libs/myid-sdk-2.1.6-release.aar")) implementation("androidx.appcompat:appcompat:1.5.1") implementation("androidx.constraintlayout:constraintlayout:2.1.4") @@ -87,7 +86,6 @@ dependencies { implementation("com.google.mlkit:barcode-scanning:17.1.0") implementation("io.ktor:ktor-client-android:2.1.2") - implementation("io.sentry:sentry-android:6.16.0") } ``` @@ -115,7 +113,7 @@ class ExampleActivity : AppCompatActivity(), MyIdResultListener { } private fun startMyId() { - val organizationDetails = OrganizationDetails( + val organizationDetails = MyIdOrganizationDetails( phoneNumber = "1234567", logo = R.drawable.image_logo ) @@ -161,7 +159,7 @@ class ExampleActivity : AppCompatActivity(), MyIdResultListener { } private fun startMyId() { - val organizationDetails = OrganizationDetails( + val organizationDetails = MyIdOrganizationDetails( phoneNumber = "1234567", logo = R.drawable.image_logo ) @@ -205,7 +203,7 @@ Method | Notes | Default `withResidency(value: MyIdResidentType)` | To set a specific resident type | MyIdResidentType.RESIDENT `withLocale(value: Locale)` | To set a specific locale | Locale("uz") `withCameraShape(value: MyIdCameraShape)` | To set a specific camera shape | MyIdCameraShape.CIRCLE -`withOrganizationDetails(value: OrganizationDetails)` | Custom Organization Details | Optional +`withOrganizationDetails(value: MyIdOrganizationDetails)` | Custom Organization Details | Optional `withPhoto(value: Boolean)` | Return SDK face bitmap | false **Note 1.1.** You can customize the screen for entering passport data and date of birth in your @@ -301,27 +299,3 @@ reference. | 102 | Доступ к камере запрещен | 103 | Ошибка при получении данных с сервера | 120 | Размытое фото обнаружено в SDK - -## Localization - -The MyID Android SDK supports translations for the following languages: - -- Uzbek (uz) 🇺🇿 -- English (en) 🇬🇧 -- Russian (ru) 🇷🇺 - -By default, the Uzbek language is used. However, you can also call the `withLocale(Locale)` -method of the `MyIdConfig.Builder` configuration to set the language. - -## Custom Organization Details - -You can customize the SDK, for it to match your organization's brand book, by -providing `OrganizationDetails` object to `withOrganizationDetails` method. The object allows you to -customize following fields: - -- *phoneNumber* - by default 712022202, which is MyID's call center. If you would like the customer - to call your own call center, you can display your own phone number on the error screen, by - providing it in this field ([sample](images/screen01.jpg)). -- *logo* - the drawable asset, that will be displayed on the input screen. If you would like to - display your own logo on the top of the screen, this is the place to provide it. Make sure it fits - the imageView element, which has the *240x60* size. diff --git a/app/build.gradle b/app/build.gradle index dd2fd0435f962dc573a1ae083c731d665101ec86..adcc666372dbd08f8258ea327d5511dbbfaf6c9f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - implementation(files("libs/myid-sdk-2.1.5-release.aar")) + implementation(files("libs/myid-sdk-2.1.6-release.aar")) implementation("androidx.appcompat:appcompat:1.5.1") implementation("androidx.constraintlayout:constraintlayout:2.1.4") @@ -55,5 +55,4 @@ dependencies { implementation("com.google.android.gms:play-services-mlkit-barcode-scanning:18.2.0") implementation("io.ktor:ktor-client-android:2.1.2") - implementation("io.sentry:sentry-android:6.16.0") } \ No newline at end of file diff --git a/app/libs/myid-sdk-2.1.5-release.aar b/app/libs/myid-sdk-2.1.6-release.aar similarity index 53% rename from app/libs/myid-sdk-2.1.5-release.aar rename to app/libs/myid-sdk-2.1.6-release.aar index 792c656f87c3ea6a724438716f702256b28feaea..44de5877bb67541300351364d85368150581a179 100644 Binary files a/app/libs/myid-sdk-2.1.5-release.aar and b/app/libs/myid-sdk-2.1.6-release.aar differ diff --git a/app/src/main/java/uz/myid/sdk/sample/ExampleJavaActivity.java b/app/src/main/java/uz/myid/sdk/sample/ExampleJavaActivity.java index fe015dc2ba5c6490720e54b4a6f63776d16540f0..3678da5a1f22e6ed9ef989ce46d82dede901cc3b 100644 --- a/app/src/main/java/uz/myid/sdk/sample/ExampleJavaActivity.java +++ b/app/src/main/java/uz/myid/sdk/sample/ExampleJavaActivity.java @@ -11,15 +11,15 @@ import androidx.appcompat.app.AppCompatActivity; import java.util.Locale; -import uz.myid.android.sdk.capture.MyIdBuildMode; -import uz.myid.android.sdk.capture.MyIdCameraShape; import uz.myid.android.sdk.capture.MyIdClient; import uz.myid.android.sdk.capture.MyIdConfig; -import uz.myid.android.sdk.capture.MyIdEntryType; import uz.myid.android.sdk.capture.MyIdException; -import uz.myid.android.sdk.capture.MyIdResidentType; import uz.myid.android.sdk.capture.MyIdResult; import uz.myid.android.sdk.capture.MyIdResultListener; +import uz.myid.android.sdk.capture.model.MyIdBuildMode; +import uz.myid.android.sdk.capture.model.MyIdCameraShape; +import uz.myid.android.sdk.capture.model.MyIdEntryType; +import uz.myid.android.sdk.capture.model.MyIdResidentType; public class ExampleJavaActivity extends AppCompatActivity implements MyIdResultListener { diff --git a/app/src/main/java/uz/myid/sdk/sample/ExampleJavaFragment.java b/app/src/main/java/uz/myid/sdk/sample/ExampleJavaFragment.java index 2e02eb110ca23ef1a554c237599ef16c09a78159..d56e715f75237cc29d76048a765f120a5865360c 100644 --- a/app/src/main/java/uz/myid/sdk/sample/ExampleJavaFragment.java +++ b/app/src/main/java/uz/myid/sdk/sample/ExampleJavaFragment.java @@ -11,15 +11,15 @@ import androidx.fragment.app.Fragment; import java.util.Locale; -import uz.myid.android.sdk.capture.MyIdBuildMode; -import uz.myid.android.sdk.capture.MyIdCameraShape; import uz.myid.android.sdk.capture.MyIdClient; import uz.myid.android.sdk.capture.MyIdConfig; -import uz.myid.android.sdk.capture.MyIdEntryType; import uz.myid.android.sdk.capture.MyIdException; -import uz.myid.android.sdk.capture.MyIdResidentType; import uz.myid.android.sdk.capture.MyIdResult; import uz.myid.android.sdk.capture.MyIdResultListener; +import uz.myid.android.sdk.capture.model.MyIdBuildMode; +import uz.myid.android.sdk.capture.model.MyIdCameraShape; +import uz.myid.android.sdk.capture.model.MyIdEntryType; +import uz.myid.android.sdk.capture.model.MyIdResidentType; public class ExampleJavaFragment extends Fragment implements MyIdResultListener { diff --git a/app/src/main/java/uz/myid/sdk/sample/ExampleKotlinFragment.kt b/app/src/main/java/uz/myid/sdk/sample/ExampleKotlinFragment.kt index c1bed80b15ba731a89bd06d48da271f72a87f326..0b0cc509b80ac4e21175ac7387c36707c14658bb 100644 --- a/app/src/main/java/uz/myid/sdk/sample/ExampleKotlinFragment.kt +++ b/app/src/main/java/uz/myid/sdk/sample/ExampleKotlinFragment.kt @@ -3,7 +3,7 @@ package uz.myid.sdk.sample import android.os.Bundle import androidx.fragment.app.Fragment import uz.myid.android.sdk.capture.* -import uz.myid.android.sdk.capture.model.OrganizationDetails +import uz.myid.android.sdk.capture.model.* import java.util.* class ExampleKotlinFragment : Fragment(), MyIdResultListener { @@ -35,7 +35,7 @@ class ExampleKotlinFragment : Fragment(), MyIdResultListener { val externalId = "external_id" val threshold = 0.50f - val organizationDetails = OrganizationDetails( + val organizationDetails = MyIdOrganizationDetails( phoneNumber = "1234567", ) diff --git a/app/src/main/java/uz/myid/sdk/sample/ExampleWithOnActivityResultActivity.kt b/app/src/main/java/uz/myid/sdk/sample/ExampleWithOnActivityResultActivity.kt index b27fb8d5c027706e243f010fddface0553dfbce5..aa25b93030bb10c7a2256f2234fbf9991e898747 100644 --- a/app/src/main/java/uz/myid/sdk/sample/ExampleWithOnActivityResultActivity.kt +++ b/app/src/main/java/uz/myid/sdk/sample/ExampleWithOnActivityResultActivity.kt @@ -4,7 +4,7 @@ import android.content.Intent import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import uz.myid.android.sdk.capture.* -import uz.myid.android.sdk.capture.model.OrganizationDetails +import uz.myid.android.sdk.capture.model.* import java.util.* class ExampleWithOnActivityResultActivity : AppCompatActivity(), MyIdResultListener { @@ -41,7 +41,7 @@ class ExampleWithOnActivityResultActivity : AppCompatActivity(), MyIdResultListe val externalId = "external_id" val threshold = 0.50f - val organizationDetails = OrganizationDetails( + val organizationDetails = MyIdOrganizationDetails( phoneNumber = "1234567", ) diff --git a/app/src/main/java/uz/myid/sdk/sample/MainActivity.kt b/app/src/main/java/uz/myid/sdk/sample/MainActivity.kt index 7a84c0fb966ad6b22fc0581354ab6ac479aa49c8..7e6aacd2034d8a39551b46ad6635d63cd21723cc 100644 --- a/app/src/main/java/uz/myid/sdk/sample/MainActivity.kt +++ b/app/src/main/java/uz/myid/sdk/sample/MainActivity.kt @@ -4,7 +4,7 @@ import android.os.Bundle import android.widget.EditText import androidx.appcompat.app.AppCompatActivity import uz.myid.android.sdk.capture.* -import uz.myid.android.sdk.capture.model.OrganizationDetails +import uz.myid.android.sdk.capture.model.* import uz.myid.sdk.sample.databinding.ActivityMainBinding import java.util.* @@ -106,7 +106,7 @@ class MainActivity : AppCompatActivity(), MyIdResultListener { } private fun startMyId() { - val organizationDetails = OrganizationDetails( + val organizationDetails = MyIdOrganizationDetails( phoneNumber = binding.inputPhoneNumber.value ) diff --git a/images/frame_1.jpg b/images/frame_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..880e153d6148a10870cf03be667828ba5deebe73 Binary files /dev/null and b/images/frame_1.jpg differ diff --git a/images/frame_2.jpg b/images/frame_2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bfeb21d0b48da449d09bac65939856b2f92463ee Binary files /dev/null and b/images/frame_2.jpg differ diff --git a/images/frame_3.jpg b/images/frame_3.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c12b89ed8c25fb59dfb172df6be353a7f4a5f7e4 Binary files /dev/null and b/images/frame_3.jpg differ diff --git a/images/frame_4.jpg b/images/frame_4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fd0a9427f5f5e31617de0302fbfb6e5bbf3137ba Binary files /dev/null and b/images/frame_4.jpg differ