checkbox - Android: Compound Drawables With Intrinsic Bounds on 4.2.2 and below -
i try use checkbox left compound drawable this:
holder.selcategorycheckbox.setcompounddrawableswithintrinsicbounds(imageresource, 0, 0, 0);
xml:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="50dp" android:orientation="horizontal"> <checkbox android:id="@+id/category_sel_checkbox" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_toleftof="@+id/categoryselectionoptions" android:layout_tostartof="@+id/categoryselectionoptions" android:drawablepadding="@dimen/more_than_big_padding" android:paddingleft="@dimen/big_padding" android:paddingtop="@dimen/big_padding" android:paddingbottom="@dimen/big_padding" android:singleline="true" android:textsize="18sp" android:layout_marginleft="@dimen/five_margin" android:layout_marginstart="@dimen/five_margin"/> <imageview android:id="@+id/categoryselectionoptions" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignparentright="true" android:layout_alignparentend="true" android:layout_marginleft="@dimen/main_middle_margin" android:layout_marginstart="@dimen/main_middle_margin" android:background="@drawable/row_selector_list_dots" android:clickable="true" android:src="@drawable/ic_action_drawer_dots" android:contentdescription="@string/image" android:layout_centervertical="true" />
on android 4.3 jelly bean , working fine:
but on android 4.2 jelly bean , below spacing broken:
some ideas, what's wrong?
temporary workaround:
<framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="50dp"> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:gravity="center_vertical"> <imageview android:id="@+id/category_sel_icon" android:layout_width="32dp" android:layout_height="32dp" android:layout_marginleft="@dimen/larger_margin" android:layout_marginstart="@dimen/larger_margin"/> <textview android:id="@+id/category_sel_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginleft="@dimen/middle_margin" android:layout_marginstart="@dimen/middle_margin" android:layout_marginright="@dimen/large_margin" android:layout_marginend="@dimen/large_margin" android:singleline="true" android:textsize="18sp"/> </linearlayout> <framelayout android:layout_width="match_parent" android:layout_height="match_parent"> <checkbox android:id="@+id/category_sel_checkbox" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginleft="@dimen/five_margin" android:layout_marginstart="@dimen/five_margin"/> </framelayout> <framelayout android:layout_width="match_parent" android:layout_height="match_parent"> <imageview android:id="@+id/categoryselectionoptions" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginleft="@dimen/main_middle_margin" android:layout_marginstart="@dimen/main_middle_margin" android:background="@drawable/row_selector_list_dots" android:layout_gravity="end" android:clickable="true" android:src="@drawable/ic_action_drawer_dots" android:contentdescription="@string/image" /> </framelayout>
Comments
Post a Comment