material-components / material-components/material-components-android
[TabLayout] setHeight(or setSize) for TabItem's BadgeDrawable ?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Hello
How can I set height(or size) for BadgeDrawable in TabLayout ?
```
TabLayoutMediator(view.tabLayout, view.viewPager, TabLayoutMediator.TabConfigurationStrategy { tab, position ->
tab.orCreateBadge.apply {
backgroundColor = Color.parseColor("#db635d")
horizontalOffset = -10
}
tab.text = when (position) {
0 -> "주문 내역"
1 -> "받은 선물"
else -> null
}
}).attach()
```
expected

but I've got

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 with TabLayoutMediator and tab.orCreateBadge, then inspect the BadgeDrawable and TabLayout APIs for supported sizing controls. Compare the rendered badge with the supplied screenshots; done means the badge size or height can be configured to produce the expected appearance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- design, mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100