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

[MaterialToolbar] Navigation icon is not centered vertically with top padding applied

Open
#4,211 4 comments 2 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:** Navigation icon (maybe all icons) is not centered vertically with top padding applied

**Expected behavior:** Icons should be vertically centered

**Android API version:** Any version. Reproduced even in studio preview

**Material Library version:** Material Android Library version 1.12.0 (also tested on 1.13.0-alpha03)

Assume we have a simple layout
```

```

if we add `android:paddingTop="10dp"` to `MaterialToolbar` title will still be vertically centered with respect to new constraints, however navigation icon will be placed slightly lower than expected.

![image](https://github.com/material-components/material-components-android/assets/1794870/d587ddc3-6241-4268-b61c-da62ddbf2181)
![image](https://github.com/material-components/material-components-android/assets/1794870/48021961-623a-4160-9cc6-dd410cc8f9ae)
![image](https://github.com/material-components/material-components-android/assets/1794870/a6ca7ddd-9820-4c8d-abba-62e0d4ca0a4a)

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 by reproducing the issue with the provided MaterialToolbar layout and android:paddingTop="10dp". Inspect MaterialToolbar's navigation icon layout behavior; done means the navigation icon, and any affected icons, remain vertically centered within the padded toolbar.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.