material-components / material-components/material-components-android
[ShapeAppearanceModel] Automatically handle RTL layout
@imhappi is already working on this.
Since Jun 6, 2022.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
Consider the following style using `MaterialCardView`:
```xml
<item name="shapeAppearance">@style/ShapeAppearance.AppTheme.DiagonallyRounded</item>
<item name="cornerSize">24dp</item>
<item name="cornerFamily">rounded</item>
<item name="cornerSizeBottomRight">0dp</item>
<item name="cornerSizeTopLeft">0dp</item>
```
Clearly, this will display a card rounded in the top-right and bottom-left corners (since others are set to `0`). When the layout is set to RTL, it should swap the positions (it does not here since it correctly handles `left` or `right` instead of `start` or `end`).
**Describe the solution you'd like**
It should be logical to rename the existing options or provide new options such as `cornerSizeBottomEnd`, `cornerSizeTopStart` which would handle RTL layouts.
**Describe alternatives you've considered**
Handle it myself programmatically.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.