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

[TextInputLayout] Percentage Corner Radius fail to work when Layout Direction set to RTL

Open
#3,623 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

**Description:** Percentage Corner Radius using `shapeAppearance` property fail to work when Layout Direction set to RTL but it works fine when I set its corners directly in `dp` using `24dp`.

**Expected behavior:** Percentage Corner Radius using `shapeAppearance` property for `TextInputLayout` should work like LTR direction.

**Example:**
Both layouts are with `app:shapeAppearance="@style/custom_rounded_corner_full" style.

```

<item name="cornerFamily">rounded</item>
<item name="cornerSizeTopRight">50%</item>
<item name="cornerSizeTopLeft">50%</item>
<item name="cornerSizeBottomRight">50%</item>
<item name="cornerSizeBottomLeft">50%</item>

```

but for second one I've
set `android:layoutDirection="ltr"` and for first one `android:layoutDirection="rtl"`
![image](https://github.com/material-components/material-components-android/assets/125660596/8bb89d68-5b10-412a-a384-3db15b013d1d)

**Material Library version:** 1.9.0

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 reported TextInputLayout example with the custom shapeAppearance style in both RTL and LTR directions. Trace how percentage corner sizes are resolved for each direction; done means the RTL layout renders the percentage corners like the LTR layout without requiring direct dp corner values.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile-dev
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.