- // Update the save button if the icon selection changes.
- iconRadioGroup.setOnCheckedChangeListener { _: RadioGroup?, _: Int ->
+ // Set the radio button listeners. These perform a click on the linear layout, which contains the necessary logic.
+ currentIconRadioButton.setOnClickListener { currentIconLinearLayout.performClick() }
+ webpageFavoriteIconRadioButton.setOnClickListener { webpageFavoriteIconLinearLayout.performClick() }
+
+ // Set the current icon linear layout click listener.
+ currentIconLinearLayout.setOnClickListener {
+ // Check the current icon radio button.
+ currentIconRadioButton.isChecked = true
+
+ // Uncheck the webpage favorite icon radio button.
+ webpageFavoriteIconRadioButton.isChecked = false
+
+ // Update the save button.
+ updateSaveButton(currentName, currentUrl)
+ }
+
+ // Set the webpage favorite icon linear layout click listener.
+ webpageFavoriteIconLinearLayout.setOnClickListener {
+ // Check the webpage favorite icon radio button.
+ webpageFavoriteIconRadioButton.isChecked = true
+
+ // Uncheck the current icon radio button.
+ currentIconRadioButton.isChecked = false
+