From 0bce93d37fc70b977b97151539cb881c7220756e Mon Sep 17 00:00:00 2001 From: ABDALRAHMAN MOLOOD Date: Tue, 31 Jul 2018 21:56:24 +0200 Subject: [PATCH 1/3] Update to set ccv length Update to set ccv length from any where :) --- .../java/com/braintreepayments/cardform/view/CvvEditText.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java b/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java index a2d288c1..ea61c86a 100644 --- a/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java +++ b/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java @@ -115,6 +115,9 @@ private int getSecurityCodeLength() { return mCardType.getSecurityCodeLength(); } } + public int setSecurityCodeLength(int length) { + DEFAULT_MAX_LENGTH = length; + } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) {} From b68b62ef41a237b03ab532e8b0973f71384022e1 Mon Sep 17 00:00:00 2001 From: ABDALRAHMAN MOLOOD Date: Tue, 31 Jul 2018 22:03:03 +0200 Subject: [PATCH 2/3] Update CvvEditText.java Ability to change CCV length --- .../java/com/braintreepayments/cardform/view/CvvEditText.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java b/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java index ea61c86a..8ae3c8b2 100644 --- a/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java +++ b/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java @@ -17,7 +17,7 @@ */ public class CvvEditText extends ErrorEditText implements TextWatcher { - private static final int DEFAULT_MAX_LENGTH = 3; + public static int DEFAULT_MAX_LENGTH = 3; private CardType mCardType; From e10db010669fec2708918d1f5c99cb4f15681fed Mon Sep 17 00:00:00 2001 From: ABDALRAHMAN MOLOOD Date: Tue, 31 Jul 2018 22:08:57 +0200 Subject: [PATCH 3/3] Update CvvEditText.java Fix ``` /CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java:120: error: missing return statement } ``` --- .../java/com/braintreepayments/cardform/view/CvvEditText.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java b/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java index 8ae3c8b2..c8a2a896 100644 --- a/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java +++ b/CardForm/src/main/java/com/braintreepayments/cardform/view/CvvEditText.java @@ -115,7 +115,7 @@ private int getSecurityCodeLength() { return mCardType.getSecurityCodeLength(); } } - public int setSecurityCodeLength(int length) { + public void setSecurityCodeLength(int length) { DEFAULT_MAX_LENGTH = length; }