Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pia 4446 add demo functionality of entry points #350

Merged
merged 30 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
872c00c
refactor: Refactor the example apps and merge them into one
abolfazlimahdi Sep 5, 2023
b5c3c9b
ci: Change ci scripts for example apps
abolfazlimahdi Sep 5, 2023
2538939
fix(bank-sdk): Replace screen_api_example.jks from bank with capture
abolfazlimahdi Sep 5, 2023
f68193b
feat(bank-sdk): Add return assistant switch to configurations
abolfazlimahdi Sep 6, 2023
2a7f376
refactor(bank-sdk): Refactor MainActivity to include the return assis…
abolfazlimahdi Sep 7, 2023
12be99a
feat(bank-sdk): Add digital invoice onboarding custom illustration
abolfazlimahdi Sep 7, 2023
24fd78d
ci(bank-sdk): Changing the build.gradle dependecies from api to imple…
abolfazlimahdi Sep 7, 2023
df21e81
refactor(bank-sdk): Removing the reduntant colors and config.xml file
abolfazlimahdi Sep 7, 2023
5646085
feat(bank-sdk): Add digital invoice help bottom navigation bar
abolfazlimahdi Sep 7, 2023
25728b0
feat(bank-sdk): Add Digital invoice onboarding bottom navigation bar
abolfazlimahdi Sep 8, 2023
4e4a5a5
feat(bank-sdk): Add Digital invoice bottom navigation bar
abolfazlimahdi Sep 8, 2023
72bc724
feat(bank-sdk): Add debug switch to configuration screen
abolfazlimahdi Sep 8, 2023
3dcd6b6
refactor(bank-sdk): Change example app package name
abolfazlimahdi Sep 11, 2023
f6448f2
refactor(bank-sdk): Refactor GiniExampleModule class
abolfazlimahdi Sep 11, 2023
c9fba20
refactor(bank-sdk): Change bank-sdk example app package name to inclu…
abolfazlimahdi Sep 11, 2023
130dffb
refactor(bank-sdk): Change application id in bank-sdk example app
abolfazlimahdi Sep 11, 2023
1277fd2
fix(bank-sdk): Fix import funcionality bugs
abolfazlimahdi Sep 13, 2023
4b82de8
fix(bank-sdk): Fix showing import disabled for normal flow of the app
abolfazlimahdi Sep 14, 2023
ff5f78d
refactor(bank-sdk): Refactor bank-sdk example app to include sdk
abolfazlimahdi Sep 11, 2023
245a25f
feat(bank-sdk): Add feild functionality in main page UI
abolfazlimahdi Sep 11, 2023
948bc55
ci(bank-sdk): Change example app name in github actions files
abolfazlimahdi Sep 12, 2023
942c899
feat(bank-sdk): Wrap the main screen in a scrollview
abolfazlimahdi Sep 12, 2023
6960570
feat(bank-sdk): Remove field entry point from configurations
abolfazlimahdi Sep 12, 2023
46ce7b3
feat(bank-sdk): Adding dark/light functionality to example app
abolfazlimahdi Sep 14, 2023
70ce8a3
feat(bank-sdk): Add toolbar to the example app screens
abolfazlimahdi Sep 14, 2023
fab1399
feat(bank-sdk): Enhance UI of the main screen
abolfazlimahdi Sep 14, 2023
2dbd508
feat(bank-sdk): Add German localisation for main screen
abolfazlimahdi Sep 14, 2023
d831ebf
feat(bank-sdk): Improve desgin for main screen
abolfazlimahdi Sep 14, 2023
fd0426c
refactor(bank-sdk): Refactor example app styles and colors for the da…
abolfazlimahdi Sep 18, 2023
21d6045
feat(bank-sdk): Change German text in main screen
abolfazlimahdi Sep 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/bank-sdk.check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ jobs:

- name: build debug screen api example app
run: >
./gradlew bank-sdk:screen-api-example-app:assembleDebug
./gradlew bank-sdk:example-app:assembleDebug
-PclientId="gini-mobile-test"
-PclientSecret="${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}"

- name: archive debug screen api example app
uses: actions/upload-artifact@v3
with:
name: bank-sdk-screen-api-example-app-debug
path: bank-sdk/screen-api-example-app/build/outputs/apk/debug
name: bank-sdk-example-app-debug
path: bank-sdk/example-app/build/outputs/apk/debug

- name: build release screen api example app
run: >
./gradlew bank-sdk:screen-api-example-app:assembleRelease
./gradlew bank-sdk:example-app:assembleRelease
-PclientId="gini-mobile-test"
-PclientSecret="${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}"
-PreleaseKeystoreFile="screen_api_example.jks"
Expand All @@ -157,8 +157,8 @@ jobs:
- name: archive release screen api example app
uses: actions/upload-artifact@v3
with:
name: bank-sdk-screen-api-example-app-release
path: bank-sdk/screen-api-example-app/build/outputs/apk/release
name: bank-sdk-example-app-release
path: bank-sdk/example-app/build/outputs/apk/release

android-lint:
runs-on: ubuntu-latest
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/capture-sdk.check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,46 +155,6 @@ jobs:
name: capture-sdk-default-network-instrumented-test-results
path: capture-sdk/default-network/build/outputs/androidTest-results/connected

build-example-apps:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: build debug screen api example app
run: >
./gradlew capture-sdk:screen-api-example-app:assembleDebug
-PclientId="gini-mobile-test"
-PclientSecret="${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}"

- name: archive debug screen api example app
uses: actions/upload-artifact@v3
with:
name: capture-sdk-screen-api-example-app-debug
path: capture-sdk/screen-api-example-app/build/outputs/apk/debug

