From 0895d946f0f860c620c2753de6fafc2d9ab57905 Mon Sep 17 00:00:00 2001 From: mueller-ma Date: Wed, 27 Dec 2023 10:01:09 +0100 Subject: [PATCH] Copy show/hide label behavior from BasicUI Signed-off-by: mueller-ma --- .../src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt | 6 ++++++ 1 file changed, 6 insertions(+) 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 20c1178e54..089a6972ce 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt @@ -790,6 +790,12 @@ class WidgetAdapter( override fun bind(widget: Widget) { super.bind(widget) + + val showLabelAndIcon = widget.label.isNotEmpty() + && widget.labelSource == Widget.LabelSource.SitemapDefinition + labelView.isVisible = showLabelAndIcon + iconView.isVisible = showLabelAndIcon + val mappings = widget.mappings.filter { it.column != 0 && it.row != 0 } spareViews.addAll(table.children.filter { it is MaterialButton }) table.removeAllViews()