diff --git a/.editorconfig b/.editorconfig index 95d358222f..2c5125ea63 100644 --- a/.editorconfig +++ b/.editorconfig @@ -477,6 +477,8 @@ ktlint_standard_trailing-comma-on-call-site = disabled ktlint_standard_trailing-comma-on-declaration-site = disabled ktlint_standard_function-signature = disabled ktlint_function_naming_ignore_when_annotated_with = Composable +ktlint_standard_function-expression-body = disabled +ktlint_standard_class-signature = disabled max_line_length = 120 ij_kotlin_align_in_columns_case_branch = false ij_kotlin_align_multiline_binary_operation = false diff --git a/card/src/main/java/com/adyen/checkout/card/internal/util/KcpValidationUtils.kt b/card/src/main/java/com/adyen/checkout/card/internal/util/KcpValidationUtils.kt index fc1090d5d1..3ba830b551 100644 --- a/card/src/main/java/com/adyen/checkout/card/internal/util/KcpValidationUtils.kt +++ b/card/src/main/java/com/adyen/checkout/card/internal/util/KcpValidationUtils.kt @@ -27,10 +27,10 @@ internal object KcpValidationUtils { fun validateKcpBirthDateOrTaxNumber(birthDateOrTaxNumber: String): FieldState { val inputLength = birthDateOrTaxNumber.length val validation = when { - inputLength == KCP_BIRTH_DATE_LENGTH && DateUtils.matchesFormat( - birthDateOrTaxNumber, - KCP_BIRTH_DATE_FORMAT - ) -> Validation.Valid + inputLength == KCP_BIRTH_DATE_LENGTH && + DateUtils.matchesFormat(birthDateOrTaxNumber, KCP_BIRTH_DATE_FORMAT) + -> Validation.Valid + inputLength == KCP_TAX_NUMBER_LENGTH -> Validation.Valid else -> Validation.Invalid(R.string.checkout_kcp_birth_date_or_tax_number_invalid) } diff --git a/dependencies.gradle b/dependencies.gradle index 9f79e7e4cd..2f5240f8fc 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -30,7 +30,7 @@ ext { // Code quality detekt_version = "1.23.6" jacoco_version = '0.8.12' - ktlint_version = '1.2.1' + ktlint_version = '1.3.1' sonarqube_version = '5.0.0.4638' binary_compatibility_validator_version = "0.14.0" diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index a5a946b586..93fb199f45 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -6374,6 +6374,11 @@ + + + + + @@ -6382,11 +6387,24 @@ + + + + + + + + + + + + + @@ -6395,11 +6413,24 @@ + + + + + + + + + + + + + @@ -6408,6 +6439,14 @@ + + + + + + + + @@ -7379,6 +7418,14 @@ + + + + + + + + @@ -7395,6 +7442,14 @@ + + + + + + + + @@ -7411,6 +7466,14 @@ + + + + + + + + @@ -7427,6 +7490,14 @@ + + + + + + + + @@ -7443,6 +7514,14 @@ + + + + + + + + @@ -7459,6 +7538,14 @@ + + + + + + + + @@ -7475,6 +7562,14 @@ + + + + + + + + @@ -7491,6 +7586,14 @@ + + + + + + + + @@ -7507,6 +7610,14 @@ + + + + + + + + @@ -7523,6 +7634,14 @@ + + + + + + + + @@ -7547,6 +7666,14 @@ + + + + + + + + @@ -7571,6 +7698,14 @@ + + + + + + + + @@ -7587,6 +7722,14 @@ + + + + + + + + @@ -7611,6 +7754,14 @@ + + + + + + + + @@ -7635,6 +7786,14 @@ + + + + + + + + @@ -8248,6 +8407,11 @@ + + + + + @@ -8264,6 +8428,14 @@ + + + + + + + + @@ -8290,6 +8462,11 @@ + + + + + @@ -8306,6 +8483,14 @@ + + + + + + + + @@ -8343,6 +8528,14 @@ + + + + + + + + @@ -9097,6 +9290,14 @@ + + + + + + + + @@ -9775,6 +9976,11 @@ + + + + + @@ -9791,6 +9997,14 @@ + + + + + + + + @@ -10964,6 +11178,9 @@ + + + @@ -11048,6 +11265,9 @@ + + + diff --git a/ui-core/src/main/java/com/adyen/checkout/ui/core/internal/ui/view/AdyenSwipeToRevealLayout.kt b/ui-core/src/main/java/com/adyen/checkout/ui/core/internal/ui/view/AdyenSwipeToRevealLayout.kt index 9d7331a8da..07c1d84d1e 100644 --- a/ui-core/src/main/java/com/adyen/checkout/ui/core/internal/ui/view/AdyenSwipeToRevealLayout.kt +++ b/ui-core/src/main/java/com/adyen/checkout/ui/core/internal/ui/view/AdyenSwipeToRevealLayout.kt @@ -199,8 +199,10 @@ class AdyenSwipeToRevealLayout @JvmOverloads constructor( override fun onLongPress(e: MotionEvent) { val isUnderlayHidden = mainView.right == rectMainNotDragged.right - val didHitMainView = e.x >= mainView.left && e.x <= mainView.right && - e.y >= mainView.top && e.y <= mainView.bottom + val didHitMainView = e.x >= mainView.left && + e.x <= mainView.right && + e.y >= mainView.top && + e.y <= mainView.bottom if (isUnderlayHidden && didHitMainView && !isDragLocked) { expandUnderlay() } @@ -208,8 +210,10 @@ class AdyenSwipeToRevealLayout @JvmOverloads constructor( override fun onSingleTapConfirmed(e: MotionEvent): Boolean { val isUnderlayHidden = mainView.right == rectMainNotDragged.right - val didHitMainView = e.x >= mainView.left && e.x <= mainView.right && - e.y >= mainView.top && e.y <= mainView.bottom + val didHitMainView = e.x >= mainView.left && + e.x <= mainView.right && + e.y >= mainView.top && + e.y <= mainView.bottom return if (didHitMainView) { if (isUnderlayHidden) { onMainClickListener?.onClick() @@ -377,8 +381,10 @@ class AdyenSwipeToRevealLayout @JvmOverloads constructor( calculateDragDistance(ev) val isIdle = dragHelper.viewDragState == ViewDragHelper.STATE_IDLE && isDragging - val canPerformClickOnUnderlay = ev.x >= mainView.right && ev.x <= mainView.left && - ev.y >= mainView.top && ev.y <= mainView.bottom && + val canPerformClickOnUnderlay = ev.x >= mainView.right && + ev.x <= mainView.left && + ev.y >= mainView.top && + ev.y <= mainView.bottom && dragDistance < dragHelper.touchSlop val isSettling = dragHelper.viewDragState == ViewDragHelper.STATE_SETTLING