Skip to content

Commit

Permalink
Hide redundant value on switches
Browse files Browse the repository at this point in the history
  • Loading branch information
mueller-ma committed Jun 3, 2024
1 parent 432971b commit 28ec637
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1017,9 +1017,10 @@ class WidgetAdapter(
override fun bind(widget: Widget) {
super.bind(widget)

val hideLabel = widget.labelSource != Widget.LabelSource.SitemapDefinition
val hasNoLabelAndValue = labelView.text.isEmpty() && valueView?.text?.isEmpty() != false
labelView.isGone = hasNoLabelAndValue
valueView?.isGone = hasNoLabelAndValue
valueView?.isGone = hasNoLabelAndValue || hideLabel

val mappings = widget.mappingsOrItemOptions
val buttonCount = min(mappings.size, maxButtons)
Expand Down

0 comments on commit 28ec637

Please sign in to comment.