Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Section : RadioGroup in list item #3

Open
vermacool opened this issue Oct 4, 2017 · 1 comment
Open

Section : RadioGroup in list item #3

vermacool opened this issue Oct 4, 2017 · 1 comment

Comments

@vermacool
Copy link

vermacool commented Oct 4, 2017

` if (video.inputType?.equals("radio", false)!!) {
/*
* Examine if radio button is Checked previously.
*/
helper.getView(R.id.yesRadio).isChecked = video.inputData?.equals("y", false)!!
helper.getView(R.id.noRadio).isChecked = video.inputData?.equals("n", false)!!

        val view: RadioGroup = helper.getView<RadioGroup>(R.id.radioGroup)
        view.setOnCheckedChangeListener(object : RadioGroup.OnCheckedChangeListener {
            override fun onCheckedChanged(group: RadioGroup?, checkedId: Int) {
                when (checkedId) {
                    R.id.yesRadio -> {
                        video.inputData = "y"
                    }
                    R.id.noRadio -> {
                        video.inputData = "n"
                    }


                }
            }
        })

    }`

when itemview recycles position of checked radioButton change.

@AllenCoder
Copy link
Owner

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants