Skip to content

Instantly share code, notes, and snippets.

@pavelupward
pavelupward / CheckableImageButton.java
Created March 19, 2018 14:46 — forked from AlexKorovyansky/CheckableImageButton.java
Implementation of checkable ImageButton, with behaviour similar to Checkbox and support of state_checked selectors. Based on http://kmansoft.com/2011/01/11/checkable-image-button/
public class CheckableImageButton extends ImageButton implements Checkable {
private boolean checked;
private boolean broadcasting;
private OnCheckedChangeListener onCheckedChangeListener;
private static final int[] CHECKED_STATE_SET = { android.R.attr.state_checked };
public CheckableImageButton(Context context) {