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

[TabLayout] Add Padding to TabItems

Open
#766 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Widget: Tab
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.**
We need to be able to add extra padding between the Tab Item content and the Tab Indicator. Currently there does not seem to be an exposed way to set the padding to be used for TabItems.

**Describe the solution you'd like**

Expose a way to set a particular padding style for the text and be able to set a default for the tab padding. I notice there is a TabLayout_tabInlineLabel, but there is no documentation on how this works or if it will even do what we want to do.

**Describe alternatives you've considered**
We've considered manually including the tabItems in the tablayout layout file, and then setting margins or padding, but this doesn't work well for programmatically adding tabs.

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 with the TabLayout and TabItem APIs, then inspect the TabLayout_tabInlineLabel attribute and the layout-file approach mentioned in the issue. Done means callers can configure padding for tab text and set a default tab padding, including for tabs added programmatically.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
design, mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.