@Test @SuppressWarnings("deprecation") public void getDefaultErrorColorInt_onLightTheme_returnsLightError() { mEditText.setTextColor( mActivityController.get().getResources() .getColor(android.R.color.primary_text_light)); @ColorInt int colorInt = mEditText.getDefaultErrorColorInt(); @ColorInt int expectedErrorInt = mActivityController.get().getResources().getColor(R.color.error_text_light_theme); assertEquals(expectedErrorInt, colorInt); }
@ColorInt @SuppressWarnings("deprecation") public int getDefaultErrorColorInt() { @ColorInt int errorColor; determineDefaultErrorColor(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { errorColor = getResources().getColor(mDefaultErrorColorResId, null); } else { errorColor = getResources().getColor(mDefaultErrorColorResId); } return errorColor; }
StripeEditText extends TextInputEditText { @ColorInt @SuppressWarnings("deprecation") public int getDefaultErrorColorInt() { @ColorInt int errorColor; determineDefaultErrorColor(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { errorColor = getResources().getColor(mDefaultErrorColorResId, null); } else { errorColor = getResources().getColor(mDefaultErrorColorResId); } return errorColor; } }
StripeEditText extends TextInputEditText { @ColorInt @SuppressWarnings("deprecation") public int getDefaultErrorColorInt() { @ColorInt int errorColor; determineDefaultErrorColor(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { errorColor = getResources().getColor(mDefaultErrorColorResId, null); } else { errorColor = getResources().getColor(mDefaultErrorColorResId); } return errorColor; } StripeEditText(Context context);  StripeEditText(Context context, AttributeSet attrs);  StripeEditText(Context context, AttributeSet attrs, int defStyleAttr); }
StripeEditText extends TextInputEditText { @ColorInt @SuppressWarnings("deprecation") public int getDefaultErrorColorInt() { @ColorInt int errorColor; determineDefaultErrorColor(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { errorColor = getResources().getColor(mDefaultErrorColorResId, null); } else { errorColor = getResources().getColor(mDefaultErrorColorResId); } return errorColor; } StripeEditText(Context context);  StripeEditText(Context context, AttributeSet attrs);  StripeEditText(Context context, AttributeSet attrs, int defStyleAttr); @Nullable ColorStateList getCachedColorStateList(); boolean getShouldShowError(); @ColorInt @SuppressWarnings("deprecation") int getDefaultErrorColorInt(); @Override InputConnection onCreateInputConnection(EditorInfo outAttrs); void setErrorColor(@ColorInt int errorColor); void setHintDelayed(@StringRes final int hintResource, long delayMilliseconds); @SuppressWarnings("deprecation") void setShouldShowError(boolean shouldShowError); }
StripeEditText extends TextInputEditText { @ColorInt @SuppressWarnings("deprecation") public int getDefaultErrorColorInt() { @ColorInt int errorColor; determineDefaultErrorColor(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { errorColor = getResources().getColor(mDefaultErrorColorResId, null); } else { errorColor = getResources().getColor(mDefaultErrorColorResId); } return errorColor; } StripeEditText(Context context);  StripeEditText(Context context, AttributeSet attrs);  StripeEditText(Context context, AttributeSet attrs, int defStyleAttr); @Nullable ColorStateList getCachedColorStateList(); boolean getShouldShowError(); @ColorInt @SuppressWarnings("deprecation") int getDefaultErrorColorInt(); @Override InputConnection onCreateInputConnection(EditorInfo outAttrs); void setErrorColor(@ColorInt int errorColor); void setHintDelayed(@StringRes final int hintResource, long delayMilliseconds); @SuppressWarnings("deprecation") void setShouldShowError(boolean shouldShowError);  }