How can I have an icon in the center of the checkbox. The checkbox has a width and height of 48x48
and the icon is having width and height of 24x24
Image for reference ( the icon is attached on the left side of checkbox, but I want it to be in center )
I have already checked out answers here, and they don't seem to work for me. Does anybody has a better approach which I can apply here
XML code :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/tags_dialog_tag_item"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingStart="8dp"
android:paddingEnd="8dp">
<ImageButton
android:id="@+id/id_expand_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_chevron_right_black"
android:clickable="false" />
<TextView
android:id="@+id/tags_dialog_tag_item_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingStart="6dp"
android:textSize="16sp"
tools:text="Items Text" />
<com.myapp.ui.CheckBoxStates
android:id="@+id/tags_dialog_tag_item_checkbox"
android:layout_width="48dp"
android:layout_height="48dp"
android:clickable="false"
app:cycle_checked_to_indeterminate="false"
app:cycle_indeterminate_to_checked="false"/>
</LinearLayout>