StyleableToast.java 文件源码

java
阅读 30 收藏 0 点赞 0 评论 0

项目:StyleableToast 作者:
private void makeTextView() {
    loadTextViewStyleAttributes();
    textView.setText(text);
    if (textColor != 0) {
        textView.setTextColor(textColor);
    }

    if (textSize > 0) {
        textView.setTextSize(isTextSizeFromStyle ? 0 : TypedValue.COMPLEX_UNIT_SP, textSize);
    }

    if (textBold && typeface == null) {
        textView.setTypeface(Typeface.create(context.getString(R.string.default_font), Typeface.BOLD));
    } else if (textBold) {
        textView.setTypeface(Typeface.create(typeface, Typeface.BOLD));
    } else if (typeface != null) {
        textView.setTypeface(typeface);
        //TODO THIS CHECK IS DEPRECATED AND WILL BE DELETED SOON
    } else if (fontId > 0) {
        textView.setTypeface(ResourcesCompat.getFont(context, fontId));
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号