martykan / forecastie

A simple, opensource weather app for Android.
Other
871 stars 338 forks source link

Graph labels not visible, when I switch system to dark theme #600

Open vincent6634 opened 3 years ago

vincent6634 commented 3 years ago

Hello everybody, On the charts, the abscissa and ordinate data is not visible when I switch my smartphone to dark theme. The data is black on a dark gray background. The data is only visible on the rain graph because it is white. You can check on the attached picture.

Have a nice day everyone and thank you for this great application.

ROM : MIUI Global 12.5.1 - Phone : Xiaomi Mi 10 lite 5G Screenshot_2021-08-23-15-31-43-747_cz martykan forecastie

robinpaulson commented 3 years ago

I had to look up "abscissa" and "ordinate", it appears to be what us mere mortals would call the x-axis and y-axis.

Thanks for reporting this, it's an odd bug. I'm not sure why the labels show on the rain chart, but not the others. I presume the wind speed and humidity charts are the same, almost invisible labels?

I would guess it's related to the rain chart being a cumulative "block" chart, the others being scatter charts. @FridoDeluxe , how does that sound for a rough diagnosis of the bug cause? If it is the case, I'll have a dig around, it should be an easy fix.

vincent6634 commented 3 years ago

Sorry, Yes, this x-axis and y-axis for Temperature, Pression, Wind Speed and humidity. Screenshot_2021-08-24-11-29-15-662_cz martykan forecastie

robinpaulson commented 3 years ago

That's OK, no apology needed. Thanks for the info.

FridoDeluxe commented 3 years ago

I'll take a look. That the colors are working for the rain chart gives reason for hope it's easy to fix.

FridoDeluxe commented 3 years ago

Unfortunately I can't reproduce this bug, but I do not have access to any MIUI device. Also by analyzing the code I can't find any reason for this behaviour. The variable labelColor is set up according to the theme (bright/dark) and should not change later between rendering the single charts. Also the chart labels (part of the ChartView) should always have the same color as the chart title (a simple TextView, independent from the chart rendering).

I would guess it's related to the rain chart being a cumulative "block" chart, the others being scatter charts. @FridoDeluxe , how does that sound for a rough diagnosis of the bug cause? If it is the case, I'll have a dig around, it should be an easy fix.

Yes, the only difference seems to be that the rain chart is based on a BarChartView instead of a LineChartView. But the method setLabelsColor() which is used for both charts works flawless on both chart types for me. That's why I don't expect a bug inside the WilliamChart library to be the reason.

@vincent6634 Is there a way to flush (rendering) caches for MIUI or completely restart your device? Are the chart label colors still broken in the same way? Are the colors okay when you are not using the dark theme? Have you chosen the dark theme in the Forecastie settings or somewhere in your system's/MIUI settings?

vincent6634 commented 3 years ago

Hello, By emptying the cache et restarting my device, whatever the theme used in the application (Modern, Classic, Modern Dark, ...), the data in the "humidity" graph has become white. Now the data for the "rain" and "humidity" graphs are white while the data for the "temperature", "pressure and" wind speed "graphs are almost black. Maybe the problem is with MIUI ROM.

When I take a less black theme in the app, the contrast is better.

Thanks.

FridoDeluxe commented 3 years ago

@vincent6634 Thanks for the feedback! It sounds random which chart is affected and I fear that there is not much that we can do from Forecastie's side to solve this problem.

Maybe MIUI has an option to turn off certain (dark) theme optimization on a per app basis?