12 Commits

Author SHA1 Message Date
Chaoyang0201
632675e1a8 [BadgeDrawable] add horizontal and vertical offset to control position
Resolves https://github.com/material-components/material-components-android/pull/638
Resolves https://github.com/material-components/material-components-android/issues/630

Co-authored-by: wcshi <connieshi@google.com>

GIT_ORIGIN_REV_ID=511c955a11e05fdc0848c74938c4c194da22826e
PiperOrigin-RevId: 275522709
2019-11-01 13:28:23 -07:00
connieshi
d4d0e7f5e9 Update badge gravity enum values to use Gravity values. Add unit test.
PiperOrigin-RevId: 268485092
2019-09-12 14:09:30 -04:00
connieshi
31d0c08300 Update BadgeDrawble's center coordinate calculation to alleviate anchor content being overlapped by badge content.
Also limit on 1 character to be displayed in a round badge, 2+ characters will now be displayed in a pill shaped badge.

PiperOrigin-RevId: 264904269
2019-08-29 10:19:37 -04:00
connieshi
0558a36c9a Add support for configuring badge gravity.
PiperOrigin-RevId: 259223232
2019-07-22 12:22:00 -04:00
connieshi
ebaccf5a85 Add support for badgeStyle, a theme level style attribute for customizing the appearance of badges.
PiperOrigin-RevId: 249338990
2019-05-24 14:16:22 -04:00
connieshi
3ad423e6b9 Update BottomNavigationItemView to include BadgeDrawable's content description.
Add setter for numberless and numbered badge content descriptions.

PiperOrigin-RevId: 244910418
2019-04-29 15:28:30 -07:00
connieshi
9d73854a97 Add SavedState for BadgeDrawable.
PiperOrigin-RevId: 244672502
2019-04-29 15:20:48 -07:00
connieshi
d195fadce0 Fix typo in formatted string that set the first argument as string instead of decimal.
Fix lint warnings.

PiperOrigin-RevId: 242114925
2019-04-05 16:04:19 -04:00
connieshi
9594f64985 Implement basic layout and drawing functionality for BadgeDrawable.
PiperOrigin-RevId: 237500680
2019-03-22 15:55:00 -04:00
connieshi
046089cf13 Fix values-21 name spelling error, should be values-v21 instead.
PiperOrigin-RevId: 237451216
2019-03-22 15:53:56 -04:00
connieshi
4455d1904c Add TextAppearance.MaterialComponents.Badge (Roboto Medium 10sp). Intentionally not adding it to res-public/public.xml nor a corresponding theme attribute because it is meant to be used internally by the library only.
PiperOrigin-RevId: 237446384
2019-03-22 15:52:59 -04:00
connieshi
59bc6c3ebe Add boilerplate code (getters, setters, override abstract methods) define custom attributes for new custom drawable, BadgeDrawable.
PiperOrigin-RevId: 235037646
2019-02-24 14:30:54 -05:00