Skip to content

Commit

Permalink
Merge pull request #349 from gini/PIA-4417-merge-example-apps
Browse files Browse the repository at this point in the history
Pia 4417 merge example apps
  • Loading branch information
abolfazlimahdi authored Sep 14, 2023
2 parents a72d692 + 4b82de8 commit e0c732b
Show file tree
Hide file tree
Showing 209 changed files with 1,374 additions and 2,716 deletions.
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: 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: 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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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

0 comments on commit e0c732b

Please sign in to comment.