deano2390/FlowTextView

android:TextSize attribute is not applied

Opened this issue · 1 comments

The problem is inside init(Context context, AttributeSet attrs)method.
readAttrs() should be moved to the top of the method, since setTextSizeis applied before attribute is being read. This is how it should look like:

private void init(Context context, AttributeSet attrs) {
        if (attrs != null) {
            readAttrs(context, attrs);
        }
        mTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
        mTextPaint.density = getResources().getDisplayMetrics().density;
        mTextPaint.setTextSize(mTextsize);
        mTextPaint.setColor(Color.BLACK);
        mLinkPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
        mLinkPaint.density = getResources().getDisplayMetrics().density;
        mLinkPaint.setTextSize(mTextsize);
        mLinkPaint.setColor(Color.BLUE);
        mLinkPaint.setUnderlineText(true);
        this.setBackgroundColor(Color.TRANSPARENT);
        this.setOnTouchListener(mClickHandler);
    }

You can override the textpaint using setTextPaint until this issue is fixed.