當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。