Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextInputLayout.getTypeface incorrectly annotated with @NonNull #25

Closed
lisawray opened this issue Jan 3, 2017 · 1 comment
Closed
Labels

Comments

@lisawray
Copy link

lisawray commented Jan 3, 2017

Overview

The setter for typeface is annotated with @Nullable, and the getter is @NonNull. One or the other is wrong.

Currently, the getter does return null.

You can see the problem pretty easily ...

  public void setTypeface(@Nullable Typeface typeface) {
    if (typeface != mTypeface) {
      mTypeface = typeface;

      mCollapsingTextHelper.setTypefaces(typeface);
      if (mCounterView != null) {
        mCounterView.setTypeface(typeface);
      }
      if (mErrorView != null) {
        mErrorView.setTypeface(typeface);
      }
    }
  }

  /**
   * Returns the typeface used for the hint and any label views (such as counter and error views).
   */
  @NonNull
  public Typeface getTypeface() {
    return mTypeface;
  }

Version number

  • 25.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants