Skip to content

Commit

Permalink
Copy show/hide label behavior from BasicUI
Browse files Browse the repository at this point in the history
Signed-off-by: mueller-ma <[email protected]>
  • Loading branch information
mueller-ma committed Dec 27, 2023
1 parent 9c8cae4 commit 0895d94
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mobile/src/main/java/org/openhab/habdroid/ui/WidgetAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0895d94

Please sign in to comment.