@Test public void deleteWhenEmpty_fromCvc_shiftsToExpiry() { mCardMultilineWidget.setCardInputListener(mFullCardListener); mNoZipCardMultilineWidget.setCardInputListener(mNoZipCardListener); mFullGroup.expiryDateEditText.append("12"); mFullGroup.expiryDateEditText.append("50"); reset(mFullCardListener); assertTrue(mFullGroup.cvcEditText.hasFocus()); ViewTestUtils.sendDeleteKeyEvent(mFullGroup.cvcEditText); verify(mFullCardListener, times(1)).onFocusChange(FOCUS_EXPIRY); assertTrue(mFullGroup.expiryDateEditText.hasFocus()); assertEquals("12/5", mFullGroup.expiryDateEditText.getText().toString()); mNoZipGroup.expiryDateEditText.append("12"); mNoZipGroup.expiryDateEditText.append("50"); reset(mNoZipCardListener); assertTrue(mNoZipGroup.cvcEditText.hasFocus()); ViewTestUtils.sendDeleteKeyEvent(mNoZipGroup.cvcEditText); verify(mNoZipCardListener, times(1)).onFocusChange(FOCUS_EXPIRY); assertTrue(mNoZipGroup.expiryDateEditText.hasFocus()); assertEquals("12/5", mNoZipGroup.expiryDateEditText.getText().toString()); }
public void setCardInputListener(@Nullable CardInputListener cardInputListener) { mCardInputListener = cardInputListener; }
CardMultilineWidget extends LinearLayout { public void setCardInputListener(@Nullable CardInputListener cardInputListener) { mCardInputListener = cardInputListener; } }
CardMultilineWidget extends LinearLayout { public void setCardInputListener(@Nullable CardInputListener cardInputListener) { mCardInputListener = cardInputListener; } 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 setCardInputListener(@Nullable CardInputListener cardInputListener) { mCardInputListener = cardInputListener; } 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 setCardInputListener(@Nullable CardInputListener cardInputListener) { mCardInputListener = cardInputListener; } 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);  }