private void init(AttributeSet attrs) {
if (attrs != null) {
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.TypeFaceTextView);
String fontName = a.getString(R.styleable.TypeFaceTextView_fontName);
if (fontName != null) {
Typeface myTypeface = inflatedFonts.get(fontName);
if (myTypeface == null) {
myTypeface = Typeface.createFromAsset(getContext().getAssets(), "fonts/" + fontName);
inflatedFonts.put(fontName, myTypeface);
}
setTypeface(myTypeface);
}
a.recycle();
}
}
TypeFaceTextView.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:android-permission-checker-app
作者:
评论列表
文章目录