Code example for Paint

Methods: setAntiAlias, setTextAlign

0
 
    public TextRectsView(Context context, AttributeSet attrs) {
        super(context, attrs);
 
        mRects = new LinkedList<TextRect>();
        mPaint = new Paint();
        mPaint.setTextAlign(Align.CENTER);
        mPaint.setAntiAlias(true);
    } 
 
    public LinkedList<TextRect> getRects() {
        return new LinkedList<TextRect>(mRects);
    } 
 
    public void clearRects() { 
        mRects.clear();
    } 
 
    public void addRect(String text, Rect rect) {
        if (text != null && rect != null) {
            TextRect entry = new TextRect(text, rect);