Skip to content

Commit

Permalink
-Fixed #13
Browse files Browse the repository at this point in the history
  • Loading branch information
vinaygaba committed Jul 9, 2015
1 parent f3c10c2 commit 8e10696
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ public String getCardNumber() {

public void setCardNumber(String cardNumber) {
mCardNumber = cardNumber.replaceAll("\\s+", "");
this.cardNumber.setText(addSpaceToCardNumber(mCardNumber));
redrawViews();
}

Expand All @@ -411,6 +412,7 @@ public String getCardName() {

public void setCardName(String cardName) {
mCardName = cardName.toUpperCase();
this.cardName.setText(mCardName);
redrawViews();
}

Expand All @@ -421,6 +423,7 @@ public int getCardNumberTextColor() {

public void setCardNumberTextColor(@ColorInt int cardNumberTextColor) {
mCardNumberTextColor = cardNumberTextColor;
this.cardNumber.setTextColor(mCardNumberTextColor);
redrawViews();
}

Expand All @@ -436,6 +439,7 @@ public void setCardNumberFormat(@CreditCardFormat int cardNumberFormat) {
"unknown");
}
mCardNumberFormat = cardNumberFormat;
this.cardNumber.setText(checkCardNumberFormat(mCardNumber));
redrawViews();
}

Expand All @@ -446,6 +450,7 @@ public int getCardNameTextColor() {

public void setCardNameTextColor(@ColorInt int cardNameTextColor) {
mCardNameTextColor = cardNameTextColor;
this.cardName.setTextColor(mCardNameTextColor);
redrawViews();
}

Expand All @@ -455,6 +460,7 @@ public String getExpiryDate() {

public void setExpiryDate(String expiryDate) {
mExpiryDate = expiryDate;
this.expiryDate.setText(mExpiryDate);
redrawViews();
}

Expand All @@ -465,6 +471,7 @@ public int getExpiryDateTextColor() {

public void setExpiryDateTextColor(@ColorInt int expiryDateTextColor) {
mExpiryDateTextColor = expiryDateTextColor;
this.expiryDate.setTextColor(mExpiryDateTextColor);
redrawViews();
}

Expand All @@ -475,6 +482,7 @@ public int getValidTillTextColor() {

public void setValidTillTextColor(@ColorInt int validTillTextColor) {
mValidTillTextColor = validTillTextColor;
this.validTill.setTextColor(mValidTillTextColor);
redrawViews();
}

Expand All @@ -489,6 +497,7 @@ public void setType(@CreditCardType int type) {
"Use `CardType.*` or `CardType.AUTO` if unknown");
}
mType = type;
this.type.setBackgroundResource(getLogo(mType));
redrawViews();
}

Expand Down Expand Up @@ -535,6 +544,10 @@ public int getHintTextColor() {

public void setHintTextColor(@ColorInt int hintTextColor) {
mHintTextColor = hintTextColor;
this.cardName.setHintTextColor(mHintTextColor);
this.cardNumber.setHintTextColor(mHintTextColor);
this.expiryDate.setHintTextColor(mHintTextColor);

redrawViews();
}

Expand All @@ -545,6 +558,7 @@ public int getBrandLogo() {

public void setBrandLogo(@DrawableRes int brandLogo) {
mBrandLogo = brandLogo;
this.brandLogo.setBackgroundResource(mBrandLogo);
redrawViews();
}

Expand All @@ -558,6 +572,7 @@ public void setBrandLogoPosition(int brandLogoPosition) {

public void putChip(boolean flag) {
mPutChip = flag;
chip.setVisibility(mPutChip?View.VISIBLE:View.GONE);
redrawViews();
}

Expand Down

0 comments on commit 8e10696

Please sign in to comment.