本文整理匯總了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;
}
}
}
}