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

[MaterialToolbar] Subtitle is cut off when font-size is increased via accessibility options

Open
#4,101 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**Description:**

When the font-size is increased via the system accessibility settings (`fontScale`), then the subtitle is being cutoff on the bottom despite using `wrap_content` on the toolbar.

![Screenshot from 2024-03-14 16-15-47](https://github.com/material-components/material-components-android/assets/1439229/b3ace3bf-6ddb-4f97-ad7c-e4b47ab18741)
![Screenshot from 2024-03-14 16-15-22](https://github.com/material-components/material-components-android/assets/1439229/c99e340d-d9c5-40e8-8639-54a0130374e7)
![Screenshot from 2024-03-14 16-21-17](https://github.com/material-components/material-components-android/assets/1439229/a263d8fb-b791-470b-a07e-d7e220e361bb)

**Expected behavior:**

Toolbar should grow in height and keep the default paddings, and center the title/subtitle combo.

**Source code:**

https://github.com/d4rken-org/sdmaid-se/blob/e10ade68a4e2cae6cccf963862c318e29ba3acf7/app/src/main/res/layout/appcontrol_list_fragment.xml#L8

https://github.com/d4rken-org/sdmaid-se/blob/e10ade68a4e2cae6cccf963862c318e29ba3acf7/app/src/main/res/values/styles.xml#L194

**Android API version:**

AFAIK, all versions, I tested on Android 13 and 14.

**Material Library version:**
`1.11.0

**Device:**
Pixel 6 (and others)

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 linked app/src/main/res/layout/appcontrol_list_fragment.xml and app/src/main/res/values/styles.xml files, then reproduce the issue with an increased system fontScale on Android 13 or 14. Done means the MaterialToolbar grows with the subtitle, preserves its default padding, and keeps the title/subtitle combination centered without clipping.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.