@Test public void shouldIconShowBrand_whenNotAmexAndCvcStringLengthIsThree_isTrue() { assertTrue(shouldIconShowBrand(Card.VISA, true, "999")); assertTrue(shouldIconShowBrand(Card.DISCOVER, true, "123")); assertTrue(shouldIconShowBrand(Card.JCB, true, "555")); assertTrue(shouldIconShowBrand(Card.MASTERCARD, true, "919")); assertTrue(shouldIconShowBrand(Card.DINERS_CLUB, true, "415")); assertTrue(shouldIconShowBrand(Card.UNKNOWN, true, "212")); }
@VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context);  CardInputWidget(Context context, AttributeSet attrs);  CardInputWidget(Context context, AttributeSet attrs, int defStyleAttr); }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context);  CardInputWidget(Context context, AttributeSet attrs);  CardInputWidget(Context context, AttributeSet attrs, int defStyleAttr); @Nullable Card getCard(); void setCardInputListener(@Nullable CardInputListener listener); void setCardNumber(String cardNumber); void setExpiryDate(
            @IntRange(from = 1, to = 12) int month,
            @IntRange(from = 0, to = 9999) int year); void setCvcCode(String cvcCode); void clear(); void setEnabled(boolean isEnabled); @Override boolean isEnabled(); @Override boolean onInterceptTouchEvent(MotionEvent ev); @Override void onWindowFocusChanged(boolean hasWindowFocus); }
CardInputWidget extends LinearLayout { @VisibleForTesting static boolean shouldIconShowBrand( @NonNull @Card.CardBrand String brand, boolean cvcHasFocus, @Nullable String cvcText) { if (!cvcHasFocus) { return true; } return ViewUtils.isCvcMaximalLength(brand, cvcText); } CardInputWidget(Context context);  CardInputWidget(Context context, AttributeSet attrs);  CardInputWidget(Context context, AttributeSet attrs, int defStyleAttr); @Nullable Card getCard(); void setCardInputListener(@Nullable CardInputListener listener); void setCardNumber(String cardNumber); void setExpiryDate(
            @IntRange(from = 1, to = 12) int month,
            @IntRange(from = 0, to = 9999) int year); void setCvcCode(String cvcCode); void clear(); void setEnabled(boolean isEnabled); @Override boolean isEnabled(); @Override boolean onInterceptTouchEvent(MotionEvent ev); @Override void onWindowFocusChanged(boolean hasWindowFocus);  }