I am trying to create a RadioButton in android. My requirement is that the label should be always left aligned and icon should be right aligned(evenly distributed, as first item in attached screenshot). I was able to achieve it. But this is not working when the label has no character and only digits between 0 to 9. I also tried adding space, but no luck. Can someone please help?
<RadioButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listRadioItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_weight="1"
android:ellipsize="end"
android:layoutDirection="rtl"
android:maxLines="1"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:text="123"
android:layout_gravity="start"
android:textAlignment="textStart" />