package com.ads.cal.marquee;

import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;

public class PaintTextBean {

    public PaintTextBean(Paint paint, String text, Rect rect) {
        this.t = paint;
        rect.setEmpty();
        t.getTextBounds(text, 0, text.length(), rect);
        width = rect.width();
        height = rect.height();
        t.setShadowLayer(150f, 0, 0, Color.parseColor("#ffffff"));
    }
    public Paint t;
    public int width, height;

    public void setValue(String text, Rect rect) {
        rect.setEmpty();
        t.getTextBounds(text, 0, text.length(), rect);
        width = rect.width();
        height = rect.height();
    }

    public void setTextColor(int color) {
        t.setColor(color);
    }

    public void setTextShadowLayer(int color) {
        t.setShadowLayer(t.getTextSize(), 0, 0, color);
    }
}
