FileDocCategorySizeDatePackage
CheckableRelativeLayout.javaAPI DocAndroid 1.5 API1956Wed May 06 22:42:46 BST 2009com.android.music

CheckableRelativeLayout

public class CheckableRelativeLayout extends android.widget.RelativeLayout implements android.widget.Checkable
A 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
Constructors Summary
public CheckableRelativeLayout(android.content.Context context, android.util.AttributeSet attrs)


         
        super(context, attrs);
    
Methods Summary
public booleanisChecked()

        return mChecked;
    
protected int[]onCreateDrawableState(int extraSpace)

        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
        if (isChecked()) {
            mergeDrawableStates(drawableState, CHECKED_STATE_SET);
        }
        return drawableState;
    
public voidsetChecked(boolean checked)

        if (mChecked != checked) {
            mChecked = checked;
            refreshDrawableState();
        }
    
public voidtoggle()

        setChecked(!mChecked);