BRVAH_kotlin icon indicating copy to clipboard operation
BRVAH_kotlin copied to clipboard

Section : RadioGroup in list item

Open vermacool opened this issue 6 years ago • 1 comments

` if (video.inputType?.equals("radio", false)!!) { /* * Examine if radio button is Checked previously. */ helper.getView<RadioButton>(R.id.yesRadio).isChecked = video.inputData?.equals("y", false)!! helper.getView<RadioButton>(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.

vermacool avatar Oct 04 '17 10:10 vermacool

thanks

AllenCoder avatar Oct 13 '17 01:10 AllenCoder