當前位置: 首頁>>代碼示例>>Java>>正文


Java AppCompatRadioButton.setSupportButtonTintList方法代碼示例

本文整理匯總了Java中android.support.v7.widget.AppCompatRadioButton.setSupportButtonTintList方法的典型用法代碼示例。如果您正苦於以下問題:Java AppCompatRadioButton.setSupportButtonTintList方法的具體用法?Java AppCompatRadioButton.setSupportButtonTintList怎麽用?Java AppCompatRadioButton.setSupportButtonTintList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v7.widget.AppCompatRadioButton的用法示例。


在下文中一共展示了AppCompatRadioButton.setSupportButtonTintList方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: FolderViewHolder

import android.support.v7.widget.AppCompatRadioButton; //導入方法依賴的package包/類
private FolderViewHolder(View itemView, int imageSize, ColorStateList selector, OnItemClickListener itemClickListener) {
    super(itemView);

    this.mImageSize = imageSize;
    this.mItemClickListener = itemClickListener;

    mIvImage = (ImageView) itemView.findViewById(R.id.iv_gallery_preview_image);
    mTvTitle = (TextView) itemView.findViewById(R.id.tv_gallery_preview_title);
    mCheckBox = (AppCompatRadioButton) itemView.findViewById(R.id.rb_gallery_preview_check);

    itemView.setOnClickListener(this);

    mCheckBox.setSupportButtonTintList(selector);
}
 
開發者ID:WeiXinqiao,項目名稱:Recognize-it,代碼行數:15,代碼來源:AlbumFolderAdapter.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

示例5: tintRadioButton

import android.support.v7.widget.AppCompatRadioButton; //導入方法依賴的package包/類
private void tintRadioButton(AppCompatRadioButton radioButton, int priority) {
    int color = checkBoxes.getPriorityColors().get(priority);
    radioButton.setSupportButtonTintList(new ColorStateList(new int[][]{
            new int[]{-android.R.attr.state_checked}, new int[]{android.R.attr.state_checked}},
            new int[]{color, color}));
}
 
開發者ID:andyCano,項目名稱:TaskApp,代碼行數:7,代碼來源:PriorityControlSet.java


注:本文中的android.support.v7.widget.AppCompatRadioButton.setSupportButtonTintList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。