WangDaYeeeeee / GeometricWeather

A Material Design Weather Application
GNU Lesser General Public License v3.0
2.41k stars 188 forks source link

[Bug] App doesn't know if it's day or night during midnight sun / polar night #488

Open vodkapmp opened 1 year ago

vodkapmp commented 1 year ago

I live within the arctic circle, and when midnight sun / polar night happens, the app doesn't know if it is day or night. This means it'll sometime show as nighttime 24/7 during midnight sun, and show as daytime 24/7 during polar night.

Currently where I am it is midnight sun, and the sun is not going below the horizon at all for weeks on end, this confuses GW because accuweather reports the sun as never rising nor setting. image

This makes the live wallpaper kinda sad, as it's bright and sunny out but my wallpaper is showing a dark sky.

papjul commented 1 year ago

I noticed that with AccuWeather provider, the sunrise and sunset info is missing when testing an arctic circle city.

In this situation, how is the app supposed to know if it means: 1) Info is missing 2) Midnight sun 3) Polar night

I’m not sure to know what could be the correct approach to fix this issue.

Best I can think is when values are missing, use a default 06:00 -> 18:00 (12 hours of sun/12 hours of night).

What do you think?

vodkapmp commented 1 year ago

I think a fallback to 06-18 seems to be the most sensible.

What would be the best is if it could default to 24/7 night or day depending on time of year if in a location north of certain latitude (or south of certain latitude for the opposite in southern hemisphere, but I don't think many people in Antarctica care) But this sounds like it'd be unnecessarily complicated.

papjul commented 1 year ago

I think a fallback to 06-18 seems to be the most sensible.

Not sure to understand the meaning of "sensible" here? I interpret two ways.

What would be the best is if it could default to 24/7 night or day depending on time of year if in a location north of certain latitude (or south of certain latitude for the opposite in southern hemisphere, but I don't think many people in Antarctica care) But this sounds like it'd be unnecessarily complicated.

If we go that way, it means we calculate sunrise/sunset ourselves from any coordinates in the world. I don't know how heavy this operation is for an Android device, this would require some tests.

vodkapmp commented 1 year ago

I think a fallback to 06-18 seems to be the most sensible.

Not sure to understand the meaning of "sensible" here? I interpret two ways.

What I mean is that there is no need to over-complicate the solution, and just going with "there is no data, default to 12/12 hours" solves both the issue of potentially missing data, and location issues like within the arctic and antarctic circle.

My suggesting to start taking date and coordinates into account is a needlessly complicated solution for such a small amount of the userbase.