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

[TabLayout] Indicator with tabIndicatorFullWidth=false does not match label if label is not centered

Open
#1,413 9 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: Tab
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:**

I have this style
```

<item name="tabIndicatorFullWidth">false</item>
<item name="tabMode">scrollable</item>
<item name="tabPaddingStart">0dp</item>
<item name="tabPaddingEnd">16dp</item>
<item name="tabGravity">start</item>
<item name="tabContentStart">0dp</item>
<item name="tabMinWidth">0dp</item>

```

and it renders as this
![Screenshot_20200617-110524](https://user-images.githubusercontent.com/3774524/84879078-05a71480-b08b-11ea-8ab6-6cf98826ce2b.png)

**Expected behavior:**

Indicator should match label width

**Android API version:**
29

**Material Library version:**
1,3.0-alpha01

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 at the TabLayout entry point and reproduce the supplied style on Android API 29 with Material Library 1.3.0-alpha01, especially tabIndicatorFullWidth=false with a non-centered label. Compare the indicator and label widths using the configuration shown; done means the indicator matches the label width.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
design, mobile
Issue type
Bug
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.