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

[CollapsingToolbarLayout] maxLines breakes expandedTitleGravity when RTL direction is used

Open
#2,795 0 comments 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:** maxLines breakes expandedTitleGravity setting when RTL direction is used. For example when expandedTitleGravity="start" and maxLines="2", text is always from left to right no matter if use title in english or arabic language.

**Expected behavior:** max lines should not change expandedTitleGravity behaviour

**Source code:**

```



```

**Android API version:** API 30

**Material Library version:** 1.6.1

**Device:** Pixel

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 CollapsingToolbarLayout and reproduce the XML example using API 30, maxLines="2", expandedTitleGravity="start", and an RTL title. Trace how the expanded title is laid out when maxLines is enabled; done means start gravity remains correct for both English and Arabic text, with regression coverage if the project provides a relevant test location.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.