Code example for ColorStateList

Methods: getColorForStategetDefaultColor

0
            } 
 
            float baseLine = endY - fm.descent;
 
            if (textColorStateList != null) {
                int currentColor = textColorStateList.getColorForState(getState(),
                        textColorStateList.getDefaultColor());
                textPaint.setColor(currentColor);
            } 
            canvas.drawText(String.valueOf(numStr), o_x - length / 2, baseLine, textPaint);
            // 
            // FontMetrics fm = textPaint.getFontMetrics(); 
            // 
            // textPaint.setColor(Color.BLACK); 
            // canvas.save(); 
            // canvas.translate(0, 30); 
            // canvas.drawText("xxYz��", 0, 0, textPaint); 
            // canvas.drawLine(0, fm.ascent, bitmap.getWidth(), fm.ascent, 
            // textPaint); 
            // canvas.drawLine(0, fm.descent, bitmap.getWidth(), fm.descent, 
Experience pair programming with AI  Get Codota for Java