Code example for ColorStateList

Methods: isStateful

    public boolean isStateful() { 
         * The drawable's ability to represent state is based on 
         * the text color list set 
        return mTextColors.isStateful();
    protected boolean onStateChange(int[] state) {
        //Upon state changes, grab the correct text color 
        return updateTextColors(state);
    public int getIntrinsicHeight() { 
        //Return the vertical bounds measured, or -1 if none 
        if (mTextBounds.isEmpty()) {
            return -1; 
        } else { 
Connect your IDE to all the code out there  Get Codota for Java