Skip to content

Instantly share code, notes, and snippets.

@eveliotc
Created January 10, 2013 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eveliotc/4506761 to your computer and use it in GitHub Desktop.
Save eveliotc/4506761 to your computer and use it in GitHub Desktop.
How to use resources versioning to workaround CompoundButton fix https://github.com/android/platform_frameworks_base/commit/2842679d3426295b6674dfcfb8591fad79de6cb2
<!-- res/values/styles.xml -->
<style name="MyCheckbox" parent="@android:style/Widget.CompoundButton.CheckBox">
<item name="android:button">@drawable/btn_check</item>
<item name="android:paddingLeft">@dimen/checkbox_padding_left_workaround</item>
<!-- yada yada yada -->
</style>
<!-- res/values/dimens.xml -->
<dimen name="checkbox_padding_left_workaround">50dip</dimen> <!-- or whatever your drawable is -->
<!-- res/values-v17/dimens.xml -->
<dimen name="checkbox_padding_left_workaround">0dip</dimen> <!-- yup, you got it -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment