BebasNeueTextView.java 1.12 KB
package com.wd.common.widget;

import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.jetbrains.annotations.NotNull;

/**
 * @Description: 类描述
 * @Author: Li Yubing
 * @Email: liyubing@wondert.com.cn
 * @CreateDate: 2023/9/13 15:00
 * @Version: 1.0
 */
public class BebasNeueTextView extends androidx.appcompat.widget.AppCompatTextView {
    public BebasNeueTextView(@NonNull @NotNull Context context) {
        super(context);
        ttf(context);
    }

    public BebasNeueTextView(@NonNull @NotNull Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs) {
        super(context, attrs);
        ttf(context);
    }

    public BebasNeueTextView(@NonNull @NotNull Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        ttf(context);
    }

    private void ttf(Context context){

        setTypeface(Typeface.createFromAsset(context.getAssets(), "ttf/BebasNeue.ttf"));
    }


}