本文整理汇总了Java中android.widget.CheckedTextView.setTypeface方法的典型用法代码示例。如果您正苦于以下问题:Java CheckedTextView.setTypeface方法的具体用法?Java CheckedTextView.setTypeface怎么用?Java CheckedTextView.setTypeface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.CheckedTextView
的用法示例。
在下文中一共展示了CheckedTextView.setTypeface方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupTopModulePager
import android.widget.CheckedTextView; //导入方法依赖的package包/类
protected void setupTopModulePager(LayoutInflater inflater, ViewGroup container, View view, String[] buttonTitles) {
int dp4 = DisplayUtils.dpToPx(view.getContext(), 4);
int dp80 = DisplayUtils.dpToPx(view.getContext(), 80);
for (int i = 0; i < buttonTitles.length; i++) {
CheckedTextView rb = (CheckedTextView) inflater.inflate(R.layout.stats_top_module_pager_button, container, false);
RadioGroup.LayoutParams params = new RadioGroup.LayoutParams(RadioGroup.LayoutParams.MATCH_PARENT,
RadioGroup.LayoutParams.WRAP_CONTENT);
params.weight = 1;
rb.setTypeface((TypefaceCache.getTypeface(view.getContext())));
if (i == 0) {
params.setMargins(0, 0, dp4, 0);
} else {
params.setMargins(dp4, 0, 0, 0);
}
rb.setMinimumWidth(dp80);
rb.setGravity(Gravity.CENTER);
rb.setLayoutParams(params);
rb.setText(buttonTitles[i]);
rb.setChecked(i == mTopPagerSelectedButtonIndex);
rb.setOnClickListener(TopModulePagerOnClickListener);
mTopPagerContainer.addView(rb);
}
mTopPagerContainer.setVisibility(View.VISIBLE);
}
示例2: getGroupView
import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
View groupView = super.getGroupView(groupPosition, isExpanded, convertView, parent);
Typeface font = FontManager.getInstance().getFont(FontManager.Font.ROBOTO_LIGHT);
CheckedTextView checkedTextView = (CheckedTextView) groupView.findViewById(R.id.component_source_group);
checkedTextView.setTypeface(font);
return groupView;
}
示例3: getGroupView
import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
View groupView = super.getGroupView(groupPosition, isExpanded, convertView, parent);
Typeface font = FontManager.getInstance().getFont(FontManager.Font.ROBOTO_LIGHT);
CheckedTextView checkedTextView = (CheckedTextView) groupView.findViewById(R.id.component_details_info_group);
checkedTextView.setTypeface(font);
checkedTextView.setTextAppearance(context, R.style.ListGroupText);
return groupView;
}
示例4: getView
import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
Typeface font = getFontByNumber(context, position);
if (view == null) {
final LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(android.R.layout.select_dialog_singlechoice, parent, false);
}
CheckedTextView item = (CheckedTextView) view.findViewById(android.R.id.text1);
item.setText(items[position]);
item.setTypeface(font);
item.setTextColor(Color.WHITE);
return view;
}
示例5: getView
import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(this.context).inflate(R.layout.font_option_item, null);
}
Fonts font = allFonts[position];
CheckedTextView checkedTextView = (CheckedTextView) convertView.findViewById(R.id.ctv_font_option_item);
checkedTextView.setTypeface(TypefaceHelper.get(context, font.getFileName()));
checkedTextView.setText(font.getPrettyName(context));
checkedTextView.setChecked(selectedFonts.contains(String.valueOf(font.getId())));
return convertView;
}
示例6: Holder
import android.widget.CheckedTextView; //导入方法依赖的package包/类
private Holder(View v) {
title = (CheckedTextView) v.findViewById(android.R.id.text1);
title.setTypeface(TypefaceHelper.getTypefaceMusket2(mContext));
v.setTag(this);
}