本文整理匯總了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);
}