@Test public void setText() { String expected = badge.getText() + "::2"; TestDrawableCallback callback = new TestDrawableCallback(); badge.setCallback(callback); badge.setText(expected); assertThat(badge.getText(), equalTo(expected)); callback.assertInvalidated(); }
public final void setText(@Nullable CharSequence text) { String trimmedText = text == null ? "" : text.toString().trim(); if (!this.text.equals(trimmedText)) { this.text = trimmedText; invalidateSelf(); } }
TextBadge extends BadgeDrawable { public final void setText(@Nullable CharSequence text) { String trimmedText = text == null ? "" : text.toString().trim(); if (!this.text.equals(trimmedText)) { this.text = trimmedText; invalidateSelf(); } } }
TextBadge extends BadgeDrawable { public final void setText(@Nullable CharSequence text) { String trimmedText = text == null ? "" : text.toString().trim(); if (!this.text.equals(trimmedText)) { this.text = trimmedText; invalidateSelf(); } } TextBadge(@NonNull Context context, @NonNull BadgeShape shape); protected  TextBadge(@NonNull BadgeShape shape, @ColorInt int badgeColor, @ColorInt int textColor); }
TextBadge extends BadgeDrawable { public final void setText(@Nullable CharSequence text) { String trimmedText = text == null ? "" : text.toString().trim(); if (!this.text.equals(trimmedText)) { this.text = trimmedText; invalidateSelf(); } } TextBadge(@NonNull Context context, @NonNull BadgeShape shape); protected  TextBadge(@NonNull BadgeShape shape, @ColorInt int badgeColor, @ColorInt int textColor); @Override @SuppressLint("NewApi") void draw(@NonNull Canvas canvas); @Override int getLayoutDirection(); @Override boolean onLayoutDirectionChanged(int layoutDirection); @Override @SuppressLint("NewApi") void setAlpha(int alpha); @Override @SuppressLint("NewApi") void setColorFilter(@Nullable ColorFilter colorFilter); final void setText(@Nullable CharSequence text); final String getText(); }
TextBadge extends BadgeDrawable { public final void setText(@Nullable CharSequence text) { String trimmedText = text == null ? "" : text.toString().trim(); if (!this.text.equals(trimmedText)) { this.text = trimmedText; invalidateSelf(); } } TextBadge(@NonNull Context context, @NonNull BadgeShape shape); protected  TextBadge(@NonNull BadgeShape shape, @ColorInt int badgeColor, @ColorInt int textColor); @Override @SuppressLint("NewApi") void draw(@NonNull Canvas canvas); @Override int getLayoutDirection(); @Override boolean onLayoutDirectionChanged(int layoutDirection); @Override @SuppressLint("NewApi") void setAlpha(int alpha); @Override @SuppressLint("NewApi") void setColorFilter(@Nullable ColorFilter colorFilter); final void setText(@Nullable CharSequence text); final String getText();  }