package com.hd.live.wall.wallpapers.utils;



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

import androidx.annotation.Nullable;

import com.hd.live.wall.wallpapers.LiveApp;
import com.hd.live.wall.wallpapers.R;


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


    public FontTextView(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(LiveApp.getDefaultFont());
        }

        typedArray.recycle();
    }



}
