openhab / openhab-android

openHAB client for Android
https://play.google.com/store/apps/details?id=org.openhab.habdroid
Eclipse Public License 2.0
606 stars 313 forks source link

Fix Buttongrid's layout changes when there is an invisible button #3782

Closed jimtng closed 4 months ago

jimtng commented 4 months ago
    buttongrid do
      button 1, 1, item: TestSwitch1, click: ON, visibility: "TestSwitch1==ON"
      button 1, 2, item: TestSwitch1, click: ON
      button 1, 3, item: TestSwitch1, click: OFF
    end

When the first button (column 1) is invisible, isVisible = false causes the column 1 to not be included at all, and the whole grid layout fills the entire width with 2 buttons taking up the whole width, with no space reserved for button 1.

When button1 is visible, it then redistributes the space into 3 columns.

This is the wrong behaviour and is quite jarring.

Using isInvisible=true makes the grid reserve the space, so the button simply appears and disappears without any layout changes. This is consistent with BasicUI's behaviour.

jimtng commented 4 months ago

@mueller-ma can this still make it into 3.15?

mueller-ma commented 4 months ago

Let's go for 3.16.