当前位置: 首页>>代码示例>>Java>>正文


Java CheckedTextView.setTypeface方法代码示例

本文整理汇总了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);
}
 
开发者ID:ldsddn,项目名称:wordpress_app_android,代码行数:26,代码来源:StatsAbstractListFragment.java

示例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;
}
 
开发者ID:mr-kojo,项目名称:Veggietizer,代码行数:11,代码来源:SourcesAdapter.java

示例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;
}
 
开发者ID:mr-kojo,项目名称:Veggietizer,代码行数:12,代码来源:DetailsInfoAdapter.java

示例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;
}
 
开发者ID:rosenpin,项目名称:AlwaysOnDisplayAmoled,代码行数:15,代码来源:FontAdapter.java

示例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;
}
 
开发者ID:stanidesis,项目名称:quotograph,代码行数:15,代码来源:FontMultiselectAdapter.java

示例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);
}
 
开发者ID:feelinglucky,项目名称:Rainville,代码行数:6,代码来源:PresetsAdapter.java


注:本文中的android.widget.CheckedTextView.setTypeface方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。