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


Java AppCompatRadioButton.setTextColor方法代码示例

本文整理汇总了Java中android.support.v7.widget.AppCompatRadioButton.setTextColor方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatRadioButton.setTextColor方法的具体用法?Java AppCompatRadioButton.setTextColor怎么用?Java AppCompatRadioButton.setTextColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.widget.AppCompatRadioButton的用法示例。


在下文中一共展示了AppCompatRadioButton.setTextColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import android.support.v7.widget.AppCompatRadioButton; //导入方法依赖的package包/类
private void init() {
    mRgChoice.setVisibility(View.VISIBLE);
    mChoiceBox.setVisibility(View.GONE);
    mScdTitle.setText(title);
    for (int i = 0; i < datas.length; i++) {
        AppCompatRadioButton arb = new AppCompatRadioButton(mContext);
        ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(-1, ScreenUtil.getInstance().dip2px(48));
        arb.setLayoutParams(layoutParams);
        arb.setGravity(Gravity.CENTER_VERTICAL);
        arb.setId(i);
        arb.setText(datas[i]);
        arb.setTextSize(15);
        arb.setTextColor(mContext.getResources().getColor(R.color.new_text_color_first));
        arb.setPadding(ScreenUtil.getInstance().dip2px(16), 0, 0, 0);
        if (i == 0)
            arb.setChecked(true);
        mRgChoice.addView(arb);
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:20,代码来源:SingleChooseDialog.java

示例2: addRadioButton

import android.support.v7.widget.AppCompatRadioButton; //导入方法依赖的package包/类
private void addRadioButton(RadioGroup group) {
    for (int i = 1; i < 6; i++) {
        AppCompatRadioButton radio = new AppCompatRadioButton(this);
        radio.setText(String.valueOf(i));
        radio.setTextColor(Color.WHITE);
        radio.setSupportButtonTintList(ColorStateList.valueOf(Color.WHITE));
        group.addView(radio);
    }
}
 
开发者ID:ficiverson,项目名称:radiocom-android,代码行数:10,代码来源:CreateReport.java

示例3: setQuestionItem

import android.support.v7.widget.AppCompatRadioButton; //导入方法依赖的package包/类
private void setQuestionItem(int pos, AppCompatRadioButton rb, ViewGroup.LayoutParams lp,
                             ColorStateList csl){
    rb.setLayoutParams(lp);
    rb.setTag(pos);
    rb.setTextColor(mTextColor);
    rb.setTextSize(mTextSize);
    rb.setText(mQuestionsArray[pos]);
    rb.setOnClickListener(onQuestionItemListener);
    rb.setSupportButtonTintList(csl);

    mQuestionRBtnsList.add(rb);
}
 
开发者ID:pro100svitlo,项目名称:LockPattern,代码行数:13,代码来源:DialogLPV.java

示例4: init

import android.support.v7.widget.AppCompatRadioButton; //导入方法依赖的package包/类
private void init() {
	layoutSelectorView = activity.getLayoutInflater().inflate(R.layout.stream_layout_preview, null);
	final RadioGroup rg = (RadioGroup) layoutSelectorView.findViewById(R.id.layouts_radiogroup);
	final FrameLayout previewWrapper = (FrameLayout) layoutSelectorView.findViewById(R.id.preview_wrapper);

	if (previewMaxHeightRes != -1) {
		LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
				ViewGroup.LayoutParams.MATCH_PARENT,
				(int) activity.getResources().getDimension(previewMaxHeightRes)
		);
		previewWrapper.setLayoutParams(lp);
		//previewWrapper.setMinimumHeight((int) activity.getResources().getDimension(previewMaxHeightRes));
	}

	ViewStub preview = (ViewStub) layoutSelectorView.findViewById(R.id.layout_stub);
	preview.setLayoutResource(previewLayout);
	final View inflated = preview.inflate();

	for (int i = 0; i < layoutTitles.length; i++) {
		final String layoutTitle = layoutTitles[i];

		final AppCompatRadioButton radioButton = new AppCompatRadioButton(activity);
		radioButton.setText(layoutTitle);

		final int finalI = i;
		radioButton.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				selectCallback.onSelected(layoutTitle, finalI, inflated);
			}
		});

		if (textColor != -1) {
			radioButton.setTextColor(Service.getColorAttribute(textColor, R.color.black_text, activity));

			ColorStateList colorStateList = new ColorStateList(
					new int[][]{
							new int[]{-android.R.attr.state_checked},
							new int[]{android.R.attr.state_checked}
					},
					new int[]{

							Color.GRAY, //Disabled
							Service.getColorAttribute(R.attr.colorAccent, R.color.accent, activity), //Enabled
					}
			);
			radioButton.setSupportButtonTintList(colorStateList);
		}


		radioButton.setLayoutParams(new ViewGroup.LayoutParams(
				ViewGroup.LayoutParams.MATCH_PARENT, // Width
				(int) activity.getResources().getDimension(R.dimen.layout_selector_height) // Height
		));


		rg.addView(radioButton, i);


		if ((selectedLayoutIndex != -1 && selectedLayoutIndex == i) || (selectedLayoutTitle != null && selectedLayoutTitle.equals(layoutTitle))) {
			radioButton.performClick();
		}
	}
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:65,代码来源:LayoutSelector.java


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