@Test public void clear_whenZipRequiredAndAllFieldsEntered_clearsAllfields() { assertTrue(Calendar.getInstance().get(Calendar.YEAR) < 2050); mFullGroup.cardNumberEditText.setText(VALID_VISA_WITH_SPACES); mFullGroup.expiryDateEditText.append("12"); mFullGroup.expiryDateEditText.append("50"); mFullGroup.cvcEditText.append("123"); mFullGroup.postalCodeEditText.append("12345"); mCardMultilineWidget.clear(); assertEquals("", mFullGroup.cardNumberEditText.getText().toString()); assertEquals("", mFullGroup.expiryDateEditText.getText().toString()); assertEquals("", mFullGroup.cvcEditText.getText().toString()); assertEquals("", mFullGroup.postalCodeEditText.getText().toString()); }
public void clear() { mCardNumberEditText.setText(""); mExpiryDateEditText.setText(""); mCvcEditText.setText(""); mPostalCodeEditText.setText(""); mCardNumberEditText.setShouldShowError(false); mExpiryDateEditText.setShouldShowError(false); mCvcEditText.setShouldShowError(false); mPostalCodeEditText.setShouldShowError(false); updateBrand(Card.UNKNOWN); }
CardMultilineWidget extends LinearLayout { public void clear() { mCardNumberEditText.setText(""); mExpiryDateEditText.setText(""); mCvcEditText.setText(""); mPostalCodeEditText.setText(""); mCardNumberEditText.setShouldShowError(false); mExpiryDateEditText.setShouldShowError(false); mCvcEditText.setShouldShowError(false); mPostalCodeEditText.setShouldShowError(false); updateBrand(Card.UNKNOWN); } }
CardMultilineWidget extends LinearLayout { public void clear() { mCardNumberEditText.setText(""); mExpiryDateEditText.setText(""); mCvcEditText.setText(""); mPostalCodeEditText.setText(""); mCardNumberEditText.setShouldShowError(false); mExpiryDateEditText.setShouldShowError(false); mCvcEditText.setShouldShowError(false); mPostalCodeEditText.setShouldShowError(false); updateBrand(Card.UNKNOWN); } CardMultilineWidget(Context context);  CardMultilineWidget(Context context, AttributeSet attrs);  CardMultilineWidget(Context context, AttributeSet attrs, int defStyleAttr); @VisibleForTesting  CardMultilineWidget(Context context, boolean shouldShowPostalCode); }
CardMultilineWidget extends LinearLayout { public void clear() { mCardNumberEditText.setText(""); mExpiryDateEditText.setText(""); mCvcEditText.setText(""); mPostalCodeEditText.setText(""); mCardNumberEditText.setShouldShowError(false); mExpiryDateEditText.setShouldShowError(false); mCvcEditText.setShouldShowError(false); mPostalCodeEditText.setShouldShowError(false); updateBrand(Card.UNKNOWN); } CardMultilineWidget(Context context);  CardMultilineWidget(Context context, AttributeSet attrs);  CardMultilineWidget(Context context, AttributeSet attrs, int defStyleAttr); @VisibleForTesting  CardMultilineWidget(Context context, boolean shouldShowPostalCode); void clear(); void setCardInputListener(@Nullable CardInputListener cardInputListener); @Nullable Card getCard(); boolean validateAllFields(); @Override void onWindowFocusChanged(boolean hasWindowFocus); void setShouldShowPostalCode(boolean shouldShowPostalCode); @Override boolean isEnabled(); @Override void setEnabled(boolean enabled); }
CardMultilineWidget extends LinearLayout { public void clear() { mCardNumberEditText.setText(""); mExpiryDateEditText.setText(""); mCvcEditText.setText(""); mPostalCodeEditText.setText(""); mCardNumberEditText.setShouldShowError(false); mExpiryDateEditText.setShouldShowError(false); mCvcEditText.setShouldShowError(false); mPostalCodeEditText.setShouldShowError(false); updateBrand(Card.UNKNOWN); } CardMultilineWidget(Context context);  CardMultilineWidget(Context context, AttributeSet attrs);  CardMultilineWidget(Context context, AttributeSet attrs, int defStyleAttr); @VisibleForTesting  CardMultilineWidget(Context context, boolean shouldShowPostalCode); void clear(); void setCardInputListener(@Nullable CardInputListener cardInputListener); @Nullable Card getCard(); boolean validateAllFields(); @Override void onWindowFocusChanged(boolean hasWindowFocus); void setShouldShowPostalCode(boolean shouldShowPostalCode); @Override boolean isEnabled(); @Override void setEnabled(boolean enabled);  }