package com.wall.turing.wallpapers.uutils;

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

import androidx.annotation.Nullable;

import com.wall.turing.wallpapers.WallpaperApplication;
import com.wall.turing.wallpapers.R;


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


    public CustomText(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.CustomeTv);
        boolean aBoolean = typedArray.getBoolean(R.styleable.CustomeTv_apply_font,false);
        if(aBoolean){
            setTypeface(WallpaperApplication.defaultFont);
        }

        typedArray.recycle();
    }



}
