Gitsaibot / AF-Weather-Widget

Graph weather widget for Android
53 stars 13 forks source link

Nighttime icons used during daytime #6

Closed zpuskas closed 1 year ago

zpuskas commented 3 years ago

The widget shows moon icon instead of a sun during daytime. OS: Android 11 Version: 1.2 (from f-droid) Data source: Auto

bug

I've tried the following:

Gitsaibot commented 3 years ago

Strange. Are you in the correct time zone?

zpuskas commented 3 years ago

Yes, my timezone settings are correct. Allow me to rephrase: the widget always uses nighttime icons (as per screenshot) day or night.

Gitsaibot commented 3 years ago

What I do not understand is why it fits for e.g. Miami

zpuskas commented 3 years ago

I've tried Miami too, same result. Moon icons throughout the entire day.

int0x19 commented 3 years ago

I confirm, in my location (UTTT or Tashkent/Uzbekistan) it is the same .
This bug periodically appeared on the old version from google play IMG_20210606_135751

Gitsaibot commented 3 years ago

So it seems to be an old problem. A good starting point for troubleshooting would be this section in AixDetailedWidget:


int[] weatherIcons = WEATHER_ICONS_NIGHT;

  for (SunMoonData smd : mSunMoonData) {
    if (smd.date == iconDate) {
      if (smd.sunRise == AixSunMoonData.NEVER_RISE) {
      weatherIcons = WEATHER_ICONS_POLAR;
      } else if (smd.sunSet == AixSunMoonData.NEVER_SET) {
    weatherIcons = WEATHER_ICONS_DAY;
    }
  }
  if (smd.sunRise < iconTimePos && smd.sunSet > iconTimePos) {
  weatherIcons = WEATHER_ICONS_DAY;
  }
}
yparitcher commented 1 year ago

This should be fixed by #28