I think it's too late to answer this question, but actually there is a way to achieve your goal. You just need to add the following line to your checkbox:
android:button="@null"
android:drawableRight="?android:attr/listChoiceIndicatorMultiple"
You can use your customized drawable for checkbox as well.
And for a radioButton:
android:button="@null"
android:drawableRight="@android:drawable/btn_radio"
And if you want to do it programmatically:
Define a layout and name it RightCheckBox and copy the following lines :
<?xml version="1.0" encoding="utf-8"?>
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
android:text="hello"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:button="@null"
android:drawableRight="?android:attr/listChoiceIndicatorMultiple"/>
and when you need to add it programmatically you just need to inflate it to a CheckBox and add it to the root view.
CheckBox cb = (CheckBox)((LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE)).inflate(R.layout.check_right_checkbox,null);
rootView.addView(cb);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…