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


Java AppCompatRadioButton.setTag方法代碼示例

本文整理匯總了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);
}
 
開發者ID:pro100svitlo,項目名稱:LockPattern,代碼行數:13,代碼來源:DialogLPV.java

示例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;
            }
        }
    }
}
 
開發者ID:ResearchStack,項目名稱:ResearchStack,代碼行數:46,代碼來源:ConsentQuizQuestionStepLayout.java


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