BebasNeueTextView.java
1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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"));
}
}