material-components / material-components/material-components-android
[BadgeDrawable] Support animated appearing / disappearing
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Its about animating the badge appearing / disappearing. In past we added a custom implementation (Just a custom View) in our app, to introduce a scaling animation.
E.g.:

We want to switch to the new BadgeDrawable in our BottomNav and TabLayout, since it is supported in the new versions, but to animate the Badge is not possible in this way.
**Describe the solution you'd like**
Would be nice to make the bounds of the BadgeDrawable scaleable. I tried by myself, but the access to the bounds are hidden / not possible.
An additional idea would be to add more support to in/out animations.
* Like the setter methods for in / out animations of [ViewAnimator](https://developer.android.com/reference/android/widget/ViewAnimator).
* Also a dedicated callback method could be possible. Which sends you the drawable as parameter when appearing / disappearing, which allows you to manipulate the drawable (overtime or instant)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading BadgeDrawable and the request's example animation, then compare the desired scaling and in/out animation behavior with its use in BottomNav and TabLayout. Done would provide a defined way to animate badge appearance and disappearance, either through scalable bounds or animation and callback support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- design, mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100