本文整理汇总了Java中com.devspark.robototextview.util.RobotoTypefaceManager类的典型用法代码示例。如果您正苦于以下问题:Java RobotoTypefaceManager类的具体用法?Java RobotoTypefaceManager怎么用?Java RobotoTypefaceManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RobotoTypefaceManager类属于com.devspark.robototextview.util包,在下文中一共展示了RobotoTypefaceManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setActionText2
import com.devspark.robototextview.util.RobotoTypefaceManager; //导入依赖的package包/类
private void setActionText2(FacetCategory category) {
SpannableStringBuilder sb = new SpannableStringBuilder();
String cat = category.getDescriptor();
String sub = getContext().getString(R.string.filter_by_all_category_with_selected);
RobotoTypefaceSpan robotoTypefaceSpan = new RobotoTypefaceSpan(getContext(),
RobotoTypefaceManager.Typeface.ROBOTO_BLACK);
Spannable spannable = new SpannableString(cat);
spannable.setSpan(robotoTypefaceSpan, 0, spannable.length() - 1,
Spannable.SPAN_INCLUSIVE_INCLUSIVE);
spannable.setSpan(new RelativeSizeSpan(1.5f), 0, spannable.length() - 1,
Spannable.SPAN_INCLUSIVE_INCLUSIVE);
Logs.ui("Span: " + spannable.getSpanStart(robotoTypefaceSpan) + "-->" +
spannable.getSpanEnd(robotoTypefaceSpan));
sb.append(spannable).append("\n").append(sub);
actionButton.setText(sb.toString());
}
示例2: createHeader
import com.devspark.robototextview.util.RobotoTypefaceManager; //导入依赖的package包/类
public RobotoTextView createHeader() {
RobotoTextView tv = new RobotoTextView(getContext());
tv.setTextColor(getResources().getColor(R.color.category_label_header));
Typeface typeface = RobotoTypefaceManager.obtainTypeface(getContext(),
RobotoTypefaceManager.Typeface.ROBOTO_LIGHT);
RobotoTextViewUtils.setTypeface(tv, typeface);
tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(
R.dimen.element_card_header_text_size));
int padding = getResources().getDimensionPixelSize(R.dimen.element_card_header_padding);
tv.setPadding(padding, padding * 2, padding, padding);
final FlowLayout.LayoutParams params = new FlowLayout.LayoutParams(
FlowLayout.LayoutParams.MATCH_PARENT, FlowLayout.LayoutParams.WRAP_CONTENT);
tv.setLayoutParams(params);
return tv;
}
示例3: TitleTextView
import com.devspark.robototextview.util.RobotoTypefaceManager; //导入依赖的package包/类
public TitleTextView(Context c) {
super(c);
if (!isInEditMode()) {
int type = new FontPreferences(getContext()).getFontTypeTitle().getTypeface();
Typeface typeface;
if (type >= 0) {
typeface = RobotoTypefaceManager.obtainTypeface(c, type);
} else {
typeface = Typeface.DEFAULT;
}
setTypeface(typeface);
}
}