diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt b/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt index ce568338d7..b73a6c3ac2 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt @@ -1156,10 +1156,6 @@ class WidgetAdapter( override fun bind(widget: Widget) { super.bind(widget) - val hasNoLabelAndValue = labelView.text.isEmpty() && valueView?.text?.isEmpty() != false - labelView.isGone = hasNoLabelAndValue - valueView?.isGone = hasNoLabelAndValue - val mappings = widget.mappingsOrItemOptions val buttonCount = min(mappings.size, maxButtons) @@ -1213,9 +1209,14 @@ class WidgetAdapter( if (checkedId == null) { group.clearChecked() } else { + valueView?.text = "" group.check(checkedId) } + val hasNoLabelAndValue = labelView.text.isEmpty() && valueView?.text?.isEmpty() != false + labelView.isGone = hasNoLabelAndValue + valueView?.isGone = hasNoLabelAndValue + group.isVisible = true }