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

Add Views to Toolbar added to CollapsingToolbarLayout

Open
#1,867 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**Description:** The problem is when I add a view for Exmaple an ImageButton to toolbar that is direct child of CollapsingToolbarLayout that ImageButton's `layout_gravity` is not true in Rtl languages. When I set `layout_gravity` to `start` for exmaple, this ImageButton's is sticked to left of toolbar in English language(as a Ltr language) but in persian language(as a Rtl language) it is sticked to left of toolbar again(as this means `end` not `start`).

**Expected behavior:** `layout_gravity="start"` of direct child of toolbar in CollapsingToolbarLayout should stick to right of toolbar and vice versa.

**Source code:**
```


```

**Android API version:** Any but tested in 29

**Material Library version:** 1.2.1 latest stable right now

**Device:** Nexus 4 emulator

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

Use the supplied XML as the reproduction case and start at CollapsingToolbarLayout's handling of direct toolbar children and layout_gravity. Compare English and Persian/RTL behavior for start and end. Done when start and end place the ImageView on the corresponding relative edge in both layout directions.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.