Closed felixschndr closed 3 months ago
The switch-with-mappings icon issue likely is #3773. The 'white background' one likely is one I also have seen once, but didn't have a chance of investigation yet: It looks like the icon and the loading placeholder ('glowing' frame) are both shown simultaneously.
Then I guess we can close this as duplicate and/or should create an issue for
It looks like the icon and the loading placeholder ('glowing' frame) are both shown simultaneously.
We can keep this one for that issue.
As far as I can tell, this placeholder (skeleton) + image issue happens due to race conditions when views are reused, because
WidgetImageView
puts itself into a SkeletonLayout
WidgetImageView
to invisible while the skeleton is shownLabeledItemBaseViewHolder.bind()
also manipulates the visibility flag of the WidgetImageView
because it's unaware the view is now contained in another view (and the adapter now actually wanted to hide/show that one)The solution for this, as far as I can tell, is avoiding the magic implicit skeleton creation. Will think about it further, though.
Evidence of speculation above: I've added some debug statements to WidgetImageView
:
[...]
07-29 15:37:36.050 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: setImageUrl(chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540, force true), target size 996, last http://<ohserver>:8080/chart?groups=GroupPoolTemperature&dpi=420&period=3D&service=influxdb&theme=white_transparent&yAxisDecimalPattern=&w=1080&h=540
07-29 15:37:36.053 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: URL http://<ohserver>:8080/chart?groups=GroupPoolTemperature&dpi=420&period=3D&service=influxdb&theme=white_transparent&yAxisDecimalPattern=&w=1080&h=540 -> http://<ohserver>:8080/chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540
07-29 15:37:36.054 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: show skeleton for com.faltenreich.skeletonlayout.SkeletonLayout{48a001f V.ED..... .......D 0,0-996,498 aid=1073742071}, parent is com.faltenreich.skeletonlayout.SkeletonLayout{48a001f V.ED..... .......D 0,0-996,498 aid=1073742071} ... android.widget.FrameLayout{1c5af6c V.E...... .......D 42,32-1038,530 aid=1073742066}
07-29 15:37:36.056 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: set visibility invisible
07-29 15:37:36.056 31925 31925 D WidgetImageView: java.lang.Throwable
07-29 15:37:36.056 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.setVisibility(WidgetImageView.kt:142)
07-29 15:37:36.056 31925 31925 D WidgetImageView: at com.faltenreich.skeletonlayout.SkeletonLayout.showSkeleton(SkeletonLayout.kt:61)
07-29 15:37:36.056 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.applySkeleton(WidgetImageView.kt:352)
07-29 15:37:36.056 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.doLoad(WidgetImageView.kt:286)
07-29 15:37:36.056 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.setImageUrl(WidgetImageView.kt:114)
07-29 15:37:36.056 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.setImageUrl$default(WidgetImageView.kt:87)
07-29 15:37:36.056 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter$ChartViewHolder.bindAfterDataSaverCheck$mobile_fossBetaDebug(WidgetAdapter.kt:1440)
07-29 15:37:36.056 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter$HeavyDataViewHolder.bind(WidgetAdapter.kt:522)
[...]
07-29 15:37:36.059 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a IFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: execute request for http://<ohserver>:8080/chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540
07-29 15:37:36.059 31925 31925 I WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a IFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: Refreshing image at http://<ohserver>:8080/chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540, avoidCache true
07-29 15:37:36.062 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a IFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: refresh on attach, request HttpImageRequest(url=http://<ohserver>:8080/chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540, job=null)
07-29 15:37:36.062 31925 31925 I WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a IFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: Refreshing image at http://<ohserver>:8080/chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540, avoidCache false
[...]
07-29 15:37:36.156 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a IFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: starting download of http://<ohserver>:8080/chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540&random=-677746331
[...]
07-29 15:37:36.240 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a IFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: set visibility visible
07-29 15:37:36.240 31925 31925 D WidgetImageView: java.lang.Throwable
07-29 15:37:36.240 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.setVisibility(WidgetImageView.kt:142)
07-29 15:37:36.240 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter$HeavyDataViewHolder.showDataSaverPlaceholderIfNeeded(WidgetAdapter.kt:2009)
07-29 15:37:36.240 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter$HeavyDataViewHolder.bind(WidgetAdapter.kt:521)
07-29 15:37:36.240 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter.onBindViewHolder(WidgetAdapter.kt:265)
07-29 15:37:36.240 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter.onBindViewHolder(WidgetAdapter.kt:127)
07-29 15:37:36.240 31925 31925 D WidgetImageView: at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7747)
07-29 15:37:36.240 31925 31925 D WidgetImageView: at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7847)
[...]
07-29 15:37:36.242 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: setImageUrl(chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540, force true), target size 996, last http://<ohserver>:8080/chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540
07-29 15:37:36.242 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ......ID 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: URL equals last URL, active true
[...]
07-29 15:37:36.307 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ........ 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: set visibility visible
07-29 15:37:36.307 31925 31925 D WidgetImageView: java.lang.Throwable
07-29 15:37:36.307 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.setVisibility(WidgetImageView.kt:142)
07-29 15:37:36.307 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter$HeavyDataViewHolder.showDataSaverPlaceholderIfNeeded(WidgetAdapter.kt:2009)
07-29 15:37:36.307 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter$HeavyDataViewHolder.bind(WidgetAdapter.kt:521)
07-29 15:37:36.307 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter.onBindViewHolder(WidgetAdapter.kt:265)
07-29 15:37:36.307 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter.onBindViewHolder(WidgetAdapter.kt:127)
07-29 15:37:36.307 31925 31925 D WidgetImageView: at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7747)
[...]
07-29 15:37:36.309 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ........ 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: setImageUrl(chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540, force true), target size 996, last http://<ohserver>:8080/chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540
07-29 15:37:36.309 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ........ 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: URL equals last URL, active true
[...]
07-29 15:37:36.393 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ........ 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: set visibility visible
07-29 15:37:36.393 31925 31925 D WidgetImageView: java.lang.Throwable
07-29 15:37:36.393 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.setVisibility(WidgetImageView.kt:142)
07-29 15:37:36.393 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter$HeavyDataViewHolder.showDataSaverPlaceholderIfNeeded(WidgetAdapter.kt:2009)
07-29 15:37:36.393 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter$HeavyDataViewHolder.bind(WidgetAdapter.kt:521)
07-29 15:37:36.393 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter.onBindViewHolder(WidgetAdapter.kt:265)
07-29 15:37:36.393 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.WidgetAdapter.onBindViewHolder(WidgetAdapter.kt:127)
07-29 15:37:36.393 31925 31925 D WidgetImageView: at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7747)
07-29 15:37:36.393 31925 31925 D WidgetImageView: at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7847)
07-29 15:37:36.393 31925 31925 D WidgetImageView: at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6646)
[...]
07-29 15:37:38.095 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ........ 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: loaded bitmap android.graphics.Bitmap@f7b9364 for http://<ohserver>:8080/chart?groups=GroupSolarProduction&dpi=420&period=1D&theme=white_transparent&legend=true&yAxisDecimalPattern=&w=1080&h=540
07-29 15:37:38.096 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ........ 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: hide skeleton for com.faltenreich.skeletonlayout.SkeletonLayout{48a001f V.ED..... ......ID 0,0-996,498 aid=1073742071}
07-29 15:37:38.098 31925 31925 D WidgetImageView: org.openhab.habdroid.ui.widget.WidgetImageView{133de1a VFED..C.. ........ 0,0-996,498 #7f0a030c app:id/widget_content aid=1073742065}: set visibility visible
07-29 15:37:38.098 31925 31925 D WidgetImageView: java.lang.Throwable
07-29 15:37:38.098 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.setVisibility(WidgetImageView.kt:142)
07-29 15:37:38.098 31925 31925 D WidgetImageView: at com.faltenreich.skeletonlayout.SkeletonLayout.showOriginal(SkeletonLayout.kt:50)
07-29 15:37:38.098 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.removeSkeleton(WidgetImageView.kt:357)
07-29 15:37:38.098 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.applyLoadedBitmap(WidgetImageView.kt:322)
07-29 15:37:38.098 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView.access$applyLoadedBitmap(WidgetImageView.kt:50)
07-29 15:37:38.098 31925 31925 D WidgetImageView: at org.openhab.habdroid.ui.widget.WidgetImageView$HttpImageRequest$execute$1.invokeSuspend(WidgetImageView.kt:406)
One can see clearly that
Fixed with #3787
Disclaimer: There are some open issues about icons but I am not sure weather any of these covers the following issue. If so please close this one.
Actual behaviour
Since a recent version of the android app the icons seem to be misplaced sometimes: After scrolling in the window or reloading the icon seem to be placed where they belong.
Clearing the cache does not help.
In the following image I noticed that an icon got a background it should not have: The original image has no white background.
On iOS the icons work as expected:
It does not matter whether the connection is local or via the cloud.
Expected behaviour
The icons should all be aligned the same way.
Steps to reproduce
See code below
Environment data
Client
Server
Logs
App log
Click to expand
[---------------.txt](https://github.com/user-attachments/files/16411933/---------------.txt)Code for first image:
Code for second image:
Code for third image: