As in, this one below:
I need this default drawable so I can programmatically style it to my auto-generated checkboxes, like so:
checkBox.setButtonDrawable(R.drawable.checkbox_style);
I need this checkbox drawable because Samsung GT-I9300 with Android 4.3 (Jellybean) overrides this style above, like so:
This is my app theme:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/colorPrimary</item>
<item name="colorControlNormal">#88FFFFFF</item>
<item name="colorControlActivated">#88FFFFFF</item>
<item name="colorControlHighlight">@color/colorAccent</item>
<item name="android:textColorHint">@android:color/white</item>
</style>
What is it's name, like android.R.drawable.(...)
, please?
<style name="Widget.CompoundButton.CheckBox">
<item name="android:background">@android:drawable/btn_check_label_background</item>
<item name="android:button">?android:attr/listChoiceIndicatorMultiple</item>
</style>
do you want like this for check box
checkBox.setButtonDrawable(R.drawable.abc_btn_check_material);
or you can use AppCompatCheckBox like this
LinearLayout llParent=(LinearLayout)findViewById(R.id.llParent);
AppCompatCheckBox appCompatCheckBox = new AppCompatCheckBox(this);
appCompatCheckBox.setText("agree or not");
llParent.addView(appCompatCheckBox);
and add the dependancy for design support lib build.gradle file
compile 'com.android.support:appcompat-v7:23.3.0'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With