@Test public void onDeleteFromCvcDate_whenEmpty_shiftsFocusToExpiryAndDeletesDigit() { assertTrue(Calendar.getInstance().get(Calendar.YEAR) < 2080); mCardInputWidget.setCardInputListener(mCardInputListener); mCardNumberEditText.setText(VALID_VISA_WITH_SPACES); verify(mCardInputListener).onCardComplete(); verify(mCardInputListener).onFocusChange(FOCUS_EXPIRY); mExpiryEditText.append("12"); mExpiryEditText.append("79"); verify(mCardInputListener).onExpirationComplete(); verify(mCardInputListener).onFocusChange(FOCUS_CVC); assertTrue(mCvcEditText.hasFocus()); reset(mCardInputListener); ViewTestUtils.sendDeleteKeyEvent(mCvcEditText); verify(mCardInputListener).onFocusChange(FOCUS_EXPIRY); assertEquals(R.id.et_cvc_number, mOnGlobalFocusChangeListener.getOldFocusId()); assertEquals(R.id.et_expiry_date, mOnGlobalFocusChangeListener.getNewFocusId()); String expectedResult = "12/7"; assertEquals(expectedResult, mExpiryEditText.getText().toString()); assertEquals(expectedResult.length(), mExpiryEditText.getSelectionStart()); }
public void setCardInputListener(@Nullable CardInputListener listener) { mCardInputListener = listener; }
CardInputWidget extends LinearLayout { public void setCardInputListener(@Nullable CardInputListener listener) { mCardInputListener = listener; } }
CardInputWidget extends LinearLayout { public void setCardInputListener(@Nullable CardInputListener listener) { mCardInputListener = listener; } CardInputWidget(Context context);  CardInputWidget(Context context, AttributeSet attrs);  CardInputWidget(Context context, AttributeSet attrs, int defStyleAttr); }
CardInputWidget extends LinearLayout { public void setCardInputListener(@Nullable CardInputListener listener) { mCardInputListener = listener; } 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 { public void setCardInputListener(@Nullable CardInputListener listener) { mCardInputListener = listener; } 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);  }