I want to display a textview with a compound drawable which wraps the content - the shape and the text. Here is my code:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text_category_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:drawableStart="@drawable/shape_circle"
android:drawablePadding="10dp"
android:padding="10dp"
android:textSize="16sp" />
drawableLeft works fine, it wraps the shape and and text, no problem. But drawableStart (and so I assume drawableEnd) seems to wrap the text, THEN add the image, and as such trim the text, so it looks like this:
I've tried removing the drawablePadding, padding, layout_marginStart - these don't have an effect on the text still being trimmed.
Is there a non-hacky way to fix this? I don't want to have to set a specific width, and I do want to use drawableStart and not drawableLeft if possible. I've had a look for existing answers, and all I can find so far is that it is a quirk of the RTL nature of drawableStart/End, but I can't see a clean solution.