CheckableRelativeLayoutpublic class CheckableRelativeLayout extends android.widget.RelativeLayout implements android.widget.CheckableA special variation of RelativeLayout that can be used as a checkable object.
This allows it to be used as the top-level view of a list view item, which
also supports checking. Otherwise, it works identically to a RelativeLayout. |
Fields Summary |
---|
private boolean | mChecked | private static final int[] | CHECKED_STATE_SET |
Methods Summary |
---|
public boolean | isChecked()
return mChecked;
| protected int[] | onCreateDrawableState(int extraSpace)
final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
if (isChecked()) {
mergeDrawableStates(drawableState, CHECKED_STATE_SET);
}
return drawableState;
| public void | setChecked(boolean checked)
if (mChecked != checked) {
mChecked = checked;
refreshDrawableState();
}
| public void | toggle()
setChecked(!mChecked);
|
|