@Test(expected = IllegalArgumentException.class) public void setCount_fail_on_negative() { badge.setCount(-1); }
public final void setCount(@IntRange(from = 0) int count) { if (count < 0) { throw new IllegalArgumentException("must be 0 <= count"); } if (this.count != count) { this.count = count; setText(count == 0 ? null : String.valueOf(count)); } }
CountBadge extends TextBadge { public final void setCount(@IntRange(from = 0) int count) { if (count < 0) { throw new IllegalArgumentException("must be 0 <= count"); } if (this.count != count) { this.count = count; setText(count == 0 ? null : String.valueOf(count)); } } }
CountBadge extends TextBadge { public final void setCount(@IntRange(from = 0) int count) { if (count < 0) { throw new IllegalArgumentException("must be 0 <= count"); } if (this.count != count) { this.count = count; setText(count == 0 ? null : String.valueOf(count)); } } CountBadge(@NonNull Context context, @NonNull BadgeShape shape);  CountBadge(@NonNull BadgeShape shape, @ColorInt int badgeColor, @ColorInt int textColor); }
CountBadge extends TextBadge { public final void setCount(@IntRange(from = 0) int count) { if (count < 0) { throw new IllegalArgumentException("must be 0 <= count"); } if (this.count != count) { this.count = count; setText(count == 0 ? null : String.valueOf(count)); } } CountBadge(@NonNull Context context, @NonNull BadgeShape shape);  CountBadge(@NonNull BadgeShape shape, @ColorInt int badgeColor, @ColorInt int textColor); final void setCount(@IntRange(from = 0) int count); final int getCount(); }
CountBadge extends TextBadge { public final void setCount(@IntRange(from = 0) int count) { if (count < 0) { throw new IllegalArgumentException("must be 0 <= count"); } if (this.count != count) { this.count = count; setText(count == 0 ? null : String.valueOf(count)); } } CountBadge(@NonNull Context context, @NonNull BadgeShape shape);  CountBadge(@NonNull BadgeShape shape, @ColorInt int badgeColor, @ColorInt int textColor); final void setCount(@IntRange(from = 0) int count); final int getCount();  }