- name: build release screen api example app
run: >
./gradlew capture-sdk:screen-api-example-app:assembleRelease
-PclientId="gini-mobile-test"
-PclientSecret="${{ secrets.GINI_MOBILE_TEST_CLIENT_SECRET }}"
-PreleaseKeystoreFile="screen_api_example.jks"
-PreleaseKeystorePassword='${{ secrets.CAPTURE_SDK_EXAMPLE_APP_KEYSTORE_PASSWORD }}'
-PreleaseKeyAlias="screen_api_example"
-PreleaseKeyPassword='${{ secrets.CAPTURE_SDK_EXAMPLE_APP_KEYSTORE_PASSWORD }}'

- name: archive release screen api example app
uses: actions/upload-artifact@v3
with:
name: capture-sdk-screen-api-example-app-release
path: capture-sdk/screen-api-example-app/build/outputs/apk/release

checkstyle:
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ 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.sdk.exampleapp"
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.capture.screenapiexample"
applicationId = "net.gini.android.bank.sdk.exampleapp"

minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
Expand Down Expand Up @@ -91,16 +91,21 @@ tasks.withType(type = org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask
}

dependencies {
// For testing the local version
api(project(":capture-sdk:sdk"))
// For testing the local version
implementation(project(":capture-sdk:sdk"))
// For testing a released version
//implementation "net.gini.android:gini-capture-sdk:0.0.1"

// For testing the local version
api(project(":capture-sdk:default-network"))
implementation(project(":capture-sdk:default-network"))
// For testing a released version
//implementation "net.gini.android:gini-capture-sdk-default-network:0.0.1"

// For testing the local version
implementation(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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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.UiObject;
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 =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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.UiObject;
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 =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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.UiObject;
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 =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="net.gini.android.capture.screen">

<uses-permission android:name="android.permission.CAMERA" />

<queries>
<intent>
<action android:name="android.intent.action.PICK" />
<data android:mimeType="image/*" />
</intent>
<intent>
<action android:name="android.intent.action.OPEN_DOCUMENT" />
<data android:mimeType="image/*" />
</intent>
<intent>
<action android:name="android.intent.action.OPEN_DOCUMENT" />
<data android:mimeType="application/pdf" />
</intent>
</queries>

<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="true" />
<uses-feature
android:name="android.hardware.camera.flash"
android:required="true" />
xmlns:tools="http://schemas.android.com/tools">

<application
android:name="net.gini.android.capture.screen.ScreenApiExampleApp"
android:name=".ExampleApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/AppTheme">
<activity android:name="net.gini.android.capture.screen.ui.MainActivity"
android:launchMode="singleTask"
android:exported="true">
<activity
android:name=".ui.MainActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -51,6 +24,7 @@
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />

<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
Expand All @@ -59,33 +33,73 @@
tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/pdf" />
</intent-filter>
</activity>
<activity android:name="net.gini.android.capture.screen.ui.CameraScreenApiActivity"
android:label="@string/gc_title_camera"
android:theme="@style/GiniCaptureTheme"/>
<activity
android:name="net.gini.android.capture.screen.ui.ExtractionsActivity"
android:name=".ui.ExtractionsActivity"
android:label="@string/title_extractions" />
<activity
android:name=".ui.CustomHelpActivity"
android:label="@string/custom_help_screen_title" />

<activity android:name="net.gini.android.capture.screen.ui.ConfigurationActivity"
<activity
android:name=".ui.ConfigurationActivity"
android:label="@string/configuration_activity_title" />

<activity
android:name=".ui.pay.PayActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />

<data
android:host="payment"
android:scheme="ginipay" />
</intent-filter>
</activity>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="net.gini.android.capture.screen.fileprovider"
android:grantUriPermissions="true"
android:exported="false">
android:authorities=".fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>

</application>

<queries>
<intent>
<action android:name="android.intent.action.PICK" />
<data android:mimeType="image/*" />
</intent>
<intent>
<action android:name="android.intent.action.OPEN_DOCUMENT" />
<data android:mimeType="image/*" />
</intent>
<intent>
<action android:name="android.intent.action.OPEN_DOCUMENT" />
<data android:mimeType="application/pdf" />
</intent>
</queries>

<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="true" />
<uses-feature
android:name="android.hardware.camera.flash"
android:required="true" />
<uses-feature
android:name="android.hardware.camera"
android:required="true" />

<uses-permission android:name="android.permission.CAMERA" />

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.gini.android.bank.sdk.exampleapp

import androidx.multidex.MultiDexApplication
import dagger.hilt.android.HiltAndroidApp


/**
* Main Entry of the application.
*/

@HiltAndroidApp
class ExampleApp : MultiDexApplication()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.gini.android.capture.screen.core
package net.gini.android.bank.sdk.exampleapp.core

import android.util.Log
import kotlinx.coroutines.CoroutineScope
Expand All @@ -10,7 +10,6 @@ import net.gini.android.core.api.Resource
import net.gini.android.core.api.models.Document
import net.gini.android.core.api.models.ExtractionsContainer
import net.gini.android.core.api.models.SpecificExtraction
import java.lang.Exception
import kotlin.coroutines.CoroutineContext

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.gini.android.capture.screen.core
package net.gini.android.bank.sdk.exampleapp.core

import android.content.Intent
import android.os.Bundle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package net.gini.android.bank.sdk.screenapiexample.util
package net.gini.android.bank.sdk.exampleapp.core

import android.content.pm.PackageManager
import androidx.activity.ComponentActivity
import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.content.ContextCompat
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlin.coroutines.Continuation
import kotlin.coroutines.resume
import kotlinx.coroutines.suspendCancellableCoroutine

class PermissionHandler(private val activity: ComponentActivity) {
private var permissionContinuation: Continuation<Boolean>? = null
Expand Down
Loading
Loading