Code example for TextPaint

Methods: setAntiAlias, setColor, setTextAlign, setTextSize

0
 
        mBreakerExpanded = new LineBreaker();
        mBreakerCollapsed = new LineBreaker();
 
        // Default font size and color. 
        mTextPaint = new TextPaint();
        mTextPaint.setAntiAlias(true);
        mTextPaint.setTextSize(13);
        mTextPaint.setColor(0xFF000000);
        mTextPaint.setTextAlign(Align.LEFT);
    } 
 
    /** 
     * Sets the text to display in this widget. 
     * 
     * @param text The text to display. 
     */ 
    public void setText(String text) {
        mText = text;
        requestLayout();
        invalidate();