package com.cartoon.wallpapers.live.utils;



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

import androidx.annotation.Nullable;

import com.cartoon.wallpapers.live.MyWallpaperApp;
import com.cartoon.wallpapers.live.R;


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


    public MyText(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.MyTextView);
        boolean aBoolean = typedArray.getBoolean(R.styleable.MyTextView_apply_font,false);
        if(aBoolean){
            setTypeface(MyWallpaperApp.getDefaultFont());
        }

        typedArray.recycle();
    }



}
