material-components / material-components/material-components-android

[BadgeDrawable] Support animated appearing / disappearing

Open
#676 4 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting Design Feedback feature request Widget: Badge
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.:
![badge_animation](https://user-images.githubusercontent.com/24591955/66751229-ce92ba80-ee8e-11e9-865f-b4d8dbdf710c.gif)

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.