From 153cf4395ec5db98ab3d4a0dbafa970ed8324f85 Mon Sep 17 00:00:00 2001 From: woheller69 Date: Tue, 5 Jul 2022 07:15:46 +0200 Subject: [PATCH] Fix for #60 --- .../java/org/woheller69/weather/widget/WeatherWidget.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/woheller69/weather/widget/WeatherWidget.java b/app/src/main/java/org/woheller69/weather/widget/WeatherWidget.java index bade990..b6681e2 100644 --- a/app/src/main/java/org/woheller69/weather/widget/WeatherWidget.java +++ b/app/src/main/java/org/woheller69/weather/widget/WeatherWidget.java @@ -137,7 +137,12 @@ public static void updateView(Context context, AppWidgetManager appWidgetManager views.setTextViewText(R.id.widget_rain60min,"☔ "+rain60); views.setTextViewText(R.id.widget_city_name, city.getCityName()); views.setImageViewResource(R.id.widget_windicon,StringFormatUtils.colorWindSpeedWidget(weatherData.getWindSpeed())); - views.setTextViewText(R.id.widget_sunrise_sunset,"\u2600\u25b2\u2009" + StringFormatUtils.formatTimeWithoutZone(context, riseTime) + " \u25bc\u2009" + StringFormatUtils.formatTimeWithoutZone(context, setTime)); + + if (riseTime==zoneseconds*1000 || setTime==zoneseconds*1000) views.setTextViewText(R.id.widget_sunrise_sunset,"\u2600\u25b2 --:--" + " \u25bc --:--"); + else { + views.setTextViewText(R.id.widget_sunrise_sunset,"\u2600\u25b2\u2009" + StringFormatUtils.formatTimeWithoutZone(context, riseTime) + " \u25bc\u2009" + StringFormatUtils.formatTimeWithoutZone(context, setTime)); + } + views.setTextViewText(R.id.widget_UVindex,"UV"); views.setInt(R.id.widget_UVindex,"setBackgroundResource",StringFormatUtils.widgetColorUVindex(context,Math.round(weekforecasts.get(0).getUv_index())));