Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
22fd9f9
feat(capture-sdk): Adding the unit and integration tests for the user…
obaidgini Sep 8, 2025
7210f71
feat(capture-sdk): accommodating the co-pilot comments
obaidgini Sep 8, 2025
811afd4
Merge branch 'main' of https://github.com/gini/gini-mobile-android in…
obaidgini Sep 29, 2025
401bf92
feat(capture-sdk): refactored the methods of UserAnalyticsEventTracke…
obaidgini Oct 1, 2025
9312a30
feat(capture-sdk): refactored the methods of AmplitudeUserAnalyticsEv…
obaidgini Oct 1, 2025
2463adb
feat(capture-sdk): refactored the methods of BufferedUserAnalyticsEve…
obaidgini Oct 1, 2025
e565aea
feat(capture-sdk): Changed the comments as per PR comments
obaidgini Oct 1, 2025
b4fd428
feat(capture-sdk): Changed the tests, according to new refactor and b…
obaidgini Oct 1, 2025
025d397
feat(capture-sdk): Changed the setup according to new return type of …
obaidgini Oct 1, 2025
c2ff476
feat(capture-sdk): Addressing the detekt issues
obaidgini Oct 1, 2025
56bf21f
feat(capture-sdk): Resolving the test failures because we changed the…
obaidgini Oct 1, 2025
3ec84d7
feat(capture-sdk): Adding a simple SharedPreferenceHelper to store an…
obaidgini Oct 15, 2025
95a11d2
feat(capture-sdk): Adding a Helper class for all the SAF related work…
obaidgini Oct 15, 2025
2a4439d
feat(capture-sdk): Adding the switch track color and background, also…
obaidgini Oct 15, 2025
c7e1264
feat(capture-sdk): Adding strings and styles, every item is temporary…
obaidgini Oct 15, 2025
8a54d8b
feat(capture-sdk): Linking the views to java file to initiate flow, w…
obaidgini Oct 15, 2025
0b74ecc
feat(capture-sdk): Updating the test according to change in createPre…
obaidgini Oct 15, 2025
a94a158
feat(capture-sdk): Adding the ability to remove the SAF data from the…
obaidgini Oct 15, 2025
f465a8d
feat(capture-sdk): adding the argument for AnalysisFragment to receiv…
obaidgini Oct 15, 2025
103f0d4
feat(capture-sdk): Adding a default method in callback to open a laun…
obaidgini Oct 15, 2025
a1962e2
feat(capture-sdk): Adding a method to release education lock, because…
obaidgini Oct 15, 2025
c413102
feat(capture-sdk): Adding the boolean which will inform AnalysisFragm…
obaidgini Oct 15, 2025
ad639dd
feat(capture-sdk): Adding required method in the contract of Analysis…
obaidgini Oct 15, 2025
da22591
feat(capture-sdk): Adding the SAF implementation in the Analysis frag…
obaidgini Oct 15, 2025
44fbb39
feat(capture-sdk): Addressing detekt issues
obaidgini Oct 15, 2025
faa9cd9
feat(capture-sdk): Addressing detekt issues
obaidgini Oct 15, 2025
cdfe337
feat(bank-api-library): Adding backend flag for the saveInvoicesLocally
obaidgini Oct 17, 2025
b3ac3b8
feat(bank-api-library): Adding backend flag for the saveInvoicesLocally
obaidgini Oct 17, 2025
b3eadd4
feat(capture-sdk): Configuring SDK flag in Capture
obaidgini Oct 17, 2025
e5b71d6
feat(capture-sdk): Configuring SDK flag in Bank sdk
obaidgini Oct 17, 2025
3131fa2
feat(capture-sdk): Adding use case for the SDK flag so it can be acce…
obaidgini Oct 17, 2025
1ebde3f
feat(capture-sdk): Adding di related work so SaveInvoicesLocallyFeatu…
obaidgini Oct 17, 2025
3654b31
feat(capture-sdk): Adding a separate class which will evaluate the vi…
obaidgini Oct 17, 2025
e464546
feat(capture-sdk): removing default value it is not needed
obaidgini Oct 17, 2025
5ff674e
feat(capture-sdk): By default the view visibility should be gone, so …
obaidgini Oct 17, 2025
ff0103f
feat(capture-sdk): The import type for photo was always null, putting…
obaidgini Oct 17, 2025
022ff1c
feat(capture-sdk): Handling the view visibility for save invoice loca…
obaidgini Oct 17, 2025
ea47d44
feat(example-app): Handling the turning off and on for SDK flag in ba…
obaidgini Oct 17, 2025
50217de
feat(capture-sdk): Putting the right import method to differentiate b…
obaidgini Oct 17, 2025
7b4dd46
feat(capture-sdk): Making the object internal so it can not be access…
obaidgini Oct 17, 2025
6ca8b71
feat(capture-sdk): Updating the show scan animation, because if we ha…
obaidgini Oct 22, 2025
058b3df
feat(capture-sdk): Updating the show scan animation, because if we ha…
obaidgini Oct 22, 2025
ce1ac03
feat(capture-sdk): adding new minimum width for tablets
obaidgini Oct 22, 2025
42771e6
feat(capture-sdk): renaming files
obaidgini Oct 22, 2025
cc0d797
feat(capture-sdk): updating xmls for new designs, adding backgrounds,…
obaidgini Oct 22, 2025
2cfdaa6
feat(capture-sdk): updating strings
obaidgini Oct 22, 2025
1bb12a1
feat(capture-sdk): updating styles for material switch 3
obaidgini Oct 22, 2025
5bff758
feat(capture-sdk): Taking care of background change according to figm…
obaidgini Oct 22, 2025
46cad24
feat(capture-sdk): Adding new view for tablet portrait view
obaidgini Oct 22, 2025
a4c99ef
feat(capture-sdk): Updating saving invoices locally view, according t…
obaidgini Oct 22, 2025
018b990
feat(capture-sdk): addressing ktlint issues
obaidgini Oct 22, 2025
bb2057d
feat(capture-sdk): addressing sonar issues
obaidgini Oct 22, 2025
94d6bef
feat(capture-sdk): Updating tests according to new parameter added in…
obaidgini Oct 22, 2025
5b66fbd
feat(capture-sdk): resolving co-pilot comments
obaidgini Oct 22, 2025
d1b2805
feat(capture-sdk): Updating test's according to changes in MultipageR…
obaidgini Oct 22, 2025
6288552
feat(capture-sdk): Updating test's according to changes in MultipageR…
obaidgini Oct 22, 2025
c541384
feat(bank-api-library): updating test according to new response of co…
obaidgini Oct 23, 2025
21dd34e
feat(capture-sdk): Adding unit test for SAF Helper
obaidgini Oct 23, 2025
67bcd74
feat(capture-sdk): Removing the un-used string
obaidgini Oct 24, 2025
6a2e64b
feat(capture-sdk): Adding english name for file name
obaidgini Oct 24, 2025
c33b2b0
feat(capture-sdk): Adding comment related to saveInvoicesLocallyEnabled
obaidgini Oct 24, 2025
bcfa130
feat(capture-sdk): Adding comment related to saveInvoicesLocallyEnabled
obaidgini Oct 24, 2025
281d412
feat(capture-sdk): changed the name of isInvoiceSavingEnabled
obaidgini Oct 24, 2025
dcaaa83
feat(bank-api-library): Formatted the code
obaidgini Oct 28, 2025
0837cd9
feat(bank-api-library): Removed un-used import
obaidgini Oct 28, 2025
5e5bcae
feat(capture-sdk): Added tests for SaveInvoicesFeatureEvaluatorTest
obaidgini Oct 28, 2025
0f2e77e
feat(capture-sdk): Adding spaces
obaidgini Oct 29, 2025
6bf9ed7
feat(capture-sdk): Fixing failing test
obaidgini Oct 29, 2025
5f535f6
feat(capture-sdk): Fixing failing test
obaidgini Oct 29, 2025
8850f09
feat(capture-sdk): Fixing failing test
obaidgini Oct 31, 2025
3d406c4
Merge branch 'PP-1700-unit-and-integration-tests' of https://github.c…
obaidgini Nov 3, 2025
b445d93
feat(capture-sdk): Adding test to check if the configuration call is …
obaidgini Nov 3, 2025
920ce60
feat: Add paymentDueHint flag in bank and capture SDK
abolfazlimahdi Oct 29, 2025
3167d38
refactor(bank-sdk): Rename Configuration to ExampleAppBankConfiguration
abolfazlimahdi Oct 29, 2025
c541aa2
feat(capture-sdk): Extracts the payment state from extractions
abolfazlimahdi Oct 29, 2025
c87d3d3
feat(capture-sdk): Implement payment due hint UI components and color…
abolfazlimahdi Nov 5, 2025
6e4da91
feat(capture-sdk): Add logic to show payment due hint in analysis screen
abolfazlimahdi Nov 6, 2025
6f53452
feat(capture-sdk): Add auto-dismissing animation for PaymentDueHint
abolfazlimahdi Nov 6, 2025
4270bc2
feat(capture-sdk): Prevent due date hint for documents with line item…
abolfazlimahdi Nov 7, 2025
1d2134f
refactor(capture-sdk): Rename paymentHintsEnabled to alreadyPaidHintE…
abolfazlimahdi Nov 7, 2025
dd0e0e5
feat(capture-sdk): Add payment due hint threshold days
abolfazlimahdi Nov 7, 2025
3900b1e
feat(capture-sdk): Avoid interruption of qr code education in case of…
abolfazlimahdi Nov 7, 2025
cfd6796
refactor(capture-sdk): Rename paymentHintsEnabled to isAlreadyPaidHin…
abolfazlimahdi Nov 10, 2025
9d8ce28
feat(capture-sdk): Add paymentDueHintEnabled client flag
abolfazlimahdi Nov 10, 2025
a93bfca
feat(capture-sdk): Show payment due hint after qr code education
abolfazlimahdi Nov 10, 2025
321fc4e
feat(capture-sdk): Add bridge to access Bank SDK properties
abolfazlimahdi Nov 11, 2025
7bef40d
fix(capture-sdk): update hint text formatting and improve string reso…
MozhganPeivandianSharbaf Nov 12, 2025
207097b
feat(capture-sdk): add bank SDK bridge to AnalysisFragment test
MozhganPeivandianSharbaf Nov 12, 2025
f7661af
fix(capture-sdk): simplify exception handling by using underscore for…
MozhganPeivandianSharbaf Nov 12, 2025
a13a9fc
fix(capture-sdk): suppress warning for too many functions in CaptureF…
MozhganPeivandianSharbaf Nov 13, 2025
3dfaefe
feat(capture-sdk):Changing the file name because system is sometime n…
obaidgini Nov 13, 2025
2fdc0f2
feat(capture-sdk): fix accessibility issues for payment due hint
MozhganPeivandianSharbaf Nov 13, 2025
dce657c
feat(capture-sdk):Adding some comments and improving variable names
obaidgini Nov 13, 2025
08edaf2
feat(capture-sdk):changing client id for workflows
obaidgini Nov 13, 2025
da7ed8f
Merge branch 'main' of https://github.com/gini/gini-mobile-android in…
obaidgini Nov 13, 2025
66317f7
fix(capture-sdk): clear image disk store on cancel action and prevent…
obaidgini Nov 13, 2025
ad96267
fix(capture-sdk): Adding the missing parameter for paymentHintsEnabled
obaidgini Nov 13, 2025
2439055
feat(capture-sdk): Add unit tests for GiniCaptureDefaultNetworkServic…
abolfazlimahdi Nov 13, 2025
2a5b658
Merge branch 'PP-1889-payment-due-hint' of https://github.com/gini/gi…
obaidgini Nov 13, 2025
3fe1f79
fix(capture-sdk): Removing un-necessary mutex unlock
obaidgini Nov 13, 2025
e373997
fix(capture-sdk): Providing required values in test
obaidgini Nov 13, 2025
eb12e17
fix(capture-sdk): Handling success full extractions
obaidgini Nov 13, 2025
07868da
fix(capture-sdk): handling saving invoices locally with due and paid …
obaidgini Nov 13, 2025
be18424
fix(capture-sdk): Adding parameterized names
obaidgini Nov 13, 2025
1df0529
fix(capture-sdk): Removing un-used import
obaidgini Nov 13, 2025
738441c
fix(capture-sdk): Resolving failing tests
obaidgini Nov 13, 2025
9460ad5
feat(capture-sdk): Make BankSDKBridge nullable
abolfazlimahdi Nov 14, 2025
46e5150
docs(capture-sdk): Update KDoc in BankSDKBridge
abolfazlimahdi Nov 14, 2025
1d30241
docs(capture-sdk): Add Javadocs for WarningPaymentState methods
abolfazlimahdi Nov 14, 2025
5b21dac
fix(capture-sdk): Add leading space to due date hint
abolfazlimahdi Nov 14, 2025
89bccbb
refactor(capture-sdk): Remove redundant 'Companion' keyword
abolfazlimahdi Nov 14, 2025
cb3e648
feat(capture-sdk): Update warning icon content description
abolfazlimahdi Nov 14, 2025
9cbe7a7
refactor(bank-api-library): Rename feature flag properties for consis…
abolfazlimahdi Nov 14, 2025
deaaba2
refactor(bank-sdk): Use named arguments for CaptureFlowFragmentFactory
abolfazlimahdi Nov 14, 2025
34049ac
refactor(capture-sdk): Rename savePhotosLocallyEnabled to isSavePhoto…
abolfazlimahdi Nov 14, 2025
8d1e76f
feat(capture-sdk): Capitalize warning and dismiss message strings
abolfazlimahdi Nov 14, 2025
1b77090
fix(capture-sdk):Updating styles for the saving invoices locally titl…
obaidgini Nov 17, 2025
1589cc1
feat(capture-sdk): Fixing the issue of folder deletion and updating t…
obaidgini Nov 18, 2025
eef96d3
feat(capture-sdk): Resolving detekt issues
obaidgini Nov 18, 2025
5a4d973
feat(bank-api-library): adding missing params for test
obaidgini Nov 19, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ data class Configuration(
val isSkontoEnabled: Boolean,
val isReturnAssistantEnabled: Boolean,
val amplitudeApiKey: String?,
val transactionDocsEnabled: Boolean,
val instantPaymentEnabled: Boolean,
val isTransactionDocsEnabled: Boolean,
val isInstantPaymentEnabled: Boolean,
val isEInvoiceEnabled: Boolean,
val qrCodeEducationEnabled: Boolean,
val paymentHintsEnabled: Boolean
val isQrCodeEducationEnabled: Boolean,
val isSavePhotosLocallyEnabled: Boolean,
val isAlreadyPaidHintEnabled: Boolean,
val isPaymentDueHintEnabled: Boolean,
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ data class ConfigurationResponse(
@Json(name = "qrCodeEducationEnabled") val qrCodeEducationEnabled: Boolean?,
@Json(name = "instantPaymentEnabled") val instantPaymentEnabled: Boolean?,
@Json(name = "eInvoiceEnabled") val eInvoiceEnabled: Boolean?,
@Json(name = "paymentHintsEnabled") val paymentHintsEnabled: Boolean?,
@Json(name = "alreadyPaidHintEnabled") val alreadyPaidHintEnabled: Boolean?,
@Json(name = "paymentDueHintEnabled") val paymentDueHintEnabled: Boolean?,
@Json(name = "savePhotosLocallyEnabled") val savePhotosLocallyEnabled: Boolean?,
)

internal fun ConfigurationResponse.toConfiguration() = Configuration(
Expand All @@ -24,10 +26,12 @@ internal fun ConfigurationResponse.toConfiguration() = Configuration(
isSkontoEnabled = skontoEnabled ?: false,
isReturnAssistantEnabled = returnAssistantEnabled ?: false,
amplitudeApiKey = amplitudeApiKey,
transactionDocsEnabled = transactionDocsEnabled ?: false,
qrCodeEducationEnabled = qrCodeEducationEnabled ?: false,
instantPaymentEnabled = instantPaymentEnabled ?: false,
isTransactionDocsEnabled = transactionDocsEnabled ?: false,
isQrCodeEducationEnabled = qrCodeEducationEnabled ?: false,
isInstantPaymentEnabled = instantPaymentEnabled ?: false,
isEInvoiceEnabled = eInvoiceEnabled ?: false,
paymentHintsEnabled = paymentHintsEnabled ?: false
isAlreadyPaidHintEnabled = alreadyPaidHintEnabled ?: false,
isPaymentDueHintEnabled = paymentDueHintEnabled ?: false,
isSavePhotosLocallyEnabled = savePhotosLocallyEnabled ?: false,
)

Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,22 @@ class BankApiDocumentRemoteSourceTest {
}

override suspend fun getConfigurations(bearer: Map<String, String>): Response<ConfigurationResponse> {
return Response.success(ConfigurationResponse(
null,
null,
null,
null,
null,
null,
null,
null,
null
))
return Response.success(
ConfigurationResponse(
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
)
)
}

override suspend fun uploadDocument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ import net.gini.android.bank.sdk.exampleapp.core.DefaultNetworkServicesProvider
import net.gini.android.bank.sdk.exampleapp.databinding.ActivityConfigurationBinding
import net.gini.android.bank.sdk.exampleapp.ui.MainActivity.Companion.CAMERA_PERMISSION_BUNDLE
import net.gini.android.bank.sdk.exampleapp.ui.MainActivity.Companion.CONFIGURATION_BUNDLE
import net.gini.android.bank.sdk.exampleapp.ui.data.Configuration
import net.gini.android.bank.sdk.exampleapp.ui.data.ExampleAppBankConfiguration
import net.gini.android.capture.DocumentImportEnabledFileTypes
import net.gini.android.capture.internal.util.ActivityHelper.interceptOnBackPressed
import net.gini.android.capture.util.SharedPreferenceHelper
import net.gini.android.capture.util.SharedPreferenceHelper.SAF_STORAGE_URI_KEY
import javax.inject.Inject

@AndroidEntryPoint
Expand Down Expand Up @@ -107,14 +109,16 @@ class ConfigurationActivity : AppCompatActivity() {
finish()
}

private fun updateUIWithConfigurationObject(configuration: Configuration) {
private fun updateUIWithConfigurationObject(configuration: ExampleAppBankConfiguration) {
// setup sdk with default configuration
binding.layoutFeatureToggle.switchSetupSdkWithDefaultConfiguration.isChecked =
configuration.isDefaultSDKConfigurationsEnabled
// file import
binding.layoutFeatureToggle.switchOpenWith.isChecked = configuration.isFileImportEnabled
// Capture SDK
binding.layoutFeatureToggle.switchCaptureSdk.isChecked = configuration.isCaptureSDK
// Saving Invoices Locally
binding.layoutFeatureToggle.switchSaveInvoicesLocallyFeature.isChecked = configuration.saveInvoicesLocallyEnabled
// QR code scanning
binding.layoutFeatureToggle.switchQrCodeScanning.isChecked = configuration.isQrCodeEnabled
// only QR code scanning
Expand Down Expand Up @@ -225,8 +229,16 @@ class ConfigurationActivity : AppCompatActivity() {
configuration.isReturnAssistantEnabled

// enable payment hints
binding.layoutFeatureToggle.switchSetupPaymentHints.isChecked =
configuration.isPaymentHintsEnabled
binding.layoutFeatureToggle.switchSetupAlreadyPaidHintEnabled.isChecked =
configuration.isAlreadyPaidHintEnabled

// enable payment due hint
binding.layoutFeatureToggle.switchPaymentDueHint.isChecked =
configuration.isPaymentDueHintEnabled

// set payment due hint threshold days
binding.layoutFeatureToggle.editTextPaymentDueHintThresholdDays.hint =
configuration.paymentDueHintThresholdDays.toString()

// enable return reasons dialog
binding.layoutReturnAssistantToggles.switchReturnReasonsDialog.isChecked =
Expand Down Expand Up @@ -561,14 +573,36 @@ class ConfigurationActivity : AppCompatActivity() {
}

//enable payment hints for showing warning
binding.layoutFeatureToggle.switchSetupPaymentHints.setOnCheckedChangeListener{ _, isChecked ->
binding.layoutFeatureToggle.switchSetupAlreadyPaidHintEnabled.setOnCheckedChangeListener{ _, isChecked ->
configurationViewModel.setConfiguration(
configurationViewModel.configurationFlow.value.copy(
isPaymentHintsEnabled = isChecked
isAlreadyPaidHintEnabled = isChecked
)
)
}

//enable payment due hint for showing warning
binding.layoutFeatureToggle.switchPaymentDueHint.setOnCheckedChangeListener{ _, isChecked ->
configurationViewModel.setConfiguration(
configurationViewModel.configurationFlow.value.copy(
isPaymentDueHintEnabled = isChecked
)
)
}

// set payment due hint threshold days
binding.layoutFeatureToggle.editTextPaymentDueHintThresholdDays
.doAfterTextChanged {
if (it.toString().isNotEmpty()) {
configurationViewModel.setConfiguration(
configurationViewModel.configurationFlow.value.copy(
paymentDueHintThresholdDays = it.toString().toInt()
)
)
}
}


// enable supported format help screen
binding.layoutHelpToggles.switchSupportedFormatsScreen.setOnCheckedChangeListener { _, isChecked ->
configurationViewModel.setConfiguration(
Expand Down Expand Up @@ -618,6 +652,21 @@ class ConfigurationActivity : AppCompatActivity() {
)
}

// for internal testing: To simulate the SAF first time experience, in which the picker
// will be shown
binding.layoutFeatureToggle.btnRemoveSafData.setOnClickListener {
SharedPreferenceHelper.saveString(SAF_STORAGE_URI_KEY, "", this)
}
// For testing Save Invoices Locally SDK flag, this is how clients can enable/disable it
binding.layoutFeatureToggle.switchSaveInvoicesLocallyFeature
.setOnCheckedChangeListener { _, isChecked ->
configurationViewModel.setConfiguration(
configurationViewModel.configurationFlow.value.copy(
saveInvoicesLocallyEnabled = isChecked
)
)
}

// enable Gini error logger
binding.layoutDebugDevelopmentOptionsToggles.switchGiniErrorLogger
.setOnCheckedChangeListener { _, isChecked ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import net.gini.android.bank.sdk.exampleapp.ui.adapters.CustomReviewNavigationBa
import net.gini.android.bank.sdk.exampleapp.ui.adapters.CustomSkontoHelpNavigationBarBottomAdapter
import net.gini.android.bank.sdk.exampleapp.ui.adapters.CustomSkontoNavigationBarBottomAdapter
import net.gini.android.bank.sdk.exampleapp.ui.composables.CustomGiniComposableStyleProvider
import net.gini.android.bank.sdk.exampleapp.ui.data.Configuration
import net.gini.android.bank.sdk.exampleapp.ui.data.ExampleAppBankConfiguration
import net.gini.android.capture.GiniCaptureDebug
import net.gini.android.capture.help.HelpItem
import net.gini.android.capture.internal.util.FileImportValidator
Expand All @@ -59,7 +59,7 @@ class ConfigurationViewModel @Inject constructor(
private val _disableCameraPermissionFlow = MutableStateFlow(false)
val disableCameraPermissionFlow: StateFlow<Boolean> = _disableCameraPermissionFlow

private val _configurationFlow = MutableStateFlow(Configuration())
private val _configurationFlow = MutableStateFlow(ExampleAppBankConfiguration())

fun getAlwaysAttachSetting(context: Context): Boolean {
configureGiniBank(context) // Gini Bank should be configured before using transactionDocs
Expand All @@ -77,18 +77,18 @@ class ConfigurationViewModel @Inject constructor(
}
}

val configurationFlow: StateFlow<Configuration> = _configurationFlow
val configurationFlow: StateFlow<ExampleAppBankConfiguration> = _configurationFlow

fun disableCameraPermission(cameraPermission: Boolean) {
_disableCameraPermissionFlow.value = cameraPermission
}

fun setConfiguration(configuration: Configuration) {
fun setConfiguration(configuration: ExampleAppBankConfiguration) {
_configurationFlow.value = configuration
}

fun setupSDKWithDefaultConfigurations() {
_configurationFlow.value = Configuration.setupSDKWithDefaultConfiguration(
_configurationFlow.value = ExampleAppBankConfiguration.setupSDKWithDefaultConfiguration(
configurationFlow.value,
CaptureConfiguration(defaultNetworkServicesProvider.defaultNetworkServiceDebugEnabled)
)
Expand Down Expand Up @@ -122,7 +122,11 @@ class ConfigurationViewModel @Inject constructor(
// enable bottom navigation bar
bottomNavigationBarEnabled = configuration.isBottomNavigationBarEnabled,
// enable payment hints
paymentHintsEnabled = configuration.isPaymentHintsEnabled,
alreadyPaidHintEnabled = configuration.isAlreadyPaidHintEnabled,
// enable payment due hint
paymentDueHintEnabled = configuration.isPaymentDueHintEnabled,
// set payment due hint threshold days
paymentDueHintThresholdDays = configuration.paymentDueHintThresholdDays,
// enable onboarding screens at first launch
showOnboardingAtFirstRun = configuration.isOnboardingAtFirstRunEnabled,
// enable onboarding at every launch
Expand All @@ -142,6 +146,9 @@ class ConfigurationViewModel @Inject constructor(

// enable transaction docs
transactionDocsEnabled = configuration.isTransactionDocsEnabled,

// enables saving invoices locally after analysis
saveInvoicesLocallyEnabled = configuration.saveInvoicesLocallyEnabled,
)

// enable Help screens custom bottom navigation bar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import net.gini.android.bank.sdk.exampleapp.R
import net.gini.android.bank.sdk.exampleapp.core.ExampleUtil.isIntentActionViewOrSend
import net.gini.android.bank.sdk.exampleapp.core.PermissionHandler
import net.gini.android.bank.sdk.exampleapp.databinding.ActivityMainBinding
import net.gini.android.bank.sdk.exampleapp.ui.data.Configuration
import net.gini.android.bank.sdk.exampleapp.ui.data.ExampleAppBankConfiguration
import net.gini.android.bank.sdk.exampleapp.ui.transactiondocs.TransactionDocsActivity
import net.gini.android.capture.Document
import net.gini.android.capture.EntryPoint
Expand Down Expand Up @@ -104,7 +104,7 @@ class MainActivity : AppCompatActivity() {
when (result.resultCode) {
RESULT_CANCELED -> {}
RESULT_OK -> {
val configurationResult: Configuration? = result.data?.getParcelableExtra(
val configurationResult: ExampleAppBankConfiguration? = result.data?.getParcelableExtra(
CONFIGURATION_BUNDLE
)
if (configurationResult != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import kotlinx.parcelize.Parcelize
import net.gini.android.bank.sdk.capture.CaptureConfiguration
import net.gini.android.capture.DocumentImportEnabledFileTypes
import net.gini.android.capture.EntryPoint
import net.gini.android.capture.GiniCapture
import net.gini.android.capture.internal.util.FileImportValidator


@Parcelize
data class Configuration(
data class ExampleAppBankConfiguration(
// setup sdk with default configurations
val isDefaultSDKConfigurationsEnabled: Boolean = false,

Expand Down Expand Up @@ -152,7 +153,13 @@ data class Configuration(
val isReturnReasonsEnabled: Boolean = false,

// enable show warning for paid invoices
val isPaymentHintsEnabled: Boolean = true,
val isAlreadyPaidHintEnabled: Boolean = true,

// enable payment due hint
val isPaymentDueHintEnabled: Boolean = true,

// payment due hint threshold days
val paymentDueHintThresholdDays: Int = GiniCapture.PAYMENT_DUE_HINT_THRESHOLD_DAYS,

// Digital invoice onboarding custom illustration
val isDigitalInvoiceOnboardingCustomIllustrationEnabled: Boolean = false,
Expand Down Expand Up @@ -190,13 +197,16 @@ data class Configuration(
// enable Capture Sdk
val isCaptureSDK: Boolean = false,

) : Parcelable {
// enable/disable save invoices locally feature
val saveInvoicesLocallyEnabled: Boolean = true,

) : Parcelable {

companion object {
companion object Companion {
fun setupSDKWithDefaultConfiguration(
currentConfiguration: Configuration,
currentConfiguration: ExampleAppBankConfiguration,
defaultCaptureConfiguration: CaptureConfiguration,
): Configuration {
): ExampleAppBankConfiguration {
return currentConfiguration.copy(
isFileImportEnabled = defaultCaptureConfiguration.fileImportEnabled,
isQrCodeEnabled = defaultCaptureConfiguration.qrCodeScanningEnabled,
Expand All @@ -206,7 +216,9 @@ data class Configuration(
isFlashDefaultStateEnabled = defaultCaptureConfiguration.flashOnByDefault,
documentImportEnabledFileTypes = defaultCaptureConfiguration.documentImportEnabledFileTypes,
isBottomNavigationBarEnabled = defaultCaptureConfiguration.bottomNavigationBarEnabled,
isPaymentHintsEnabled = defaultCaptureConfiguration.paymentHintsEnabled,
isAlreadyPaidHintEnabled = defaultCaptureConfiguration.alreadyPaidHintEnabled,
isPaymentDueHintEnabled = defaultCaptureConfiguration.paymentDueHintEnabled,
paymentDueHintThresholdDays = defaultCaptureConfiguration.paymentDueHintThresholdDays,
isOnboardingAtFirstRunEnabled = defaultCaptureConfiguration.showOnboardingAtFirstRun,
isOnboardingAtEveryLaunchEnabled = defaultCaptureConfiguration.showOnboarding,
isSupportedFormatsHelpScreenEnabled = defaultCaptureConfiguration.supportedFormatsHelpScreenEnabled,
Expand All @@ -215,7 +227,8 @@ data class Configuration(
isAllowScreenshotsEnabled = defaultCaptureConfiguration.allowScreenshots,
isSkontoEnabled = defaultCaptureConfiguration.skontoEnabled,
isTransactionDocsEnabled = defaultCaptureConfiguration.transactionDocsEnabled,
isCaptureSDK = currentConfiguration.isCaptureSDK
isCaptureSDK = currentConfiguration.isCaptureSDK,
saveInvoicesLocallyEnabled = currentConfiguration.saveInvoicesLocallyEnabled
)
}
}
Expand Down
Loading
Loading