From 872c00cee09e8f92dc7e46825ebbabbc7ab228e6 Mon Sep 17 00:00:00 2001 From: Mahdi Abolfazli Date: Tue, 5 Sep 2023 12:08:07 +0200 Subject: [PATCH 01/30] refactor: Refactor the example apps and merge them into one - Delete bank example app - Move capture example app to bank-sdk - Refactor the package name to fit the bank PIA-4417 --- .../example-app}/README.md | 0 .../example-app}/build.gradle.kts | 12 +- .../example-app}/gradle.properties | 0 .../example-app}/proguard-rules.pro | 0 .../example-app}/screen_api_example.jks | Bin .../src/androidTest/AndroidManifest.xml | 0 .../capture/screen/screenshots/Helper.java | 4 +- .../screen/screenshots/ScreenshotHelper.java | 0 .../screen/screenshots/ScreenshotsTest.java | 0 .../screen/screenshots/screens/Screen.java | 0 .../screens/screenapi/AnalysisScreen.java | 4 +- .../screens/screenapi/CameraScreen.java | 0 .../screens/screenapi/MainScreen.java | 4 +- .../screens/screenapi/OnboardingScreen.java | 4 +- .../screens/screenapi/ReviewScreen.java | 4 +- .../screen/testhelper/PermissionsHelper.java | 0 .../src/debug/AndroidManifest.xml | 0 .../debug/res/xml/network_security_config.xml | 0 .../example-app}/src/main/AndroidManifest.xml | 29 +- .../src/main/assets/Cave-Story.ttf | Bin .../main/assets/fonts/Warenhaus-Standard.ttf | Bin .../gini/android/bank/screen/ExampleApp.kt | 4 +- .../bank}/screen/core/DocumentAnalyzer.kt | 3 +- .../android/bank}/screen/core/ExampleUtil.kt | 2 +- .../bank/screen/core}/ResultWrapper.kt | 2 +- .../screen/core/RuntimePermissionHandler.kt | 2 +- .../android/bank}/screen/core/di/AppModule.kt | 6 +- .../bank/screen/core/di/GiniExampleModule.kt | 6 +- .../screen/ui/CameraScreenApiActivity.kt | 4 +- .../bank}/screen/ui/ConfigurationActivity.kt | 24 +- .../bank}/screen/ui/ConfigurationViewModel.kt | 179 +++++++---- .../bank/screen/ui}/CustomHelpActivity.kt | 3 +- .../ui/CustomLottiLoadingIndicatorAdapter.kt | 4 +- .../ui/CustomOnboardingIllustrationAdapter.kt | 4 +- .../bank}/screen/ui/ExtractionsActivity.kt | 6 +- .../android/bank}/screen/ui/MainActivity.kt | 34 +- .../CustomCameraNavigationBarBottomAdapter.kt | 4 +- .../CustomHelpNavigationBarBottomAdapter.kt | 4 +- .../adapters/CustomNavigationBarTopAdapter.kt | 4 +- .../CustomOnButtonLoadingIndicatorAdapter.kt | 2 +- ...tomOnboardingNavigationBarBottomAdapter.kt | 5 +- .../CustomReviewNavigationBarBottomAdapter.kt | 4 +- .../bank}/screen/ui/data/Configuration.kt | 5 +- .../bank/screen/ui}/pay/PayActivity.kt | 24 +- .../bank/screen/ui/pay/PayViewModel.kt} | 10 +- .../screen/ui}/pay/PayViewModelInterface.kt | 6 +- .../bank/screen/ui}/pay/PayViewModelJava.java | 14 +- .../additional_onboarding_illustration.xml | 0 .../main/res/drawable/edittext_selector.xml | 0 .../res/layout/activity_configuration.xml | 71 +++-- .../main/res/layout/activity_custom_help.xml | 0 .../main/res/layout/activity_extractions.xml | 2 +- .../src/main/res/layout/activity_main.xml | 2 +- .../src/main/res/layout/activity_pay.xml | 0 .../layout/animation_onboarding_lottie.xml | 0 .../custom_camera_navigation_bar_bottom.xml | 0 .../custom_help_navigation_bar_bottom.xml | 0 .../res/layout/custom_navigation_bar_top.xml | 0 ...ustom_onboarding_navigation_bar_bottom.xml | 0 .../custom_review_navigation_bar_bottom.xml | 0 .../src/main/res/layout/item_extraction.xml | 0 .../src/main/res/menu/menu_extractions.xml | 0 .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../src/main/res/raw/ai_animation.json | 0 .../src/main/res/raw/custom_loading.json | 0 .../src/main/res/raw/floating_document.json | 0 .../src/main/res/raw/lighting.json | 0 .../src/main/res/raw/multipage.json | 0 .../src/main/res/raw/scan_qr_code.json | 0 .../src/main/res/values-w820dp/dimens.xml | 0 .../src/main/res/values/colors.xml | 0 .../src/main/res/values/config.xml | 0 .../src/main/res/values/dimens.xml | 2 + .../src/main/res/values/strings.xml | 10 +- .../src/main/res/values/styles.xml | 4 + .../src/main/res/xml/filepaths.xml | 0 .../capture/screen/ExampleUnitTest.java | 0 .../screen-api-example-app/build.gradle.kts | 92 ------ .../screen-api-example-app/gradle.properties | 11 - .../screen-api-example-app/proguard-rules.pro | 21 -- .../screen_api_example.jks | Bin 2639 -> 0 bytes .../appscreenapi/ExampleInstrumentedTest.kt | 24 -- .../src/main/AndroidManifest.xml | 74 ----- .../screenapiexample/CaptureEventTracker.kt | 58 ---- .../CustomLottiLoadingIndicatorAdapter.kt | 39 --- .../CustomOnboardingIllustrationAdapter.kt | 63 ---- .../screenapiexample/ExampleApplication.kt | 19 -- .../screenapiexample/ExtractionsActivity.kt | 187 ----------- .../bank/sdk/screenapiexample/MainActivity.kt | 294 ------------------ .../sdk/screenapiexample/di/GiniModule.kt | 23 -- .../bank/sdk/screenapiexample/di/ViewModel.kt | 11 - .../util/PermissionHandler.kt | 35 --- .../util/SimpleSpinnerSelectListener.kt | 12 - .../main/res/drawable/edittext_selector.xml | 5 - .../main/res/layout/activity_custom_help.xml | 20 -- .../main/res/layout/activity_extractions.xml | 56 ---- .../src/main/res/layout/activity_main.xml | 106 ------- .../src/main/res/menu/menu_extractions.xml | 8 - .../src/main/res/values/colors.xml | 6 - .../src/main/res/values/dimens.xml | 4 - .../src/main/res/values/strings.xml | 19 -- .../src/main/res/values/themes.xml | 11 - .../gini/pay/appscreenapi/ExampleUnitTest.kt | 17 - .../drawable-hdpi/gc_action_bar_back.png | Bin 329 -> 0 bytes .../gc_camera_focus_indicator.png | Bin 2656 -> 0 bytes .../gc_camera_preview_corners.png | Bin 5105 -> 0 bytes .../gc_camera_trigger_default.png | Bin 3421 -> 0 bytes .../gc_camera_trigger_pressed.png | Bin 3421 -> 0 bytes .../drawable-hdpi/gc_icon_onboarding.png | Bin 1361 -> 0 bytes .../drawable-hdpi/gc_no_camera.png | Bin 2815 -> 0 bytes .../drawable-hdpi/gc_onboarding_align.png | Bin 4398 -> 0 bytes .../drawable-hdpi/gc_onboarding_fab_next.png | Bin 784 -> 0 bytes .../drawable-hdpi/gc_onboarding_flat.png | Bin 8345 -> 0 bytes .../gc_onboarding_indicator_active.png | Bin 213 -> 0 bytes .../gc_onboarding_indicator_inactive.png | Bin 347 -> 0 bytes .../drawable-hdpi/gc_onboarding_parallel.png | Bin 15632 -> 0 bytes .../drawable-hdpi/gc_review_button_rotate.png | Bin 1445 -> 0 bytes .../drawable-hdpi/gc_review_fab_next.png | Bin 784 -> 0 bytes .../drawable-mdpi/gc_action_bar_back.png | Bin 280 -> 0 bytes .../gc_camera_focus_indicator.png | Bin 1888 -> 0 bytes .../gc_camera_preview_corners.png | Bin 3184 -> 0 bytes .../gc_camera_trigger_default.png | Bin 2074 -> 0 bytes .../gc_camera_trigger_pressed.png | Bin 2075 -> 0 bytes .../drawable-mdpi/gc_icon_onboarding.png | Bin 1164 -> 0 bytes .../drawable-mdpi/gc_no_camera.png | Bin 1953 -> 0 bytes .../drawable-mdpi/gc_onboarding_align.png | Bin 3187 -> 0 bytes .../drawable-mdpi/gc_onboarding_fab_next.png | Bin 536 -> 0 bytes .../drawable-mdpi/gc_onboarding_flat.png | Bin 5266 -> 0 bytes .../gc_onboarding_indicator_active.png | Bin 161 -> 0 bytes .../gc_onboarding_indicator_inactive.png | Bin 237 -> 0 bytes .../drawable-mdpi/gc_onboarding_parallel.png | Bin 9323 -> 0 bytes .../drawable-mdpi/gc_review_button_rotate.png | Bin 915 -> 0 bytes .../drawable-mdpi/gc_review_fab_next.png | Bin 536 -> 0 bytes .../drawable-xhdpi/gc_action_bar_back.png | Bin 334 -> 0 bytes .../gc_camera_focus_indicator.png | Bin 3023 -> 0 bytes .../gc_camera_preview_corners.png | Bin 7526 -> 0 bytes .../gc_camera_trigger_default.png | Bin 3333 -> 0 bytes .../gc_camera_trigger_pressed.png | Bin 3335 -> 0 bytes .../drawable-xhdpi/gc_icon_onboarding.png | Bin 1546 -> 0 bytes .../drawable-xhdpi/gc_no_camera.png | Bin 2575 -> 0 bytes .../drawable-xhdpi/gc_onboarding_align.png | Bin 5286 -> 0 bytes .../drawable-xhdpi/gc_onboarding_fab_next.png | Bin 784 -> 0 bytes .../drawable-xhdpi/gc_onboarding_flat.png | Bin 8833 -> 0 bytes .../gc_onboarding_indicator_active.png | Bin 287 -> 0 bytes .../gc_onboarding_indicator_inactive.png | Bin 458 -> 0 bytes .../drawable-xhdpi/gc_onboarding_parallel.png | Bin 16475 -> 0 bytes .../gc_review_button_rotate.png | Bin 1541 -> 0 bytes .../drawable-xhdpi/gc_review_fab_next.png | Bin 784 -> 0 bytes .../drawable-xxhdpi/gc_action_bar_back.png | Bin 396 -> 0 bytes .../gc_camera_focus_indicator.png | Bin 5705 -> 0 bytes .../gc_camera_preview_corners.png | Bin 13009 -> 0 bytes .../gc_camera_trigger_default.png | Bin 7637 -> 0 bytes .../gc_camera_trigger_pressed.png | Bin 7638 -> 0 bytes .../drawable-xxhdpi/gc_icon_onboarding.png | Bin 1896 -> 0 bytes .../drawable-xxhdpi/gc_no_camera.png | Bin 5896 -> 0 bytes .../drawable-xxhdpi/gc_onboarding_align.png | Bin 7960 -> 0 bytes .../gc_onboarding_fab_next.png | Bin 1111 -> 0 bytes .../drawable-xxhdpi/gc_onboarding_flat.png | Bin 18373 -> 0 bytes .../gc_onboarding_indicator_active.png | Bin 407 -> 0 bytes .../gc_onboarding_indicator_inactive.png | Bin 750 -> 0 bytes .../gc_onboarding_parallel.png | Bin 36104 -> 0 bytes .../gc_review_button_rotate.png | Bin 2380 -> 0 bytes .../drawable-xxhdpi/gc_review_fab_next.png | Bin 1111 -> 0 bytes .../drawable-xxxhdpi/gc_action_bar_back.png | Bin 401 -> 0 bytes .../gc_camera_focus_indicator.png | Bin 8478 -> 0 bytes .../gc_camera_preview_corners.png | Bin 20472 -> 0 bytes .../gc_camera_trigger_default.png | Bin 5366 -> 0 bytes .../gc_camera_trigger_pressed.png | Bin 5366 -> 0 bytes .../drawable-xxxhdpi/gc_icon_onboarding.png | Bin 2180 -> 0 bytes .../drawable-xxxhdpi/gc_no_camera.png | Bin 4346 -> 0 bytes .../drawable-xxxhdpi/gc_onboarding_align.png | Bin 9729 -> 0 bytes .../gc_onboarding_fab_next.png | Bin 843 -> 0 bytes .../drawable-xxxhdpi/gc_onboarding_flat.png | Bin 14426 -> 0 bytes .../gc_onboarding_indicator_active.png | Bin 389 -> 0 bytes .../gc_onboarding_indicator_inactive.png | Bin 725 -> 0 bytes .../gc_onboarding_parallel.png | Bin 25647 -> 0 bytes .../gc_review_button_rotate.png | Bin 2208 -> 0 bytes .../drawable-xxxhdpi/gc_review_fab_next.png | Bin 843 -> 0 bytes .../src/debug/AndroidManifest.xml | 6 - .../debug/res/xml/network_security_config.xml | 8 - .../capture/screen/ui/CustomHelpActivity.kt | 23 -- .../layout/animation_onboarding_lottie.xml | 17 - .../src/main/res/layout/item_extraction.xml | 26 -- .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 10486 -> 0 bytes .../src/main/res/raw/custom_loading.json | 1 - .../src/main/res/raw/floating_document.json | 1 - .../src/main/res/raw/lighting.json | 1 - .../src/main/res/raw/multipage.json | 1 - .../src/main/res/raw/scan_qr_code.json | 1 - settings.gradle.kts | 4 +- 198 files changed, 318 insertions(+), 1503 deletions(-) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/README.md (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/build.gradle.kts (91%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/gradle.properties (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/proguard-rules.pro (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/screen_api_example.jks (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/AndroidManifest.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/screenshots/Helper.java (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotHelper.java (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotsTest.java (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/Screen.java (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/AnalysisScreen.java (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/CameraScreen.java (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/MainScreen.java (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/OnboardingScreen.java (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/ReviewScreen.java (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/androidTest/java/net/gini/android/capture/screen/testhelper/PermissionsHelper.java (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/debug/AndroidManifest.xml (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/debug/res/xml/network_security_config.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/AndroidManifest.xml (75%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/assets/Cave-Story.ttf (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/assets/fonts/Warenhaus-Standard.ttf (100%) rename capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ScreenApiExampleApp.kt => bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ExampleApp.kt (84%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/core/DocumentAnalyzer.kt (97%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/core/ExampleUtil.kt (97%) rename bank-sdk/{screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/util => example-app/src/main/java/net/gini/android/bank/screen/core}/ResultWrapper.kt (87%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/core/RuntimePermissionHandler.kt (99%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/core/di/AppModule.kt (66%) rename capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/di/GiniCaptureModule.kt => bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/di/GiniExampleModule.kt (93%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/CameraScreenApiActivity.kt (98%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/ConfigurationActivity.kt (96%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/ConfigurationViewModel.kt (56%) rename bank-sdk/{screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample => example-app/src/main/java/net/gini/android/bank/screen/ui}/CustomHelpActivity.kt (88%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/CustomLottiLoadingIndicatorAdapter.kt (90%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/CustomOnboardingIllustrationAdapter.kt (93%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/ExtractionsActivity.kt (98%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/MainActivity.kt (93%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/adapters/CustomCameraNavigationBarBottomAdapter.kt (88%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/adapters/CustomHelpNavigationBarBottomAdapter.kt (85%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/adapters/CustomNavigationBarTopAdapter.kt (96%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/adapters/CustomOnButtonLoadingIndicatorAdapter.kt (95%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/adapters/CustomOnboardingNavigationBarBottomAdapter.kt (91%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/adapters/CustomReviewNavigationBarBottomAdapter.kt (94%) rename {capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture => bank-sdk/example-app/src/main/java/net/gini/android/bank}/screen/ui/data/Configuration.kt (98%) rename bank-sdk/{screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample => example-app/src/main/java/net/gini/android/bank/screen/ui}/pay/PayActivity.kt (83%) rename bank-sdk/{screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelKotlin.kt => example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModel.kt} (89%) rename bank-sdk/{screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample => example-app/src/main/java/net/gini/android/bank/screen/ui}/pay/PayViewModelInterface.kt (84%) rename bank-sdk/{screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample => example-app/src/main/java/net/gini/android/bank/screen/ui}/pay/PayViewModelJava.java (95%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/drawable/additional_onboarding_illustration.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/drawable/edittext_selector.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/layout/activity_configuration.xml (91%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/layout/activity_custom_help.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/layout/activity_extractions.xml (96%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/layout/activity_main.xml (96%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/layout/activity_pay.xml (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/layout/animation_onboarding_lottie.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/layout/custom_camera_navigation_bar_bottom.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/layout/custom_help_navigation_bar_bottom.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/layout/custom_navigation_bar_top.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/layout/custom_onboarding_navigation_bar_bottom.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/layout/custom_review_navigation_bar_bottom.xml (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/layout/item_extraction.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/menu/menu_extractions.xml (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/raw/ai_animation.json (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/raw/custom_loading.json (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/raw/floating_document.json (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/raw/lighting.json (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/raw/multipage.json (100%) rename bank-sdk/{screen-api-example-app => example-app}/src/main/res/raw/scan_qr_code.json (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/values-w820dp/dimens.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/values/colors.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/values/config.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/values/dimens.xml (82%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/values/strings.xml (95%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/values/styles.xml (95%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/main/res/xml/filepaths.xml (100%) rename {capture-sdk/screen-api-example-app => bank-sdk/example-app}/src/test/java/net/gini/android/capture/screen/ExampleUnitTest.java (100%) delete mode 100644 bank-sdk/screen-api-example-app/build.gradle.kts delete mode 100644 bank-sdk/screen-api-example-app/gradle.properties delete mode 100644 bank-sdk/screen-api-example-app/proguard-rules.pro delete mode 100644 bank-sdk/screen-api-example-app/screen_api_example.jks delete mode 100644 bank-sdk/screen-api-example-app/src/androidTest/java/net/gini/pay/appscreenapi/ExampleInstrumentedTest.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/AndroidManifest.xml delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CaptureEventTracker.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomLottiLoadingIndicatorAdapter.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomOnboardingIllustrationAdapter.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/ExampleApplication.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/ExtractionsActivity.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/MainActivity.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/di/GiniModule.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/di/ViewModel.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/util/PermissionHandler.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/util/SimpleSpinnerSelectListener.kt delete mode 100644 bank-sdk/screen-api-example-app/src/main/res/drawable/edittext_selector.xml delete mode 100644 bank-sdk/screen-api-example-app/src/main/res/layout/activity_custom_help.xml delete mode 100644 bank-sdk/screen-api-example-app/src/main/res/layout/activity_extractions.xml delete mode 100644 bank-sdk/screen-api-example-app/src/main/res/layout/activity_main.xml delete mode 100644 bank-sdk/screen-api-example-app/src/main/res/menu/menu_extractions.xml delete mode 100644 bank-sdk/screen-api-example-app/src/main/res/values/colors.xml delete mode 100644 bank-sdk/screen-api-example-app/src/main/res/values/dimens.xml delete mode 100644 bank-sdk/screen-api-example-app/src/main/res/values/strings.xml delete mode 100644 bank-sdk/screen-api-example-app/src/main/res/values/themes.xml delete mode 100644 bank-sdk/screen-api-example-app/src/test/java/net/gini/pay/appscreenapi/ExampleUnitTest.kt delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_action_bar_back.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_camera_focus_indicator.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_camera_preview_corners.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_camera_trigger_default.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_camera_trigger_pressed.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_icon_onboarding.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_no_camera.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_onboarding_align.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_onboarding_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_onboarding_flat.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_onboarding_indicator_active.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_onboarding_indicator_inactive.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_onboarding_parallel.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_review_button_rotate.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-hdpi/gc_review_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_action_bar_back.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_camera_focus_indicator.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_camera_preview_corners.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_camera_trigger_default.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_camera_trigger_pressed.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_icon_onboarding.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_no_camera.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_onboarding_align.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_onboarding_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_onboarding_flat.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_onboarding_indicator_active.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_onboarding_indicator_inactive.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_onboarding_parallel.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_review_button_rotate.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-mdpi/gc_review_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_action_bar_back.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_camera_focus_indicator.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_camera_preview_corners.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_camera_trigger_default.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_camera_trigger_pressed.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_icon_onboarding.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_no_camera.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_onboarding_align.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_onboarding_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_onboarding_flat.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_onboarding_indicator_active.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_onboarding_indicator_inactive.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_onboarding_parallel.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_review_button_rotate.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xhdpi/gc_review_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_action_bar_back.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_camera_focus_indicator.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_camera_preview_corners.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_camera_trigger_default.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_camera_trigger_pressed.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_icon_onboarding.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_no_camera.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_onboarding_align.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_onboarding_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_onboarding_flat.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_onboarding_indicator_active.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_onboarding_indicator_inactive.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_onboarding_parallel.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_review_button_rotate.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxhdpi/gc_review_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_action_bar_back.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_camera_focus_indicator.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_camera_preview_corners.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_camera_trigger_default.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_camera_trigger_pressed.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_icon_onboarding.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_no_camera.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_onboarding_align.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_onboarding_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_onboarding_flat.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_onboarding_indicator_active.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_onboarding_indicator_inactive.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_onboarding_parallel.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_review_button_rotate.png delete mode 100644 capture-sdk/screen-api-example-app/customized-drawables/drawable-xxxhdpi/gc_review_fab_next.png delete mode 100644 capture-sdk/screen-api-example-app/src/debug/AndroidManifest.xml delete mode 100644 capture-sdk/screen-api-example-app/src/debug/res/xml/network_security_config.xml delete mode 100644 capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CustomHelpActivity.kt delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/layout/animation_onboarding_lottie.xml delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/layout/item_extraction.xml delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/raw/custom_loading.json delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/raw/floating_document.json delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/raw/lighting.json delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/raw/multipage.json delete mode 100644 capture-sdk/screen-api-example-app/src/main/res/raw/scan_qr_code.json diff --git a/capture-sdk/screen-api-example-app/README.md b/bank-sdk/example-app/README.md similarity index 100% rename from capture-sdk/screen-api-example-app/README.md rename to bank-sdk/example-app/README.md diff --git a/capture-sdk/screen-api-example-app/build.gradle.kts b/bank-sdk/example-app/build.gradle.kts similarity index 91% rename from capture-sdk/screen-api-example-app/build.gradle.kts rename to bank-sdk/example-app/build.gradle.kts index 0b18c60055..68995b5fcc 100644 --- a/capture-sdk/screen-api-example-app/build.gradle.kts +++ b/bank-sdk/example-app/build.gradle.kts @@ -1,4 +1,5 @@ import net.gini.gradle.* +import org.gradle.internal.impldep.org.junit.experimental.categories.Categories.CategoryFilter.exclude plugins { id("com.android.application") @@ -23,7 +24,7 @@ plugins { android { // after upgrading to AGP 8, we need this (copied from the module's AndroidManifest.xml - namespace = "net.gini.android.capture.screen" + namespace = "net.gini.android.bank.screen" compileSdk = libs.versions.android.compileSdk.get().toInt() // after upgrading to AGP 8, we need this to have the defaultConfig block @@ -31,7 +32,7 @@ android { buildConfig = true } defaultConfig { - applicationId = "net.gini.android.capture.screenapiexample" + applicationId = "net.gini.android.bank.screenapiexample" minSdk = libs.versions.android.minSdk.get().toInt() targetSdk = libs.versions.android.targetSdk.get().toInt() @@ -91,7 +92,7 @@ tasks.withType(type = org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask } dependencies { -// For testing the local version + // For testing the local version api(project(":capture-sdk:sdk")) // For testing a released version //implementation "net.gini.android:gini-capture-sdk:0.0.1" @@ -101,6 +102,11 @@ dependencies { // For testing a released version //implementation "net.gini.android:gini-capture-sdk-default-network:0.0.1" + // For testing the local version + api(project(":bank-sdk:sdk")) + // For testing a released version + //implementation "net.gini.android:gini-bank-sdk:3.3.0" + implementation(libs.androidx.appcompat) implementation(libs.androidx.activity.ktx) implementation(libs.androidx.coordinatorlayout) diff --git a/capture-sdk/screen-api-example-app/gradle.properties b/bank-sdk/example-app/gradle.properties similarity index 100% rename from capture-sdk/screen-api-example-app/gradle.properties rename to bank-sdk/example-app/gradle.properties diff --git a/capture-sdk/screen-api-example-app/proguard-rules.pro b/bank-sdk/example-app/proguard-rules.pro similarity index 100% rename from capture-sdk/screen-api-example-app/proguard-rules.pro rename to bank-sdk/example-app/proguard-rules.pro diff --git a/capture-sdk/screen-api-example-app/screen_api_example.jks b/bank-sdk/example-app/screen_api_example.jks similarity index 100% rename from capture-sdk/screen-api-example-app/screen_api_example.jks rename to bank-sdk/example-app/screen_api_example.jks diff --git a/capture-sdk/screen-api-example-app/src/androidTest/AndroidManifest.xml b/bank-sdk/example-app/src/androidTest/AndroidManifest.xml similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/AndroidManifest.xml rename to bank-sdk/example-app/src/androidTest/AndroidManifest.xml diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/Helper.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/Helper.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/Helper.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/Helper.java index 35d95f9853..285f49ddd7 100644 --- a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/Helper.java +++ b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/Helper.java @@ -1,7 +1,5 @@ package net.gini.android.capture.screen.screenshots; -import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; - import android.content.Context; import android.content.Intent; @@ -11,6 +9,8 @@ import androidx.test.uiautomator.UiSelector; import androidx.test.uiautomator.Until; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; + public class Helper { public static final long APP_START_TIMEOUT = 10_000; diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotHelper.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotHelper.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotHelper.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotHelper.java diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotsTest.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotsTest.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotsTest.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/ScreenshotsTest.java diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/Screen.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/Screen.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/Screen.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/Screen.java diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/AnalysisScreen.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/AnalysisScreen.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/AnalysisScreen.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/AnalysisScreen.java index 6b6b69f42c..c96e37814c 100644 --- a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/AnalysisScreen.java +++ b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/AnalysisScreen.java @@ -1,12 +1,12 @@ package net.gini.android.capture.screen.screenshots.screens.screenapi; -import static net.gini.android.capture.screen.screenshots.Helper.isObjectAvailable; - import net.gini.android.capture.screen.screenshots.screens.Screen; import androidx.test.uiautomator.UiDevice; import androidx.test.uiautomator.UiSelector; +import static net.gini.android.capture.screen.screenshots.Helper.isObjectAvailable; + public class AnalysisScreen implements Screen { private static final String IMAGE_RES_ID = diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/CameraScreen.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/CameraScreen.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/CameraScreen.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/CameraScreen.java diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/MainScreen.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/MainScreen.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/MainScreen.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/MainScreen.java index 7d0c20453c..e32bc744d3 100644 --- a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/MainScreen.java +++ b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/MainScreen.java @@ -1,7 +1,5 @@ package net.gini.android.capture.screen.screenshots.screens.screenapi; -import static net.gini.android.capture.screen.screenshots.Helper.isObjectAvailable; - import net.gini.android.capture.screen.screenshots.screens.Screen; import androidx.test.uiautomator.UiDevice; @@ -9,6 +7,8 @@ import androidx.test.uiautomator.UiObjectNotFoundException; import androidx.test.uiautomator.UiSelector; +import static net.gini.android.capture.screen.screenshots.Helper.isObjectAvailable; + public class MainScreen implements Screen { private static final String START_SCANNER_BUTTON_RES_ID = diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/OnboardingScreen.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/OnboardingScreen.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/OnboardingScreen.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/OnboardingScreen.java index 987fb2c14a..f39f09f046 100644 --- a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/OnboardingScreen.java +++ b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/OnboardingScreen.java @@ -1,7 +1,5 @@ package net.gini.android.capture.screen.screenshots.screens.screenapi; -import static net.gini.android.capture.screen.screenshots.Helper.isObjectAvailable; - import net.gini.android.capture.screen.screenshots.screens.Screen; import androidx.test.uiautomator.UiDevice; @@ -9,6 +7,8 @@ import androidx.test.uiautomator.UiObjectNotFoundException; import androidx.test.uiautomator.UiSelector; +import static net.gini.android.capture.screen.screenshots.Helper.isObjectAvailable; + public class OnboardingScreen implements Screen { private static final String NEXT_BUTTON_RES_ID = diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/ReviewScreen.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/ReviewScreen.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/ReviewScreen.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/ReviewScreen.java index d08a082de3..b873daafd3 100644 --- a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/ReviewScreen.java +++ b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/screenshots/screens/screenapi/ReviewScreen.java @@ -1,7 +1,5 @@ package net.gini.android.capture.screen.screenshots.screens.screenapi; -import static net.gini.android.capture.screen.screenshots.Helper.isObjectAvailable; - import net.gini.android.capture.screen.screenshots.screens.Screen; import androidx.test.uiautomator.UiDevice; @@ -9,6 +7,8 @@ import androidx.test.uiautomator.UiObjectNotFoundException; import androidx.test.uiautomator.UiSelector; +import static net.gini.android.capture.screen.screenshots.Helper.isObjectAvailable; + public class ReviewScreen implements Screen { private static final String ROTATE_BUTTON_RES_ID = diff --git a/capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/testhelper/PermissionsHelper.java b/bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/testhelper/PermissionsHelper.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/androidTest/java/net/gini/android/capture/screen/testhelper/PermissionsHelper.java rename to bank-sdk/example-app/src/androidTest/java/net/gini/android/capture/screen/testhelper/PermissionsHelper.java diff --git a/bank-sdk/screen-api-example-app/src/debug/AndroidManifest.xml b/bank-sdk/example-app/src/debug/AndroidManifest.xml similarity index 100% rename from bank-sdk/screen-api-example-app/src/debug/AndroidManifest.xml rename to bank-sdk/example-app/src/debug/AndroidManifest.xml diff --git a/bank-sdk/screen-api-example-app/src/debug/res/xml/network_security_config.xml b/bank-sdk/example-app/src/debug/res/xml/network_security_config.xml similarity index 100% rename from bank-sdk/screen-api-example-app/src/debug/res/xml/network_security_config.xml rename to bank-sdk/example-app/src/debug/res/xml/network_security_config.xml diff --git a/capture-sdk/screen-api-example-app/src/main/AndroidManifest.xml b/bank-sdk/example-app/src/main/AndroidManifest.xml similarity index 75% rename from capture-sdk/screen-api-example-app/src/main/AndroidManifest.xml rename to bank-sdk/example-app/src/main/AndroidManifest.xml index 58f95b6e5e..7cfda2491f 100644 --- a/capture-sdk/screen-api-example-app/src/main/AndroidManifest.xml +++ b/bank-sdk/example-app/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + package="net.gini.android.bank.screen"> @@ -31,13 +31,13 @@ android:required="true" /> - @@ -63,22 +63,35 @@ - - + + + + + + + + + + { class Success(val value: T) : ResultWrapper() diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/RuntimePermissionHandler.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/RuntimePermissionHandler.kt similarity index 99% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/RuntimePermissionHandler.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/RuntimePermissionHandler.kt index 14c5ad5005..a1da7461e8 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/RuntimePermissionHandler.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/RuntimePermissionHandler.kt @@ -1,4 +1,4 @@ -package net.gini.android.capture.screen.core +package net.gini.android.bank.screen.core import android.Manifest import android.annotation.SuppressLint diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/di/AppModule.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/di/AppModule.kt similarity index 66% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/di/AppModule.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/di/AppModule.kt index d003738480..6d2bfff461 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/di/AppModule.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/di/AppModule.kt @@ -1,10 +1,10 @@ -package net.gini.android.capture.screen.core.di +package net.gini.android.bank.screen.core.di import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent -import net.gini.android.capture.screen.ScreenApiExampleApp +import net.gini.android.bank.screen.ExampleApp import org.slf4j.Logger import org.slf4j.LoggerFactory import javax.inject.Singleton @@ -16,6 +16,6 @@ class AppModule { @Singleton @Provides fun bindScreenApiExampleAppLogger(): Logger { - return LoggerFactory.getLogger(ScreenApiExampleApp::class.java) + return LoggerFactory.getLogger(ExampleApp::class.java) } } diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/di/GiniCaptureModule.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/di/GiniExampleModule.kt similarity index 93% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/di/GiniCaptureModule.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/di/GiniExampleModule.kt index 31545d4af4..c90603cd84 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/core/di/GiniCaptureModule.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/core/di/GiniExampleModule.kt @@ -1,4 +1,4 @@ -package net.gini.android.capture.screen.core.di +package net.gini.android.bank.screen.core.di import android.content.Context import android.text.TextUtils @@ -7,15 +7,15 @@ import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.android.qualifiers.ApplicationContext import dagger.hilt.components.SingletonComponent +import net.gini.android.bank.screen.R import net.gini.android.capture.network.GiniCaptureDefaultNetworkService -import net.gini.android.capture.screen.R import net.gini.android.core.api.DocumentMetadata import org.slf4j.Logger import javax.inject.Singleton @Module @InstallIn(SingletonComponent::class) -class GiniCaptureModule { +class GiniExampleModule { @Singleton @Provides diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CameraScreenApiActivity.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CameraScreenApiActivity.kt similarity index 98% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CameraScreenApiActivity.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CameraScreenApiActivity.kt index af436e5e37..1f73357fe2 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CameraScreenApiActivity.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CameraScreenApiActivity.kt @@ -1,13 +1,13 @@ -package net.gini.android.capture.screen.ui +package net.gini.android.bank.screen.ui import android.graphics.BitmapFactory import android.graphics.Rect import android.graphics.pdf.PdfRenderer import android.net.Uri +import net.gini.android.bank.screen.R import net.gini.android.capture.Document import net.gini.android.capture.camera.CameraActivity import net.gini.android.capture.camera.CameraFragmentListener.DocumentCheckResultCallback -import net.gini.android.capture.screen.R import net.gini.android.capture.util.IntentHelper import net.gini.android.capture.util.UriHelper import org.slf4j.LoggerFactory diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/ConfigurationActivity.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/ConfigurationActivity.kt similarity index 96% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/ConfigurationActivity.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/ConfigurationActivity.kt index 44029bc38b..c9c2d359da 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/ConfigurationActivity.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/ConfigurationActivity.kt @@ -1,4 +1,4 @@ -package net.gini.android.capture.screen.ui +package net.gini.android.bank.screen.ui import android.app.Activity import android.content.Intent @@ -13,14 +13,14 @@ import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.launch +import net.gini.android.bank.screen.R +import net.gini.android.bank.screen.databinding.ActivityConfigurationBinding +import net.gini.android.bank.screen.ui.MainActivity.Companion.CAMERA_PERMISSION_BUNDLE +import net.gini.android.bank.screen.ui.MainActivity.Companion.CONFIGURATION_BUNDLE +import net.gini.android.bank.screen.ui.data.Configuration import net.gini.android.capture.DocumentImportEnabledFileTypes import net.gini.android.capture.EntryPoint import net.gini.android.capture.internal.util.ActivityHelper.interceptOnBackPressed -import net.gini.android.capture.screen.R -import net.gini.android.capture.screen.databinding.ActivityConfigurationBinding -import net.gini.android.capture.screen.ui.MainActivity.Companion.CAMERA_PERMISSION_BUNDLE -import net.gini.android.capture.screen.ui.MainActivity.Companion.CONFIGURATION_BUNDLE -import net.gini.android.capture.screen.ui.data.Configuration @AndroidEntryPoint class ConfigurationActivity : AppCompatActivity() { @@ -191,6 +191,9 @@ class ConfigurationActivity : AppCompatActivity() { else -> R.id.btn_buttonEntryPoint } binding.toggleBtnEntryPoint.check(checkedEntryPointButtonId) + + // 31 enable return reasons dialog + binding.switchEnableReturnReasonsDialog.isChecked = configuration.enableReturnReasons } private fun setConfigurationFeatures() { @@ -501,6 +504,15 @@ class ConfigurationActivity : AppCompatActivity() { ) } + // 31 enable return reasons dialog + binding.switchEnableReturnReasonsDialog.setOnCheckedChangeListener { _, isChecked -> + configurationViewModel.setConfiguration( + configurationViewModel.configurationFlow.value.copy( + enableReturnReasons = isChecked + ) + ) + } + } } \ No newline at end of file diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/ConfigurationViewModel.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/ConfigurationViewModel.kt similarity index 56% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/ConfigurationViewModel.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/ConfigurationViewModel.kt index 3e5a8da417..e0e210f11a 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/ConfigurationViewModel.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/ConfigurationViewModel.kt @@ -1,25 +1,28 @@ -package net.gini.android.capture.screen.ui +package net.gini.android.bank.screen.ui +import android.content.Context import android.content.Intent import androidx.lifecycle.ViewModel import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow -import net.gini.android.capture.GiniCapture +import net.gini.android.bank.screen.R +import net.gini.android.bank.screen.ui.adapters.CustomCameraNavigationBarBottomAdapter +import net.gini.android.bank.screen.ui.adapters.CustomHelpNavigationBarBottomAdapter +import net.gini.android.bank.screen.ui.adapters.CustomNavigationBarTopAdapter +import net.gini.android.bank.screen.ui.adapters.CustomOnButtonLoadingIndicatorAdapter +import net.gini.android.bank.screen.ui.adapters.CustomOnboardingNavigationBarBottomAdapter +import net.gini.android.bank.screen.ui.adapters.CustomReviewNavigationBarBottomAdapter +import net.gini.android.bank.screen.ui.data.Configuration +import net.gini.android.bank.sdk.GiniBank +import net.gini.android.bank.sdk.capture.CaptureConfiguration import net.gini.android.capture.help.HelpItem import net.gini.android.capture.internal.util.FileImportValidator import net.gini.android.capture.logging.ErrorLog import net.gini.android.capture.logging.ErrorLoggerListener +import net.gini.android.capture.network.GiniCaptureDefaultNetworkService import net.gini.android.capture.onboarding.DefaultPages import net.gini.android.capture.onboarding.OnboardingPage -import net.gini.android.capture.screen.R -import net.gini.android.capture.screen.ui.adapters.CustomCameraNavigationBarBottomAdapter -import net.gini.android.capture.screen.ui.adapters.CustomHelpNavigationBarBottomAdapter -import net.gini.android.capture.screen.ui.adapters.CustomNavigationBarTopAdapter -import net.gini.android.capture.screen.ui.adapters.CustomOnButtonLoadingIndicatorAdapter -import net.gini.android.capture.screen.ui.adapters.CustomOnboardingNavigationBarBottomAdapter -import net.gini.android.capture.screen.ui.adapters.CustomReviewNavigationBarBottomAdapter -import net.gini.android.capture.screen.ui.data.Configuration import net.gini.android.capture.tracking.AnalysisScreenEvent import net.gini.android.capture.tracking.CameraScreenEvent import net.gini.android.capture.tracking.Event @@ -30,7 +33,9 @@ import org.slf4j.LoggerFactory import javax.inject.Inject @HiltViewModel -class ConfigurationViewModel @Inject constructor() : ViewModel() { +class ConfigurationViewModel @Inject constructor( + private val giniCaptureDefaultNetworkService: GiniCaptureDefaultNetworkService +) : ViewModel() { private val _disableCameraPermissionFlow = MutableStateFlow(false) val disableCameraPermissionFlow: StateFlow = _disableCameraPermissionFlow @@ -46,39 +51,71 @@ class ConfigurationViewModel @Inject constructor() : ViewModel() { _configurationFlow.value = configuration } - fun configureGiniCapture(builder: GiniCapture.Builder, intent: Intent) { + fun configureGiniBank(context: Context) { + val intent = Intent(context, CustomHelpActivity::class.java) + val configuration = configurationFlow.value - // 1 file import - builder.setFileImportEnabled(configuration.isFileImportEnabled) - // 2 QR code scanning - builder.setQRCodeScanningEnabled(configuration.isQrCodeEnabled) - // 3 only QR code scanning - builder.setOnlyQRCodeScanning(configuration.isOnlyQrCodeEnabled) - // 4 enable multi page - builder.setMultiPageEnabled(configuration.isMultiPageEnabled) - // 5 enable flash toggle - builder.setFlashButtonEnabled(configuration.isFlashToggleEnabled) - // 6 enable flash on by default - builder.setFlashOnByDefault(configuration.isFlashOnByDefault) - // 7 set file import type - builder.setDocumentImportEnabledFileTypes(configuration.documentImportEnabledFileTypes) - // 8 enable bottom navigation bar - builder.setBottomNavigationBarEnabled(configuration.isBottomNavigationBarEnabled) + + var captureConfiguration = CaptureConfiguration( + networkService = giniCaptureDefaultNetworkService, + // 1 file import + fileImportEnabled = configuration.isFileImportEnabled, + // 2 QR code scanning + qrCodeScanningEnabled = configuration.isQrCodeEnabled, + // 3 only QR code scanning + onlyQRCodeScanningEnabled = configuration.isOnlyQrCodeEnabled, + // 4 enable multi page + multiPageEnabled = configuration.isMultiPageEnabled, + // 5 enable flash toggle + flashButtonEnabled = configuration.isFlashToggleEnabled, + // 6 enable flash on by default + flashOnByDefault = configuration.isFlashOnByDefault, + // 7 set file import type + documentImportEnabledFileTypes = configuration.documentImportEnabledFileTypes, + // 8 enable bottom navigation bar + bottomNavigationBarEnabled = configuration.isBottomNavigationBarEnabled, + + // 9-12 are implemented after captureConfiguration initialisation + + // 13 enable onboarding screens at first launch + showOnboardingAtFirstRun = configuration.isOnboardingAtFirstRunEnabled, + // 14 enable onboarding at every launch + showOnboarding = configuration.isOnboardingAtEveryLaunchEnabled, + + // 15-22 are implemented after captureConfiguration initialisation + + // 23 enable supported format help screen + supportedFormatsHelpScreenEnabled = configuration.isSupportedFormatsHelpScreenEnabled, + + // 24-26 are implemented after captureConfiguration initialisation + + // 27 enable Gini error logger + giniErrorLoggerIsOn = configuration.isGiniErrorLoggerEnabled, + + // 28-29 are implemented after captureConfiguration initialisation + + // 30 entry point + entryPoint = configuration.entryPoint + + ) + // 9 enable Help screens custom bottom navigation bar if (configuration.isHelpScreensCustomBottomNavBarEnabled) - builder.setHelpNavigationBarBottomAdapter(CustomHelpNavigationBarBottomAdapter()) + captureConfiguration = + captureConfiguration.copy(helpNavigationBarBottomAdapter = CustomHelpNavigationBarBottomAdapter()) + // 10 enable camera screens custom bottom navigation bar if (configuration.isCameraBottomNavBarEnabled) - builder.setCameraNavigationBarBottomAdapter(CustomCameraNavigationBarBottomAdapter()) + captureConfiguration = + captureConfiguration.copy(cameraNavigationBarBottomAdapter = CustomCameraNavigationBarBottomAdapter()) + // 11 enable review screens custom bottom navigation bar if (configuration.isReviewScreenCustomBottomNavBarEnabled) - builder.setReviewBottomBarNavigationAdapter(CustomReviewNavigationBarBottomAdapter()) + captureConfiguration = + captureConfiguration.copy(reviewNavigationBarBottomAdapter = CustomReviewNavigationBarBottomAdapter()) + // 12 enable image picker screens custom bottom navigation bar -> was implemented on iOS, not needed for Android - // 13 enable onboarding screens at first launch - builder.setShouldShowOnboardingAtFirstRun(configuration.isOnboardingAtFirstRunEnabled) - // 14 enable onboarding at every launch - builder.setShouldShowOnboarding(configuration.isOnboardingAtEveryLaunchEnabled) // 15 enable custom onboarding pages if (configuration.isCustomOnboardingPagesEnabled) { val pages = DefaultPages.asArrayList( @@ -92,62 +129,68 @@ class ConfigurationViewModel @Inject constructor() : ViewModel() { null ) ) - builder.setCustomOnboardingPages(pages) + + captureConfiguration = + captureConfiguration.copy(onboardingPages = pages) } + // 16 enable align corners in custom onboarding pages if (configuration.isAlignCornersInCustomOnboardingEnabled) { - builder.setOnboardingAlignCornersIllustrationAdapter( - CustomOnboardingIllustrationAdapter( + captureConfiguration = captureConfiguration.copy( + onboardingAlignCornersIllustrationAdapter = CustomOnboardingIllustrationAdapter( R.raw.floating_document ) ) } + // 17 enable lighting in custom onboarding pages if (configuration.isLightingInCustomOnboardingEnabled) { - builder.setOnboardingLightingIllustrationAdapter( - CustomOnboardingIllustrationAdapter( + captureConfiguration = captureConfiguration.copy( + onboardingLightingIllustrationAdapter = CustomOnboardingIllustrationAdapter( R.raw.lighting ) ) } + // 18 enable QR code in custom onboarding pages if (configuration.isQRCodeInCustomOnboardingEnabled) { - builder.setOnboardingQRCodeIllustrationAdapter( - CustomOnboardingIllustrationAdapter( + captureConfiguration = captureConfiguration.copy( + onboardingQRCodeIllustrationAdapter = CustomOnboardingIllustrationAdapter( R.raw.scan_qr_code ) ) } + // 19 enable multi page in custom onboarding pages if (configuration.isMultiPageInCustomOnboardingEnabled) { - builder.setOnboardingMultiPageIllustrationAdapter( - CustomOnboardingIllustrationAdapter( + captureConfiguration = captureConfiguration.copy( + onboardingMultiPageIllustrationAdapter = CustomOnboardingIllustrationAdapter( R.raw.multipage ) ) } + // 20 enable custom navigation bar in custom onboarding pages if (configuration.isCustomNavigationBarInCustomOnboardingEnabled) - builder.setOnboardingNavigationBarBottomAdapter( - CustomOnboardingNavigationBarBottomAdapter() + captureConfiguration = captureConfiguration.copy( + onboardingNavigationBarBottomAdapter = CustomOnboardingNavigationBarBottomAdapter() ) // 21 enable button's custom loading indicator if (configuration.isButtonsCustomLoadingIndicatorEnabled) { - builder.setOnButtonLoadingIndicatorAdapter( - CustomOnButtonLoadingIndicatorAdapter() + captureConfiguration = captureConfiguration.copy( + onButtonLoadingIndicatorAdapter = CustomOnButtonLoadingIndicatorAdapter() ) } + // 22 enable screen's custom loading indicator if (configuration.isScreenCustomLoadingIndicatorEnabled) { - builder.setLoadingIndicatorAdapter( - CustomLottiLoadingIndicatorAdapter( + captureConfiguration = captureConfiguration.copy( + customLoadingIndicatorAdapter = CustomLottiLoadingIndicatorAdapter( R.raw.custom_loading ) ) } - // 23 enable supported format help screen - builder.setSupportedFormatsHelpScreenEnabled(configuration.isSupportedFormatsHelpScreenEnabled) // 24 enable custom help items if (configuration.isCustomHelpItemsEnabled) { @@ -158,27 +201,41 @@ class ConfigurationViewModel @Inject constructor() : ViewModel() { intent ) ) - builder.setCustomHelpItems(customHelpItems) + captureConfiguration = captureConfiguration.copy( + customHelpItems = customHelpItems + ) } // 25 enable custom navigation bar if (configuration.isCustomNavBarEnabled) - builder.setNavigationBarTopAdapter(CustomNavigationBarTopAdapter()) + captureConfiguration = captureConfiguration.copy( + navigationBarTopAdapter = CustomNavigationBarTopAdapter() + ) // 26 enable event tracker if (configuration.isEventTrackerEnabled) - builder.setEventTracker(GiniCaptureEventTracker()) - // 27 enable Gini error logger - builder.setGiniErrorLoggerIsOn(configuration.isGiniErrorLoggerEnabled) + captureConfiguration = captureConfiguration.copy( + eventTracker = GiniCaptureEventTracker() + ) + // 28 enable custom error logger if (configuration.isCustomErrorLoggerEnabled) - builder.setCustomErrorLoggerListener(CustomErrorLoggerListener()) + captureConfiguration = captureConfiguration.copy( + errorLoggerListener = CustomErrorLoggerListener() + ) + // 29 set imported file size bytes limit if (configuration.importedFileSizeBytesLimit != FileImportValidator.FILE_SIZE_LIMIT && configuration.importedFileSizeBytesLimit >= 0) - builder.importedFileSizeBytesLimit = configuration.importedFileSizeBytesLimit + captureConfiguration = captureConfiguration.copy( + importedFileSizeBytesLimit = configuration.importedFileSizeBytesLimit + ) + + GiniBank.setCaptureConfiguration(context, captureConfiguration) + + + GiniBank.enableReturnReasons = configuration.enableReturnReasons + - builder.setEntryPoint(configuration.entryPoint) - builder.build() } private class GiniCaptureEventTracker : EventTracker { diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomHelpActivity.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CustomHelpActivity.kt similarity index 88% rename from bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomHelpActivity.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CustomHelpActivity.kt index 4014eb8670..ffdc61a4d3 100644 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomHelpActivity.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CustomHelpActivity.kt @@ -1,8 +1,9 @@ -package net.gini.android.bank.sdk.screenapiexample +package net.gini.android.bank.screen.ui import android.os.Bundle import android.view.MenuItem import androidx.appcompat.app.AppCompatActivity +import net.gini.android.bank.screen.R class CustomHelpActivity : AppCompatActivity() { diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CustomLottiLoadingIndicatorAdapter.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CustomLottiLoadingIndicatorAdapter.kt similarity index 90% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CustomLottiLoadingIndicatorAdapter.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CustomLottiLoadingIndicatorAdapter.kt index c0e53b7892..2b851d0d4f 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CustomLottiLoadingIndicatorAdapter.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CustomLottiLoadingIndicatorAdapter.kt @@ -1,10 +1,10 @@ -package net.gini.android.capture.screen.ui +package net.gini.android.bank.screen.ui import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.annotation.RawRes -import net.gini.android.capture.screen.databinding.AnimationOnboardingLottieBinding +import net.gini.android.bank.screen.databinding.AnimationOnboardingLottieBinding import net.gini.android.capture.view.CustomLoadingIndicatorAdapter class CustomLottiLoadingIndicatorAdapter(@RawRes val animationRes: Int) : CustomLoadingIndicatorAdapter { diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CustomOnboardingIllustrationAdapter.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CustomOnboardingIllustrationAdapter.kt similarity index 93% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CustomOnboardingIllustrationAdapter.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CustomOnboardingIllustrationAdapter.kt index 5668916e16..b68f054c9f 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/CustomOnboardingIllustrationAdapter.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/CustomOnboardingIllustrationAdapter.kt @@ -1,4 +1,4 @@ -package net.gini.android.capture.screen.ui +package net.gini.android.bank.screen.ui import android.os.Parcel import android.os.Parcelable @@ -6,8 +6,8 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.annotation.RawRes +import net.gini.android.bank.screen.databinding.AnimationOnboardingLottieBinding import net.gini.android.capture.onboarding.view.OnboardingIllustrationAdapter -import net.gini.android.capture.screen.databinding.AnimationOnboardingLottieBinding /** * Created by Alpár Szotyori on 13.05.22. diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/ExtractionsActivity.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/ExtractionsActivity.kt similarity index 98% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/ExtractionsActivity.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/ExtractionsActivity.kt index 44df8e036b..0b98982129 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/ExtractionsActivity.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/ExtractionsActivity.kt @@ -1,4 +1,4 @@ -package net.gini.android.capture.screen.ui +package net.gini.android.bank.screen.ui import android.app.Activity import android.content.Intent @@ -18,14 +18,14 @@ import androidx.recyclerview.widget.RecyclerView import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputLayout import dagger.hilt.android.AndroidEntryPoint +import net.gini.android.bank.screen.R +import net.gini.android.bank.screen.databinding.ActivityExtractionsBinding import net.gini.android.capture.Amount import net.gini.android.capture.AmountCurrency import net.gini.android.capture.GiniCapture import net.gini.android.capture.network.GiniCaptureDefaultNetworkService import net.gini.android.capture.network.model.GiniCaptureCompoundExtraction import net.gini.android.capture.network.model.GiniCaptureSpecificExtraction -import net.gini.android.capture.screen.R -import net.gini.android.capture.screen.databinding.ActivityExtractionsBinding import net.gini.android.core.api.models.SpecificExtraction import org.slf4j.LoggerFactory import java.io.File diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/MainActivity.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/MainActivity.kt similarity index 93% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/MainActivity.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/MainActivity.kt index 75acf60f18..89b4ef5c1a 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/MainActivity.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/MainActivity.kt @@ -1,4 +1,4 @@ -package net.gini.android.capture.screen.ui +package net.gini.android.bank.screen.ui import android.annotation.SuppressLint import android.content.Intent @@ -13,6 +13,13 @@ import ch.qos.logback.classic.android.LogcatAppender import ch.qos.logback.classic.encoder.PatternLayoutEncoder import com.google.android.material.dialog.MaterialAlertDialogBuilder import dagger.hilt.android.AndroidEntryPoint +import net.gini.android.bank.screen.ExampleApp +import net.gini.android.bank.screen.R +import net.gini.android.bank.screen.core.ExampleUtil +import net.gini.android.bank.screen.core.RuntimePermissionHandler +import net.gini.android.bank.screen.databinding.ActivityMainBinding +import net.gini.android.bank.screen.ui.data.Configuration +import net.gini.android.bank.sdk.GiniBank import net.gini.android.capture.AsyncCallback import net.gini.android.capture.BuildConfig import net.gini.android.capture.GiniCapture @@ -23,12 +30,6 @@ import net.gini.android.capture.camera.CameraActivity import net.gini.android.capture.network.GiniCaptureDefaultNetworkService import net.gini.android.capture.requirements.GiniCaptureRequirements import net.gini.android.capture.requirements.RequirementsReport -import net.gini.android.capture.screen.R -import net.gini.android.capture.screen.ScreenApiExampleApp -import net.gini.android.capture.screen.core.ExampleUtil -import net.gini.android.capture.screen.core.RuntimePermissionHandler -import net.gini.android.capture.screen.databinding.ActivityMainBinding -import net.gini.android.capture.screen.ui.data.Configuration import net.gini.android.capture.util.CancellationToken import org.slf4j.LoggerFactory import javax.inject.Inject @@ -57,6 +58,17 @@ class MainActivity : AppCompatActivity() { binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root) +// TODO: enable this feature +// if (binding.enableCustomIllustration.isChecked) +// GiniBank.digitalInvoiceOnboardingIllustrationAdapter = +// CustomOnboardingIllustrationAdapter( +// this.resources.getIdentifier( +// "ai_animation", +// "raw", +// this.packageName +// ) +// ) + addInputHandlers() setGiniCaptureSdkDebugging() showVersions() @@ -215,14 +227,10 @@ class MainActivity : AppCompatActivity() { } private fun configureGiniCapture() { - val app = application as ScreenApiExampleApp + val app = application as ExampleApp app.clearGiniCaptureNetworkInstances() - val builder = GiniCapture.newInstance(this).setGiniCaptureNetworkService( - giniCaptureDefaultNetworkService - ) - val intent = Intent(this, CustomHelpActivity::class.java) - configurationViewModel.configureGiniCapture(builder, intent) + configurationViewModel.configureGiniBank(this) } private fun showUnfulfilledRequirementsToast(report: RequirementsReport) { diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomCameraNavigationBarBottomAdapter.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomCameraNavigationBarBottomAdapter.kt similarity index 88% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomCameraNavigationBarBottomAdapter.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomCameraNavigationBarBottomAdapter.kt index 2022f5df9c..f2dab62a76 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomCameraNavigationBarBottomAdapter.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomCameraNavigationBarBottomAdapter.kt @@ -1,10 +1,10 @@ -package net.gini.android.capture.screen.ui.adapters +package net.gini.android.bank.screen.ui.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import net.gini.android.bank.screen.databinding.CustomCameraNavigationBarBottomBinding import net.gini.android.capture.camera.view.CameraNavigationBarBottomAdapter -import net.gini.android.capture.screen.databinding.CustomCameraNavigationBarBottomBinding class CustomCameraNavigationBarBottomAdapter: CameraNavigationBarBottomAdapter { var viewBinding: CustomCameraNavigationBarBottomBinding? = null diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomHelpNavigationBarBottomAdapter.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomHelpNavigationBarBottomAdapter.kt similarity index 85% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomHelpNavigationBarBottomAdapter.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomHelpNavigationBarBottomAdapter.kt index 6c43a5e187..8d34c58bb2 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomHelpNavigationBarBottomAdapter.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomHelpNavigationBarBottomAdapter.kt @@ -1,10 +1,10 @@ -package net.gini.android.capture.screen.ui.adapters +package net.gini.android.bank.screen.ui.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import net.gini.android.bank.screen.databinding.CustomHelpNavigationBarBottomBinding import net.gini.android.capture.help.view.HelpNavigationBarBottomAdapter -import net.gini.android.capture.screen.databinding.CustomHelpNavigationBarBottomBinding class CustomHelpNavigationBarBottomAdapter : HelpNavigationBarBottomAdapter { diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomNavigationBarTopAdapter.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomNavigationBarTopAdapter.kt similarity index 96% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomNavigationBarTopAdapter.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomNavigationBarTopAdapter.kt index cf1a8cab78..9a3a62c2a5 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomNavigationBarTopAdapter.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomNavigationBarTopAdapter.kt @@ -1,4 +1,4 @@ -package net.gini.android.capture.screen.ui.adapters +package net.gini.android.bank.screen.ui.adapters import android.view.LayoutInflater import android.view.View @@ -6,9 +6,9 @@ import android.view.ViewGroup import androidx.annotation.ColorInt import androidx.appcompat.widget.Toolbar import androidx.core.content.ContextCompat +import net.gini.android.bank.screen.databinding.CustomNavigationBarTopBinding import net.gini.android.capture.GiniCapture import net.gini.android.capture.R -import net.gini.android.capture.screen.databinding.CustomNavigationBarTopBinding import net.gini.android.capture.view.NavButtonType import net.gini.android.capture.view.NavigationBarTopAdapter diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomOnButtonLoadingIndicatorAdapter.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomOnButtonLoadingIndicatorAdapter.kt similarity index 95% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomOnButtonLoadingIndicatorAdapter.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomOnButtonLoadingIndicatorAdapter.kt index 14ba9a2d50..5c30395759 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomOnButtonLoadingIndicatorAdapter.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomOnButtonLoadingIndicatorAdapter.kt @@ -1,4 +1,4 @@ -package net.gini.android.capture.screen.ui.adapters +package net.gini.android.bank.screen.ui.adapters import android.content.res.ColorStateList import android.graphics.PorterDuff diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomOnboardingNavigationBarBottomAdapter.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomOnboardingNavigationBarBottomAdapter.kt similarity index 91% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomOnboardingNavigationBarBottomAdapter.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomOnboardingNavigationBarBottomAdapter.kt index a830f63a4f..ca6e3b74a0 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomOnboardingNavigationBarBottomAdapter.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomOnboardingNavigationBarBottomAdapter.kt @@ -1,13 +1,12 @@ -package net.gini.android.capture.screen.ui.adapters +package net.gini.android.bank.screen.ui.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import net.gini.android.bank.screen.databinding.CustomOnboardingNavigationBarBottomBinding import net.gini.android.capture.R -import net.gini.android.capture.databinding.GcOnboardingNavigationBarBottomBinding import net.gini.android.capture.onboarding.view.OnboardingNavigationBarBottomAdapter import net.gini.android.capture.onboarding.view.OnboardingNavigationBarBottomButton -import net.gini.android.capture.screen.databinding.CustomOnboardingNavigationBarBottomBinding class CustomOnboardingNavigationBarBottomAdapter : OnboardingNavigationBarBottomAdapter { diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomReviewNavigationBarBottomAdapter.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomReviewNavigationBarBottomAdapter.kt similarity index 94% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomReviewNavigationBarBottomAdapter.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomReviewNavigationBarBottomAdapter.kt index d782da8d41..9122b6b3cd 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/adapters/CustomReviewNavigationBarBottomAdapter.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/adapters/CustomReviewNavigationBarBottomAdapter.kt @@ -1,11 +1,11 @@ -package net.gini.android.capture.screen.ui.adapters +package net.gini.android.bank.screen.ui.adapters import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import net.gini.android.bank.screen.databinding.CustomReviewNavigationBarBottomBinding import net.gini.android.capture.GiniCapture import net.gini.android.capture.review.multipage.view.ReviewNavigationBarBottomAdapter -import net.gini.android.capture.screen.databinding.CustomReviewNavigationBarBottomBinding import net.gini.android.capture.view.InjectedViewAdapterHolder import net.gini.android.capture.view.OnButtonLoadingIndicatorAdapter diff --git a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/data/Configuration.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/data/Configuration.kt similarity index 98% rename from capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/data/Configuration.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/data/Configuration.kt index 99f83de501..586d011f45 100644 --- a/capture-sdk/screen-api-example-app/src/main/java/net/gini/android/capture/screen/ui/data/Configuration.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/data/Configuration.kt @@ -1,4 +1,4 @@ -package net.gini.android.capture.screen.ui.data +package net.gini.android.bank.screen.ui.data import android.os.Parcelable import kotlinx.parcelize.Parcelize @@ -131,4 +131,7 @@ data class Configuration( // 30 entry point val entryPoint: EntryPoint = EntryPoint.BUTTON, + // 31 enable return reasons + val enableReturnReasons: Boolean = true, + ) : Parcelable diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayActivity.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayActivity.kt similarity index 83% rename from bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayActivity.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayActivity.kt index b3c1923509..4e1862f541 100644 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayActivity.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayActivity.kt @@ -1,22 +1,22 @@ -package net.gini.android.bank.sdk.screenapiexample.pay +package net.gini.android.bank.screen.ui.pay import android.os.Bundle import android.widget.Toast +import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.core.view.isVisible import androidx.lifecycle.lifecycleScope -import net.gini.android.core.api.models.PaymentRequest import net.gini.android.bank.api.models.ResolvePaymentInput -import net.gini.android.bank.sdk.screenapiexample.databinding.ActivityPayBinding -import net.gini.android.bank.sdk.screenapiexample.util.ResultWrapper +import net.gini.android.bank.screen.core.ResultWrapper +import net.gini.android.bank.screen.databinding.ActivityPayBinding import net.gini.android.bank.sdk.pay.getRequestId -import org.koin.androidx.viewmodel.ext.android.viewModel +import net.gini.android.core.api.models.PaymentRequest class PayActivity : AppCompatActivity() { - // Replace PayViewModelKotlin with PayViewModelJava to try out + // Replace PayViewModel with PayViewModelJava to try out // using the GiniBank suspending functions from Java - private val viewModel: PayViewModelKotlin by viewModel() + private val payViewModel: PayViewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -25,13 +25,13 @@ class PayActivity : AppCompatActivity() { try { val requestId = getRequestId(intent) - viewModel.fetchPaymentRequest(requestId) + payViewModel.fetchPaymentRequest(requestId) } catch (throwable: IllegalStateException) { Toast.makeText(this@PayActivity, throwable.message, Toast.LENGTH_LONG).show() } lifecycleScope.launchWhenStarted { - viewModel.paymentRequest.collect { result -> + payViewModel.paymentRequest.collect { result -> binding.progress.isVisible = result is ResultWrapper.Loading when (result) { is ResultWrapper.Success -> { @@ -48,7 +48,7 @@ class PayActivity : AppCompatActivity() { } lifecycleScope.launchWhenStarted { - viewModel.paymentState.collect { result -> + payViewModel.paymentState.collect { result -> binding.progress.isVisible = result is ResultWrapper.Loading when (result) { is ResultWrapper.Success -> { @@ -68,12 +68,12 @@ class PayActivity : AppCompatActivity() { binding.resolvePayment.setOnClickListener { binding.disablePaymentDetails() - viewModel.onPay(binding.getPaymentDetails()) + payViewModel.onPay(binding.getPaymentDetails()) } binding.returnToPaymentInitiatorApp.setOnClickListener { try { - viewModel.returnToPaymentInitiatorApp(this@PayActivity) + payViewModel.returnToPaymentInitiatorApp(this@PayActivity) } catch (t: Throwable) { Toast.makeText(this@PayActivity, t.message, Toast.LENGTH_LONG).show() } diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelKotlin.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModel.kt similarity index 89% rename from bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelKotlin.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModel.kt index 7cca096c0a..2932b6dc43 100644 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelKotlin.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModel.kt @@ -1,4 +1,4 @@ -package net.gini.android.bank.sdk.screenapiexample.pay +package net.gini.android.bank.screen.ui.pay import android.content.Context import androidx.lifecycle.ViewModel @@ -6,14 +6,14 @@ import androidx.lifecycle.viewModelScope import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch -import net.gini.android.core.api.models.PaymentRequest import net.gini.android.bank.api.models.ResolvePaymentInput import net.gini.android.bank.api.models.ResolvedPayment -import net.gini.android.bank.sdk.screenapiexample.util.ResultWrapper -import net.gini.android.bank.sdk.screenapiexample.util.wrapToResult +import net.gini.android.bank.screen.core.ResultWrapper +import net.gini.android.bank.screen.core.wrapToResult import net.gini.android.bank.sdk.GiniBank +import net.gini.android.core.api.models.PaymentRequest -class PayViewModelKotlin( +class PayViewModel( private val giniBank: GiniBank ) : ViewModel(), PayViewModelInterface { diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelInterface.kt b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModelInterface.kt similarity index 84% rename from bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelInterface.kt rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModelInterface.kt index 930f96ed1a..2bcecd896f 100644 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelInterface.kt +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModelInterface.kt @@ -1,11 +1,11 @@ -package net.gini.android.bank.sdk.screenapiexample.pay +package net.gini.android.bank.screen.ui.pay import android.content.Context import kotlinx.coroutines.flow.StateFlow -import net.gini.android.bank.sdk.screenapiexample.util.ResultWrapper -import net.gini.android.core.api.models.PaymentRequest import net.gini.android.bank.api.models.ResolvePaymentInput import net.gini.android.bank.api.models.ResolvedPayment +import net.gini.android.bank.screen.core.ResultWrapper +import net.gini.android.core.api.models.PaymentRequest /** * Created by Alpár Szotyori on 19.01.22. diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelJava.java b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModelJava.java similarity index 95% rename from bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelJava.java rename to bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModelJava.java index 76bfba4ee9..dafd888498 100644 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/pay/PayViewModelJava.java +++ b/bank-sdk/example-app/src/main/java/net/gini/android/bank/screen/ui/pay/PayViewModelJava.java @@ -1,18 +1,16 @@ -package net.gini.android.bank.sdk.screenapiexample.pay; +package net.gini.android.bank.screen.ui.pay; import android.content.Context; -import androidx.annotation.NonNull; -import androidx.lifecycle.ViewModel; - +import net.gini.android.bank.api.models.ResolvePaymentInput; +import net.gini.android.bank.api.models.ResolvedPayment; +import net.gini.android.bank.screen.core.ResultWrapper; import net.gini.android.bank.sdk.GiniBank; -import net.gini.android.bank.sdk.error.AmountParsingException; -import net.gini.android.bank.sdk.screenapiexample.util.ResultWrapper; import net.gini.android.bank.sdk.util.CoroutineContinuationHelper; import net.gini.android.core.api.models.PaymentRequest; -import net.gini.android.bank.api.models.ResolvePaymentInput; -import net.gini.android.bank.api.models.ResolvedPayment; +import androidx.annotation.NonNull; +import androidx.lifecycle.ViewModel; import kotlinx.coroutines.flow.MutableStateFlow; import kotlinx.coroutines.flow.StateFlow; import kotlinx.coroutines.flow.StateFlowKt; diff --git a/capture-sdk/screen-api-example-app/src/main/res/drawable/additional_onboarding_illustration.xml b/bank-sdk/example-app/src/main/res/drawable/additional_onboarding_illustration.xml similarity index 100% rename from capture-sdk/screen-api-example-app/src/main/res/drawable/additional_onboarding_illustration.xml rename to bank-sdk/example-app/src/main/res/drawable/additional_onboarding_illustration.xml diff --git a/capture-sdk/screen-api-example-app/src/main/res/drawable/edittext_selector.xml b/bank-sdk/example-app/src/main/res/drawable/edittext_selector.xml similarity index 100% rename from capture-sdk/screen-api-example-app/src/main/res/drawable/edittext_selector.xml rename to bank-sdk/example-app/src/main/res/drawable/edittext_selector.xml diff --git a/capture-sdk/screen-api-example-app/src/main/res/layout/activity_configuration.xml b/bank-sdk/example-app/src/main/res/layout/activity_configuration.xml similarity index 91% rename from capture-sdk/screen-api-example-app/src/main/res/layout/activity_configuration.xml rename to bank-sdk/example-app/src/main/res/layout/activity_configuration.xml index dce24c9a59..42da18d4d8 100644 --- a/capture-sdk/screen-api-example-app/src/main/res/layout/activity_configuration.xml +++ b/bank-sdk/example-app/src/main/res/layout/activity_configuration.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="net.gini.android.capture.screen.ui.ConfigurationActivity"> + tools:context="net.gini.android.bank.screen.ui.ConfigurationActivity"> @@ -80,7 +80,7 @@ @@ -109,8 +109,7 @@ @@ -151,14 +150,14 @@ @@ -172,7 +171,7 @@ + + + tools:context=".ui.ExtractionsActivity"> + tools:context=".ui.MainActivity"> 16dp 16dp + 16dp + diff --git a/capture-sdk/screen-api-example-app/src/main/res/values/strings.xml b/bank-sdk/example-app/src/main/res/values/strings.xml similarity index 95% rename from capture-sdk/screen-api-example-app/src/main/res/values/strings.xml rename to bank-sdk/example-app/src/main/res/values/strings.xml index 31740a05e6..aedbf8f133 100644 --- a/capture-sdk/screen-api-example-app/src/main/res/values/strings.xml +++ b/bank-sdk/example-app/src/main/res/values/strings.xml @@ -43,7 +43,7 @@ Example Please relaunch the app to use the default GiniConfiguration values. The configuration changes will take effect after closing this screen. - File Import + File import QR code scanning QR code scanning only This will work if the \'Qr code scanning\' switch is also enabled. @@ -88,6 +88,7 @@ Custom navigation controller Event tracker + Return reasons dialog Gini error logger Custom error logger Imported File Size Bytes Limit @@ -96,7 +97,12 @@ Button Field - + recipient + IBAN + Amount + Purpose + Return to Business + Pay diff --git a/capture-sdk/screen-api-example-app/src/main/res/values/styles.xml b/bank-sdk/example-app/src/main/res/values/styles.xml similarity index 95% rename from capture-sdk/screen-api-example-app/src/main/res/values/styles.xml rename to bank-sdk/example-app/src/main/res/values/styles.xml index 257b889e4e..ea6da63cc1 100644 --- a/capture-sdk/screen-api-example-app/src/main/res/values/styles.xml +++ b/bank-sdk/example-app/src/main/res/values/styles.xml @@ -13,6 +13,10 @@ @color/white + + diff --git a/capture-sdk/screen-api-example-app/src/main/res/xml/filepaths.xml b/bank-sdk/example-app/src/main/res/xml/filepaths.xml similarity index 100% rename from capture-sdk/screen-api-example-app/src/main/res/xml/filepaths.xml rename to bank-sdk/example-app/src/main/res/xml/filepaths.xml diff --git a/capture-sdk/screen-api-example-app/src/test/java/net/gini/android/capture/screen/ExampleUnitTest.java b/bank-sdk/example-app/src/test/java/net/gini/android/capture/screen/ExampleUnitTest.java similarity index 100% rename from capture-sdk/screen-api-example-app/src/test/java/net/gini/android/capture/screen/ExampleUnitTest.java rename to bank-sdk/example-app/src/test/java/net/gini/android/capture/screen/ExampleUnitTest.java diff --git a/bank-sdk/screen-api-example-app/build.gradle.kts b/bank-sdk/screen-api-example-app/build.gradle.kts deleted file mode 100644 index 050d0660f1..0000000000 --- a/bank-sdk/screen-api-example-app/build.gradle.kts +++ /dev/null @@ -1,92 +0,0 @@ -import net.gini.gradle.* - -plugins { - id("com.android.application") - kotlin("android") -} - -// TODO: construct version code and name in fastlane and inject them - -android { - namespace = "net.gini.android.bank.sdk.screenapiexample" - compileSdk = libs.versions.android.compileSdk.get().toInt() - - // after upgrading to AGP 8, we need this to have the defaultConfig block - buildFeatures { - buildConfig = true - } - defaultConfig { - applicationId = "net.gini.android.bank.sdk.screenapiexample" - - minSdk = libs.versions.android.minSdk.get().toInt() - targetSdk = libs.versions.android.targetSdk.get().toInt() - - versionName = version as String - versionCode = (properties["versionCode"] as? String)?.toInt() ?: 0 - - multiDexEnabled = true - } - - buildFeatures { - viewBinding = true - } - - signingConfigs { - create("release") { - storeFile = file(properties["releaseKeystoreFile"] ?: "") - storePassword = (properties["releaseKeystorePassword"] as? String) ?: "" - keyAlias = (properties["releaseKeyAlias"] as? String) ?: "" - keyPassword = (properties["releaseKeyPassword"] as? String) ?: "" - } - } - - buildTypes { - val credentials = readLocalPropertiesToMapSilent(project, listOf("clientId", "clientSecret")) - - debug { - resValue("string", "gini_api_client_id", credentials["clientId"] ?: "") - resValue("string", "gini_api_client_secret", credentials["clientSecret"] ?: "") - } - release { - isMinifyEnabled = true - proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") - - signingConfig = signingConfigs.getByName("release") - - resValue("string", "gini_api_client_id", credentials["clientId"] ?: "") - resValue("string", "gini_api_client_secret", credentials["clientSecret"] ?: "") - } - } - - compileOptions { - sourceCompatibility(JavaVersion.VERSION_1_8) - targetCompatibility(JavaVersion.VERSION_1_8) - } - kotlinOptions { - jvmTarget = "1.8" - } -} - -dependencies { - implementation(project(":bank-sdk:sdk")) - - implementation(libs.androidx.appcompat) - implementation(libs.androidx.activity.ktx) - implementation(libs.androidx.fragment.ktx) - implementation(libs.material) - implementation(libs.koin.androidx.scope) - implementation(libs.koin.androidx.viewmodel) - implementation(libs.koin.androidx.fragment) - implementation(libs.logback.android.core) - implementation(libs.logback.android.classic) { - // workaround issue #73 - exclude(group = "com.google.android", module = "android") - } - - implementation(libs.lottie) - - testImplementation(libs.junit) - - androidTestImplementation(libs.androidx.test.junit.ktx) - androidTestImplementation(libs.androidx.test.espresso.core) -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/gradle.properties b/bank-sdk/screen-api-example-app/gradle.properties deleted file mode 100644 index 7ffbd1c303..0000000000 --- a/bank-sdk/screen-api-example-app/gradle.properties +++ /dev/null @@ -1,11 +0,0 @@ -version=1.0.0 -versionCode=1 - -# Signing -releaseKeystoreFile=component_api_example.jks -releaseKeystorePassword=*** -releaseKeyAlias=component_api_example -releaseKeyPassword=*** - -# Android -android.useAndroidX=true \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/proguard-rules.pro b/bank-sdk/screen-api-example-app/proguard-rules.pro deleted file mode 100644 index 481bb43481..0000000000 --- a/bank-sdk/screen-api-example-app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/screen_api_example.jks b/bank-sdk/screen-api-example-app/screen_api_example.jks deleted file mode 100644 index 26db45b78b272eaf4960ad8d8f1e8f46a491dd6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2639 zcmY+Ec{~%0AIE2AnVUv3i75Bl@N9}4ElhG{h+KQJ+>$#RX)(D<-+kCzn|~%-}j9m^OyiRI1ywX5E!CF!BV#PIgW7T zk|CQQGGq-whAbh-T=)Lf;_?TPxqJ_0&qKcn=KbFm9}fpGmkioNkU?7rMKI6*<-_AJ z5Y#}N+u=Tz6QQ6bX;}(G0_t0j z%_el2&CpiO-8wxn8{c12PhNG&l2l5B(M2ZF6HGQGX<}^e=UX3FotrzBs(e{`jSn|7 z`}G5RQWW~~QuIu{W(!=pB%X^Szd&!Tjk`}>C_+ItZwWub#Rlw`W*1;+!SLt$vf!2v zHwE3FbwX>5-Rg<_Z$?Y>?l)D@2+dG+fzgVa4iQIlmbx*gHl!o#tA0OtKU8H0lJ@Y~ z;D-+nme0u1zpjy-Tl56ftMT!^n*2*m!3Ldzx=Re5^1{+yw{bz8dTJ%_M$F4>wJ(+9 z8c`ZIFx%oAtbVgUlQIFY;&4Ryvmiy%aiewxuA#GyFnA?X+t19F9!ggzOQ7_Ip%s-f zzM1SXwws<=S@1*O4h(iWfLGV1nCgi%zY?3VCJzY16u z?o)?olh|bFk$2?k`ngDvcIFP$>&O@aD|Sxn+jo6zj=GnVPto+P^b(0r<0us*loh8q z;{$|VkC2+6_uup#12&z;*k@fltL)m%fBoGHDP~#b3CnBO0?T0imJjS}Z=9ZkZm3XT zRx<4&Vwy1#tV>?Wd&_z|T-QarR^oegOPHt;qQUt@xm#DkJ+lGIlbJ4*RLsF;$6UHH zA|V({wv@?^jH{cJYYgPWKY|08uUk(F6V5xdYUoF;n*+8rgO;mUzGEXU=3n;2Iqm4| zw)xplYAXrG%DnM~-WA!>v?y_>w%Cu{ST;QCs@$paxcS5pnCn5e_mD@SfH=s7tYxLD z@*~hlqa}ZOy$i|xBaQRvaPNc&SO|RCIXm!~fZF13S{13*BzbG%n+HF4?)iShQN^Qb z=O1)ZrVV@ZM{s3jVxl=j>4jh7q)mOP&nKc!bVwD%e~f9#-~2>Y)D=78m<+A^NEi8_ z($^j}_hLg&gN4ep=ey^&96g5vSK4(wD?8@$SZ3}XN)>NGZFr26 z4#|+24v*b_pWMa2$XdGX(R8Uym+v$euG>%b$f-&?Z3UDw_x87m+dZ$RFY=EzOMiRsn=Ny8 zOH_f~pj4Zkf{XOd{V{;C5S?omuvDN%IKpLqMO73wEjf-WT}jXPQ^JB*Foh*9rorc0 z`WuDj7^LBM0&5^eFr{;GD=eu+J0o;MR(>;4Dm?p;oG$Z{$ zO`b+E(ySQI5;2jwu(`qh3OXie7N{#lz{zxS&q+1B1({9&AgUD zcQxcSg!i;Khms|b18^8F|I^|47kR<|A+L^)41d+& zt74IfUhzk}om(ByTW9`D-bgY?XmDv?{&;8w1pnf(U(Q8OrlWCBIJzu@-GQnIX~`A~ zYo0Te`c`Uk}7py|iURQm#||D?~)2q_JdB^mXG&CYx$ z+j#b9p5S_G+P2RZk(}2zEG>!Ima5w1Mvk*g9!Qq zre!?1rbn{~rjC^&XyDk7{It_d!);#e#qUk71syYWBwl0~(2R7XyY`M&ufimdGM{^? z@rIG4fjLb4diwzO;7tm;A;xa6Nl4gBo2RJs)aT*6ge#@AK;wn)L1@@aa>dK`-$_nW z`EcZp{H43+YIA<;*FnAI32cBshg;A>U%#cN-8KZBKHs54dOF&sX@RPG zR5@KEWw(dcv{J%cW#)Uvf8{g1gLvv}82uS7sOo}OFuW1<`3?hQ^XE>9UPED*$`Z;- zB~3BNJ2ckAE*4M}>7TK2RY=apDVf)qq(-ExNM_TJ#}J68F#$9%jMZ_{t(jp zj6*|*W0V$25jzHP8!km+?VqmgwOM7D-8l}QZ&r!?(c?Yv&PK`J@7(-@is_9ua7DCx zcnrNp$oQh6_`Q*>YBc+6@9n_oe)M<*A3kSFKIQV|C6RFc>5w31oZk0_J=_Y9O+X(B zl{8!K(_KM%39or#*Su4-B05OXmdmSaF6}p|pWj~cHrj9xG9X^GLPWQY=HUaP+lM_a zrd%aF)od&?_bpv|Y@xbG5F>mR0n)%%*12uw=3I&XWlw5ZwOh&%37eByGN;mrwdjq3 zfrPc~Dpx7n9<90{38!%kDab33#SX}DJsW8ib&GfI<^FH;MPjmWV3+?3ea9I%=dm9E z^CYFt8KrL)<0n&!1tk#l%mRJ-{dO*5T(NY(1LmhRex(a^cn>~;nelYAWI~VoAlpXS zWA6)ga=q*-sm9FJ>HGy@zO92-#zC@1BX96W|9G!7)|`AC*y$#0adXH*I7U4Yd+(_2 zY&F*7PGIeTpm<_mL64`6)}2IKksQ!w!s#u%|@{|9W%)WG80aQkOSNIp!UT zMJwpI|LWbewAwo$_`2q?Owu@l4G}sB83Y8(r7XY+l;8q@px!EO@o}d(3PeZJhb89m k)l`?m$AKz=a7orH;XCbhHQ%Z7w_lq0Io}3ya!_*r0*%q+#Q*>R diff --git a/bank-sdk/screen-api-example-app/src/androidTest/java/net/gini/pay/appscreenapi/ExampleInstrumentedTest.kt b/bank-sdk/screen-api-example-app/src/androidTest/java/net/gini/pay/appscreenapi/ExampleInstrumentedTest.kt deleted file mode 100644 index 406dc2255f..0000000000 --- a/bank-sdk/screen-api-example-app/src/androidTest/java/net/gini/pay/appscreenapi/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package net.gini.pay.appscreenapi - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("net.gini.pay.appscreenapi", appContext.packageName) - } -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/AndroidManifest.xml b/bank-sdk/screen-api-example-app/src/main/AndroidManifest.xml deleted file mode 100644 index a51273d477..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CaptureEventTracker.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CaptureEventTracker.kt deleted file mode 100644 index b8ac0e22ab..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CaptureEventTracker.kt +++ /dev/null @@ -1,58 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample - -import net.gini.android.capture.tracking.AnalysisScreenEvent -import net.gini.android.capture.tracking.CameraScreenEvent -import net.gini.android.capture.tracking.Event -import net.gini.android.capture.tracking.EventTracker -import net.gini.android.capture.tracking.OnboardingScreenEvent -import net.gini.android.capture.tracking.ReviewScreenEvent -import org.slf4j.LoggerFactory - -object GiniCaptureEventTracker : EventTracker { - private val LOG = LoggerFactory.getLogger(GiniCaptureEventTracker::class.java) - - override fun onOnboardingScreenEvent(event: Event) { - when (event.type) { - OnboardingScreenEvent.START -> LOG.info("Onboarding started") - OnboardingScreenEvent.FINISH -> LOG.info("Onboarding finished") - } - } - - override fun onCameraScreenEvent(event: Event) { - when (event.type) { - CameraScreenEvent.TAKE_PICTURE -> LOG.info("Take picture") - CameraScreenEvent.HELP -> LOG.info("Show help") - CameraScreenEvent.EXIT -> LOG.info("Exit") - } - } - - override fun onReviewScreenEvent(event: Event) { - when (event.type) { - ReviewScreenEvent.NEXT -> LOG.info("Go next to analyse") - ReviewScreenEvent.BACK -> LOG.info("Go back to the camera") - ReviewScreenEvent.UPLOAD_ERROR -> { - val error = event.details[ReviewScreenEvent.UPLOAD_ERROR_DETAILS_MAP_KEY.ERROR_OBJECT] as Throwable? - LOG.info( - "Upload failed:\nmessage: {}\nerror:", - event.details[ReviewScreenEvent.UPLOAD_ERROR_DETAILS_MAP_KEY.MESSAGE], - error - ) - } - } - } - - override fun onAnalysisScreenEvent(event: Event) { - when (event.type) { - AnalysisScreenEvent.ERROR -> { - val error = event.details[AnalysisScreenEvent.ERROR_DETAILS_MAP_KEY.ERROR_OBJECT] as Throwable? - LOG.info( - "Analysis failed:\nmessage: {}\nerror:", - event.details[AnalysisScreenEvent.ERROR_DETAILS_MAP_KEY.MESSAGE], - error - ) - } - AnalysisScreenEvent.RETRY -> LOG.info("Retry analysis") - AnalysisScreenEvent.CANCEL -> LOG.info("Analysis cancelled") - } - } -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomLottiLoadingIndicatorAdapter.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomLottiLoadingIndicatorAdapter.kt deleted file mode 100644 index d65b41ced7..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomLottiLoadingIndicatorAdapter.kt +++ /dev/null @@ -1,39 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample - -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.annotation.RawRes -import net.gini.android.bank.sdk.screenapiexample.databinding.AnimationOnboardingLottieBinding -import net.gini.android.capture.view.CustomLoadingIndicatorAdapter - -class CustomLottiLoadingIndicatorAdapter(@RawRes val animationRes: Int) : CustomLoadingIndicatorAdapter { - - private var viewBinding: AnimationOnboardingLottieBinding? = null - - override fun onVisible() { - viewBinding?.animationView?.visibility = View.VISIBLE - viewBinding?.animationView?.playAnimation() - } - - override fun onHidden() { - viewBinding?.animationView?.cancelAnimation() - viewBinding?.animationView?.visibility = View.GONE - viewBinding?.animationView?.progress = 0f - } - - override fun onCreateView(container: ViewGroup): View { - - val binding = AnimationOnboardingLottieBinding.inflate(LayoutInflater.from(container.context), container, false) - viewBinding = binding - - viewBinding?.animationView?.setAnimation(animationRes) - viewBinding?.animationView?.visibility = View.GONE - - return binding.root - } - - override fun onDestroy() { - viewBinding = null - } -} diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomOnboardingIllustrationAdapter.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomOnboardingIllustrationAdapter.kt deleted file mode 100644 index bd540c7a15..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/CustomOnboardingIllustrationAdapter.kt +++ /dev/null @@ -1,63 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample - -import android.os.Parcel -import android.os.Parcelable -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.annotation.RawRes -import net.gini.android.bank.sdk.screenapiexample.databinding.AnimationOnboardingLottieBinding -import net.gini.android.capture.onboarding.view.OnboardingIllustrationAdapter - -/** - * Created by Alpár Szotyori on 13.05.22. - * - * Copyright (c) 2022 Gini GmbH. - */ -class CustomOnboardingIllustrationAdapter(@RawRes val animationRes: Int) : OnboardingIllustrationAdapter { - - private var viewBinding: AnimationOnboardingLottieBinding? = null - - constructor(parcel: Parcel) : this(parcel.readInt()) - - override fun onVisible() { - viewBinding?.animationView?.playAnimation() - } - - override fun onHidden() { - viewBinding?.animationView?.cancelAnimation() - viewBinding?.animationView?.progress = 0f - } - - override fun onCreateView(container: ViewGroup): View { - val binding = AnimationOnboardingLottieBinding.inflate(LayoutInflater.from(container.context), container, false) - viewBinding = binding - - viewBinding?.animationView?.setAnimation(animationRes) - - return binding.root - } - - override fun onDestroy() { - viewBinding = null - } - - override fun writeToParcel(parcel: Parcel, flags: Int) { - parcel.writeInt(animationRes) - } - - override fun describeContents(): Int { - return 0 - } - - companion object CREATOR : Parcelable.Creator { - override fun createFromParcel(parcel: Parcel): CustomOnboardingIllustrationAdapter { - return CustomOnboardingIllustrationAdapter(parcel) - } - - override fun newArray(size: Int): Array { - return arrayOfNulls(size) - } - } - -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/ExampleApplication.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/ExampleApplication.kt deleted file mode 100644 index 314ad30bcd..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/ExampleApplication.kt +++ /dev/null @@ -1,19 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample - -import android.app.Application -import net.gini.android.bank.sdk.screenapiexample.di.giniModule -import net.gini.android.bank.sdk.screenapiexample.di.viewModelModule -import org.koin.android.ext.koin.androidContext -import org.koin.core.context.startKoin - -class ExampleApplication : Application() { - - override fun onCreate() { - super.onCreate() - - startKoin { - androidContext(this@ExampleApplication) - modules(giniModule, viewModelModule) - } - } -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/ExtractionsActivity.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/ExtractionsActivity.kt deleted file mode 100644 index 5791de3ec8..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/ExtractionsActivity.kt +++ /dev/null @@ -1,187 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample - -import android.app.Activity -import android.content.Context -import android.content.Intent -import android.os.Bundle -import android.view.* -import android.view.inputmethod.InputMethodManager -import android.widget.EditText -import android.widget.TextView -import androidx.activity.OnBackPressedCallback -import androidx.appcompat.app.AppCompatActivity -import androidx.core.widget.addTextChangedListener -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView -import com.google.android.material.textfield.TextInputEditText -import com.google.android.material.textfield.TextInputLayout -import net.gini.android.bank.sdk.GiniBank -import net.gini.android.bank.sdk.screenapiexample.databinding.ActivityExtractionsBinding -import net.gini.android.capture.Amount -import net.gini.android.capture.AmountCurrency -import net.gini.android.capture.network.GiniCaptureDefaultNetworkService -import net.gini.android.capture.network.model.GiniCaptureSpecificExtraction -import org.koin.android.ext.android.inject -import java.math.BigDecimal -import java.util.* - -/** - * Displays the Pay5 extractions: paymentRecipient, iban, bic, amount and paymentReference. - * - * A menu item is added to send feedback. - */ -class ExtractionsActivity : AppCompatActivity(), ExtractionsAdapter.ExtractionsAdapterInterface { - private lateinit var binding: ActivityExtractionsBinding - - private var mExtractions: MutableMap = hashMapOf() - private lateinit var mExtractionsAdapter: ExtractionsAdapter - private val defaultNetworkService: GiniCaptureDefaultNetworkService by inject() - - // {extraction name} to it's {entity name} - private val editableSpecificExtractions = hashMapOf("paymentRecipient" to "companyname", "paymentReference" to "reference" , - "paymentPurpose" to "text", "iban" to "iban", "bic" to "bic", "amountToPay" to "amount") - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - binding = ActivityExtractionsBinding.inflate(layoutInflater) - setContentView(binding.root) - readExtras() - showAnalyzedDocumentId() - setUpRecyclerView(binding) - } - - private fun showAnalyzedDocumentId() { - val documentId = defaultNetworkService.analyzedGiniApiDocument?.id ?: "" - binding.textDocumentId.text = getString(R.string.analyzed_document_id, documentId) - } - - override fun onCreateOptionsMenu(menu: Menu): Boolean { - super.onCreateOptionsMenu(menu) - menuInflater.inflate(R.menu.menu_extractions, menu) - return true - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean = when (item.itemId) { - R.id.feedback -> { - sendFeedbackAndClose(binding) - true - } - else -> super.onOptionsItemSelected(item) - } - - override fun valueChanged(key: String, newValue: String) { - mExtractions[key]?.apply { - value = newValue - } - } - - private fun readExtras() { - intent.extras?.getParcelable(EXTRA_IN_EXTRACTIONS)?.run { - keySet().forEach { name -> - getParcelable(name)?.let { mExtractions[name] = it } - } - } - } - - private fun setUpRecyclerView(binding: ActivityExtractionsBinding) { - binding.recyclerviewExtractions.apply { - setHasFixedSize(true) - layoutManager = LinearLayoutManager(this@ExtractionsActivity) - - editableSpecificExtractions.forEach { - if (!mExtractions.containsKey(it.key)) { - mExtractions[it.key] = GiniCaptureSpecificExtraction( - it.key, "", - it.value, null, emptyList()) - } - } - - adapter = ExtractionsAdapter(getSortedExtractions(mExtractions), this@ExtractionsActivity, editableSpecificExtractions.keys.toList()).also { - mExtractionsAdapter = it - } - setOnTouchListener { _, _ -> - performClick() - val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager - inputMethodManager.hideSoftInputFromWindow(windowToken, 0) - } - } - } - - private fun getSortedExtractions(extractions: Map): List = extractions.toSortedMap().values.toList() - - private fun sendFeedbackAndClose(binding: ActivityExtractionsBinding) { - // Feedback should be sent only for the user visible fields. Non-visible fields should be filtered out. - // In a real application the user input should be used as the new value. - - var amount = mExtractions["amountToPay"]?.value ?: "" - val paymentRecipient = mExtractions["paymentRecipient"]?.value ?: "" - val paymentReference = mExtractions["paymentReference"]?.value ?: "" - val paymentPurpose = mExtractions["paymentPurpose"]?.value ?: "" - val iban = mExtractions["iban"]?.value ?: "" - val bic = mExtractions["bic"]?.value ?: "" - - if (amount.isEmpty()) { - amount = Amount.EMPTY.amountToPay() - } - - GiniBank.releaseCapture(applicationContext, paymentRecipient, paymentReference, paymentPurpose, iban, bic, Amount( - BigDecimal(amount.removeSuffix(":EUR")), AmountCurrency.EUR) - ) - - finish() - } - - private fun showProgressIndicator(binding: ActivityExtractionsBinding) { - binding.recyclerviewExtractions.animate().alpha(0.5f) - binding.layoutProgress.visibility = View.VISIBLE - } - - private fun hideProgressIndicator(binding: ActivityExtractionsBinding) { - binding.recyclerviewExtractions.animate().alpha(1.0f) - binding.layoutProgress.visibility = View.GONE - } - - companion object { - const val EXTRA_IN_EXTRACTIONS = "EXTRA_IN_EXTRACTIONS" - - fun getStartIntent(context: Context, extractionsBundle: Map): Intent = - Intent(context, ExtractionsActivity::class.java).apply { - putExtra(EXTRA_IN_EXTRACTIONS, Bundle().apply { - extractionsBundle.map { putParcelable(it.key, it.value) } - }) - } - } -} - -private class ExtractionsAdapter(var extractions: List, - var listener: ExtractionsAdapterInterface? = null, - val editableSpecificExtractions : List) : RecyclerView.Adapter() { - - interface ExtractionsAdapterInterface { - fun valueChanged(key: String, value: String) - } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ExtractionsViewHolder { - val holder = ExtractionsViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_extraction, parent, false)) - holder.mTextValue.addTextChangedListener { - listener?.valueChanged(holder.mTextInputLayout.hint.toString(), it.toString()) - } - - return holder - } - - override fun onBindViewHolder(holder: ExtractionsViewHolder, position: Int) { - extractions.getOrNull(position)?.run { - holder.mTextValue.setText(value) - holder.mTextInputLayout.hint = name - holder.mTextValue.isEnabled = name in editableSpecificExtractions - } - } - - override fun getItemCount(): Int = extractions.size -} - -private class ExtractionsViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { - var mTextInputLayout: TextInputLayout = itemView.findViewById(R.id.text_input_layout) - var mTextValue: TextInputEditText = itemView.findViewById(R.id.text_value) -} diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/MainActivity.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/MainActivity.kt deleted file mode 100644 index a7e3d82d6b..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/MainActivity.kt +++ /dev/null @@ -1,294 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample - -import android.Manifest -import android.annotation.SuppressLint -import android.content.Intent -import android.os.Bundle -import android.widget.Toast -import androidx.appcompat.app.AppCompatActivity -import androidx.lifecycle.lifecycleScope -import ch.qos.logback.classic.LoggerContext -import ch.qos.logback.classic.android.LogcatAppender -import ch.qos.logback.classic.encoder.PatternLayoutEncoder -import kotlinx.coroutines.launch -import net.gini.android.bank.sdk.GiniBank -import net.gini.android.bank.sdk.capture.* -import net.gini.android.bank.sdk.screenapiexample.databinding.ActivityMainBinding -import net.gini.android.bank.sdk.screenapiexample.util.PermissionHandler -import net.gini.android.capture.Amount -import net.gini.android.capture.DocumentImportEnabledFileTypes -import net.gini.android.capture.GiniCaptureDebug -import net.gini.android.capture.help.HelpItem -import net.gini.android.capture.network.GiniCaptureDefaultNetworkService -import net.gini.android.capture.requirements.RequirementsReport -import net.gini.android.capture.util.CancellationToken -import net.gini.android.capture.view.DefaultLoadingIndicatorAdapter -import org.koin.android.ext.android.inject -import org.slf4j.Logger -import org.slf4j.LoggerFactory - -class MainActivity : AppCompatActivity() { - - private lateinit var binding: ActivityMainBinding - private val permissionHandler = PermissionHandler(this) - private val captureLauncher = - registerForActivityResult(CaptureFlowContract(), ::onCaptureResult) - private val captureImportLauncher = - registerForActivityResult(CaptureFlowImportContract(), ::onCaptureResult) - private var cancellationToken: CancellationToken? = - null // should be kept across configuration changes - private val networkService: GiniCaptureDefaultNetworkService by inject() - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - binding = ActivityMainBinding.inflate(layoutInflater) - setContentView(binding.root) - - showVersions(binding) - setViewListeners(binding) - setGiniCaptureSdkDebugging() - if (savedInstanceState == null) { - if (isIntentActionViewOrSend(intent)) { - startGiniCaptureSdk(intent) - } - } - } - - override fun onNewIntent(intent: Intent?) { - super.onNewIntent(intent) - if (intent != null && isIntentActionViewOrSend(intent)) { - startGiniCaptureSdk(intent) - } - } - - private fun configureGiniCapture() { - val useCustomOnboardingPages = false - val useCustomLoadingIndicator = false - - if (binding.enableCustomIllustration.isChecked) - GiniBank.digitalInvoiceOnboardingIllustrationAdapter = - CustomOnboardingIllustrationAdapter( - this.resources.getIdentifier( - "ai_animation", - "raw", - this.packageName - ) - ) - - GiniBank.setCaptureConfiguration( - this, - CaptureConfiguration( - networkService = networkService, - documentImportEnabledFileTypes = DocumentImportEnabledFileTypes.PDF_AND_IMAGES, - fileImportEnabled = true, - qrCodeScanningEnabled = binding.qrCodeScanningEnabled.isChecked, - multiPageEnabled = true, - flashButtonEnabled = true, - eventTracker = GiniCaptureEventTracker, - customHelpItems = listOf( - HelpItem.Custom( - R.string.custom_help_screen_title, - Intent(this, CustomHelpActivity::class.java) - ) - ), - importedFileSizeBytesLimit = 5 * 1024 * 1024, - bottomNavigationBarEnabled = binding.enableBottomBar.isChecked, - onlyQRCodeScanningEnabled = binding.onlyQrCodeScanning.isChecked, - onboardingAlignCornersIllustrationAdapter = if (useCustomOnboardingPages) { - CustomOnboardingIllustrationAdapter( - resources.getIdentifier( - "floating_document", - "raw", - this.packageName - ) - ) - } else { - null - }, - onboardingLightingIllustrationAdapter = if (useCustomOnboardingPages) { - CustomOnboardingIllustrationAdapter( - resources.getIdentifier( - "lighting", - "raw", - this.packageName - ) - ) - } else { - null - }, - onboardingMultiPageIllustrationAdapter = if (useCustomOnboardingPages) { - CustomOnboardingIllustrationAdapter( - resources.getIdentifier( - "multipage", - "raw", - this.packageName - ) - ) - } else { - null - }, - onboardingQRCodeIllustrationAdapter = if (useCustomOnboardingPages) { - CustomOnboardingIllustrationAdapter( - resources.getIdentifier( - "scan_qr_code", - "raw", - this.packageName - ) - ) - } else { - null - }, - customLoadingIndicatorAdapter = if (useCustomLoadingIndicator) { - CustomLottiLoadingIndicatorAdapter( - resources.getIdentifier( - "custom_loading", - "raw", - this.packageName - ) - ) - } else { - DefaultLoadingIndicatorAdapter() - } - ) - ) - } - - private fun configureGiniBank() { - GiniBank.enableReturnReasons = true - } - - private fun setGiniCaptureSdkDebugging() { - if (BuildConfig.DEBUG) { - GiniCaptureDebug.enable() - configureLogging() - } - } - - private fun configureLogging() { - val lc: LoggerContext = LoggerFactory.getILoggerFactory() as LoggerContext - lc.reset() - - val layoutEncoder = PatternLayoutEncoder() - layoutEncoder.context = lc - layoutEncoder.pattern = "%-5level %file:%line [%thread] - %msg%n" - layoutEncoder.start() - - val logcatAppender = LogcatAppender() - logcatAppender.context = lc - logcatAppender.encoder = layoutEncoder - logcatAppender.start() - - val root: ch.qos.logback.classic.Logger = - LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) as ch.qos.logback.classic.Logger - root.addAppender(logcatAppender) - } - - private fun startGiniCaptureSdk(intent: Intent? = null) { - lifecycleScope.launch { - if (permissionHandler.grantPermission(Manifest.permission.CAMERA)) { - val report = GiniBank.checkCaptureRequirements(this@MainActivity) - if (!report.isFulfilled) { - showUnfulfilledRequirementsToast(report) - } - configureGiniBank() - configureGiniCapture() - - if (intent != null) { - cancellationToken = GiniBank.startCaptureFlowForIntent( - captureImportLauncher, - this@MainActivity, - intent - ) - } else { - GiniBank.startCaptureFlow(captureLauncher) - } - } else { - if (intent != null) { - finish() - } - } - } - } - - private fun onCaptureResult(result: CaptureResult) { - when (result) { - is CaptureResult.Success -> { - startActivity(ExtractionsActivity.getStartIntent(this, result.specificExtractions)) - } - is CaptureResult.Error -> { - when (result.value) { - is ResultError.Capture -> - Toast.makeText( - this, - "Error: ${(result.value as ResultError.Capture).giniCaptureError.errorCode} ${(result.value as ResultError.Capture).giniCaptureError.message}", - Toast.LENGTH_LONG - ).show() - is ResultError.FileImport -> - Toast.makeText( - this, - "Error: ${(result.value as ResultError.FileImport).code} ${(result.value as ResultError.FileImport).message}", - Toast.LENGTH_LONG - ).show() - } - if (isIntentActionViewOrSend(intent)) { - finish() - } - } - CaptureResult.Empty -> { - if (isIntentActionViewOrSend(intent)) { - finish() - } - } - CaptureResult.Cancel -> { - if (isIntentActionViewOrSend(intent)) { - finish() - } - } - CaptureResult.EnterManually -> { - Toast.makeText(this, "Scan exited for manual enter mode", Toast.LENGTH_SHORT).show() - if (isIntentActionViewOrSend(intent)) { - finish() - } - } - } - } - - private fun onStartAgainResult(startAgain: Boolean) { - if (startAgain) { - GiniBank.startCaptureFlow(captureLauncher) - } - } - - private fun showUnfulfilledRequirementsToast(reports: RequirementsReport) { - reports.requirementReports.joinToString(separator = "\n") { report -> - if (!report.isFulfilled) { - "${report.requirementId}: ${report.details}" - } else "" - }.also { message -> - Toast.makeText(this, message, Toast.LENGTH_LONG).show() - } - } - - private fun setViewListeners(binding: ActivityMainBinding) { - binding.buttonStartScanner.setOnClickListener { - startGiniCaptureSdk() - } - } - - @SuppressLint("SetTextI18n") - private fun showVersions(binding: ActivityMainBinding) { - binding.textGiniBankVersion.text = - "Gini Bank SDK v${net.gini.android.bank.sdk.BuildConfig.VERSION_NAME}" - binding.textAppVersion.text = "v${BuildConfig.VERSION_NAME}" - } - - private fun isIntentActionViewOrSend(intent: Intent): Boolean = - Intent.ACTION_VIEW == intent.action || Intent.ACTION_SEND == intent.action || Intent.ACTION_SEND_MULTIPLE == intent.action - - override fun onDestroy() { - super.onDestroy() - // cancellationToken shouldn't be canceled when activity is recreated. - // For example cancel in ViewModel's onCleared() instead. - cancellationToken?.cancel() - } -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/di/GiniModule.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/di/GiniModule.kt deleted file mode 100644 index e7dd36041e..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/di/GiniModule.kt +++ /dev/null @@ -1,23 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample.di - -import net.gini.android.core.api.DocumentMetadata -import net.gini.android.bank.sdk.screenapiexample.R -import net.gini.android.bank.sdk.GiniBank -import net.gini.android.bank.sdk.util.getGiniApi -import net.gini.android.bank.sdk.network.getDefaultNetworkService -import org.koin.android.ext.koin.androidContext -import org.koin.dsl.module - -val giniModule = module { - single { - DocumentMetadata().apply { - setBranchId("GiniBankExampleAndroid") - add("AppFlow", "ScreenAPI") - } - } - single { getDefaultNetworkService(get(), androidContext().getString(R.string.gini_api_client_id), - androidContext().getString(R.string.gini_api_client_secret), "example.com", get()) } - single { getGiniApi(get(), androidContext().getString(R.string.gini_api_client_id), - androidContext().getString(R.string.gini_api_client_secret), "example.com") } - single { GiniBank.apply { setGiniApi(get()) } } -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/di/ViewModel.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/di/ViewModel.kt deleted file mode 100644 index 821379a7ac..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/di/ViewModel.kt +++ /dev/null @@ -1,11 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample.di - -import net.gini.android.bank.sdk.screenapiexample.pay.PayViewModelJava -import net.gini.android.bank.sdk.screenapiexample.pay.PayViewModelKotlin -import org.koin.androidx.viewmodel.dsl.viewModel -import org.koin.dsl.module - -val viewModelModule = module { - viewModel { PayViewModelJava(get()) } - viewModel { PayViewModelKotlin(get()) } -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/util/PermissionHandler.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/util/PermissionHandler.kt deleted file mode 100644 index 6d8ec313ce..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/util/PermissionHandler.kt +++ /dev/null @@ -1,35 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample.util - -import android.content.pm.PackageManager -import androidx.activity.ComponentActivity -import androidx.activity.result.contract.ActivityResultContracts -import androidx.core.content.ContextCompat -import kotlin.coroutines.Continuation -import kotlin.coroutines.resume -import kotlinx.coroutines.suspendCancellableCoroutine - -class PermissionHandler(private val activity: ComponentActivity) { - private var permissionContinuation: Continuation? = null - - private var requestPermissionLauncher = activity.registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted: Boolean -> - if (isGranted) { - permissionContinuation?.resume(true) - } else { - permissionContinuation?.resume(false) - } - permissionContinuation = null - } - - suspend fun grantPermission(permission: String): Boolean = if (permissionContinuation == null) { - suspendCancellableCoroutine { continuation -> - if (ContextCompat.checkSelfPermission(activity, permission) == PackageManager.PERMISSION_GRANTED) { - continuation.resume(true) - } else { - permissionContinuation = continuation - requestPermissionLauncher.launch(permission) - } - } - } else { - false - } -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/util/SimpleSpinnerSelectListener.kt b/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/util/SimpleSpinnerSelectListener.kt deleted file mode 100644 index 8bb1d649a8..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/java/net/gini/android/bank/sdk/screenapiexample/util/SimpleSpinnerSelectListener.kt +++ /dev/null @@ -1,12 +0,0 @@ -package net.gini.android.bank.sdk.screenapiexample.util - -import android.view.View -import android.widget.AdapterView - -interface SimpleSpinnerSelectListener : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { - } - - override fun onNothingSelected(parent: AdapterView<*>?) { - } -} \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/res/drawable/edittext_selector.xml b/bank-sdk/screen-api-example-app/src/main/res/drawable/edittext_selector.xml deleted file mode 100644 index 90a1ba99da..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/res/drawable/edittext_selector.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/bank-sdk/screen-api-example-app/src/main/res/layout/activity_custom_help.xml b/bank-sdk/screen-api-example-app/src/main/res/layout/activity_custom_help.xml deleted file mode 100644 index 5fc1ee2385..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/res/layout/activity_custom_help.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - \ No newline at end of file diff --git a/bank-sdk/screen-api-example-app/src/main/res/layout/activity_extractions.xml b/bank-sdk/screen-api-example-app/src/main/res/layout/activity_extractions.xml deleted file mode 100644 index ee2e13eb78..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/res/layout/activity_extractions.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - diff --git a/bank-sdk/screen-api-example-app/src/main/res/layout/activity_main.xml b/bank-sdk/screen-api-example-app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 41ba77f5a8..0000000000 --- a/bank-sdk/screen-api-example-app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -