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

[MaterialRadioButton] Add support for setting the padding between the left edge of the layout and the radio button

Open
#4,198 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I would like to be able to adjust the padding between the left edge of the layout and the radio button so that the area is clickable:
![Screenshot-from-2024-06-03-18-47-37](https://github.com/material-components/material-components-android/assets/3276264/0e31ccd5-8ea1-46f9-ada1-82c2372dc263)
Using `paddingStart` adds space between the indicator and the title, which is not the desired effect to me.
![Screenshot-from-2024-06-03-18-47-37 (1)](https://github.com/material-components/material-components-android/assets/3276264/f1884bc0-8219-4a30-a672-2dde73f1e2f6)
Currently to achieve the desired effect I need to wrap that radio button into another layout and make it clickable or create a custom drawable:
https://stackoverflow.com/a/48153475/5479029

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

No source file or test is named. Start by locating the MaterialRadioButton implementation and its existing padding behavior; done means callers can configure space between the layout edge and the indicator while preserving the indicator-to-title spacing and making that area clickable.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Feature
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.