material-components / material-components/material-components-android
[Widget.Material3.Badge] Badge in TabLayout overlaps text
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Description:** Material 3 appears to have regressed [this](https://github.com/material-components/material-components-android/issues/475) issue. A badge containing numbers overlaps the text so much that it obscures the last letter of the label.

**Expected behavior:** The label should not be obscured
**Source code:**
_activity_main.xml_
```
```
_MainActivity.kt - onCreate_
```
TabLayoutMediator(tabs, viewPager) { tab, position ->
val badge = tab.getOrCreateBadge()
badge.number = 1
tab.text = resources.getString(TAB_TITLES[position])
}.attach()
```
**Android API version:** Tested on API 29
**Material Library version:** com.google.android.material:material:1.5.0
**Device:** AVD - Nexus 4
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
Reproduce the overlap using activity_main.xml and the MainActivity.kt onCreate code with TabLayoutMediator, API 29, and Material 1.5.0. Start by inspecting the TabLayout badge and tab-label behavior; done means numeric badges no longer obscure the final character of tab labels.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100