本文整理汇总了Java中android.support.v7.widget.AppCompatRadioButton.setTag方法的典型用法代码示例。如果您正苦于以下问题:Java AppCompatRadioButton.setTag方法的具体用法?Java AppCompatRadioButton.setTag怎么用?Java AppCompatRadioButton.setTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.AppCompatRadioButton
的用法示例。
在下文中一共展示了AppCompatRadioButton.setTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: initializeStep
import android.support.v7.widget.AppCompatRadioButton; //导入方法依赖的package包/类
public void initializeStep() {
setOrientation(VERTICAL);
ConsentQuizModel.QuizQuestion question = step.getQuestion();
LayoutInflater inflater = LayoutInflater.from(getContext());
inflater.inflate(R.layout.rss_layout_quiz_question, this, true);
((TextView) findViewById(R.id.title)).setText(step.getTitle());
radioGroup = (RadioGroup) findViewById(R.id.radio_group);
submitBar = (SubmitBar) findViewById(R.id.submit_bar);
submitBar.getNegativeActionView().setVisibility(GONE);
resultTitle = (TextView) findViewById(R.id.quiz_result_title);
resultSummary = (TextView) findViewById(R.id.quiz_result_summary);
radioItemBackground = findViewById(R.id.quiz_result_item_background);
if (question.getType().equals("instruction")) {
TextView instructionText = (TextView) findViewById(R.id.instruction_text);
instructionText.setText(question.getText());
instructionText.setVisibility(VISIBLE);
// instruction steps don't need submit, also always count as correct answer
submitBar.setPositiveTitle(R.string.rsb_next);
submitBar.setPositiveAction(v -> onNext(true));
} else {
submitBar.setPositiveTitle(R.string.rsb_submit);
submitBar.setPositiveAction(v -> onSubmit());
for (Choice<String> choice : getChoices(question)) {
AppCompatRadioButton button = (AppCompatRadioButton) inflater.inflate(R.layout.rss_item_radio_quiz,
radioGroup,
false);
button.setText(choice.getText());
button.setTag(choice);
radioGroup.addView(button);
if (question.getExpectedAnswer().equals(choice.getValue())) {
expectedChoice = choice;
}
}
}
}