Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

labelcolor for items with {} ignored, when the item is unfolded #3442

Open
dilyanpalauzov opened this issue Jul 22, 2023 · 8 comments
Open
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@dilyanpalauzov
Copy link
Contributor

I have openHAB-Android 3.6.2-beta. An item in sitemap has the form

Text item=e3_power labelcolor=[e3_color=="yellow"="yellow",e3_color=="gold"="gold",e3_color=="olive"="olive",
  e3_color=="orange"="orange", e3_color=="red"="red",e3_color=="maroon"="maroon"] {
          Switch item=e3
          Text item=e3_energy
          Default item=e3_lastTg
          Text item=e3_rssi
}

That is: it has dynamic color. Clicking on the item puts the item on the top of the (narrow) screen and displays the sub-items. On narrow screens the parent elements are not shown.

Once the item is put on the top, it does not display the color anymore.

@dilyanpalauzov dilyanpalauzov added the bug Indicates an unexpected problem or unintended behavior label Jul 22, 2023
@mueller-ma
Copy link
Member

Can you add some screenshots so I understand this issue better?

@dilyanpalauzov
Copy link
Contributor Author

With this sitemap:

sitemap z label="Z" {
  Text item=e3_power labelcolor=["yellow"] {
    Switch item=e3
  }
}

@dilyanpalauzov
Copy link
Contributor Author

Screenshot_20230723_191833_org.openhab.habdroid.beta.jpg

Screenshot_20230723_191924_org.openhab.habdroid.beta.jpg

@dilyanpalauzov
Copy link
Contributor Author

What is yellow on the first picture (Помпа маза 1W), shall be yellow on the second picture (where is written Помпа маза 168 W)

@dilyanpalauzov
Copy link
Contributor Author

dilyanpalauzov commented Jul 23, 2023

The icon is also shown on the first picture, but not on the second.

@mueller-ma
Copy link
Member

I thought about this as well two years ago (#1053), but in the end I didn't like the result and therefore closed by feature request. I guess that it isn't MD3 compliant to color the text in the action bar, but I could be wrong. At least I haven't seen another app doing this.

@dilyanpalauzov
Copy link
Contributor Author

The current behaviour looses information.

@mueller-ma
Copy link
Member

The app bar title is loaded from a linked page: https://github.com/openhab/openhab-android/blob/main/mobile/src/main/java/org/openhab/habdroid/model/LinkedPage.kt#L30-L33
That class (and the corresponding API request) contains the title as string without the labelcolor or any reference to an Item where the labelcolor could be looked up.

@maniac103 Do you think it's worth to extend the REST API to make this working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants