package com.paint.trace.drawing.customview;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;

import androidx.annotation.Nullable;

import com.paint.trace.drawing.R;
import com.paint.trace.drawing.other.Utils;

public class MyTextView extends androidx.appcompat.widget.AppCompatTextView {


    public MyTextView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initAttrs(context,attrs);
    }


    private void initAttrs(Context context, AttributeSet attrs){
        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MyTV);
        boolean aBoolean = typedArray.getBoolean(R.styleable.MyTV_apply_font,false);
        if(aBoolean){
            Utils.initFont(this);
        }

        typedArray.recycle();
    }



}
