Skip to content

Commit

Permalink
Merge pull request #1822 from Adyen/chore/expiry-date-autofill-hint
Browse files Browse the repository at this point in the history
Fix expiry date autofill hint
  • Loading branch information
OscarSpruit authored Oct 11, 2024
2 parents c9fec23 + 4000a37 commit 3dddd31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package com.adyen.checkout.card.internal.ui.view
import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
import android.os.Build
import android.text.Editable
import android.text.InputType
import android.util.AttributeSet
Expand Down Expand Up @@ -86,6 +87,10 @@ class CardView @JvmOverloads constructor(
orientation = VERTICAL
val padding = resources.getDimension(UICoreR.dimen.standard_margin).toInt()
setPadding(padding, padding, padding, 0)

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
binding.editTextExpiryDate.setAutofillHints(AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE)
}
}

override fun onAttachedToWindow() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package com.adyen.checkout.ui.core.internal.ui.view

import android.content.Context
import android.os.Build
import android.text.Editable
import android.util.AttributeSet
import androidx.annotation.RestrictTo
Expand Down Expand Up @@ -39,9 +38,6 @@ constructor(
enforceMaxInputLength(MAX_LENGTH)
// Make sure DateFormat only accepts the correct formatting.
dateFormat.isLenient = false
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
setAutofillHints(AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE)
}
}

public override fun afterTextChanged(editable: Editable) {
Expand Down

0 comments on commit 3dddd31

Please sign in to comment.