From e5afb1d198a50e391079bfa0c312d756558c9382 Mon Sep 17 00:00:00 2001 From: TheScarastic Date: Mon, 15 Apr 2024 13:20:29 +0530 Subject: [PATCH] blissweather: Start the forecast from today --- .../foundation/e/blissweather/widget/WidgetViewUtils.kt | 4 ++-- .../kotlin/foundation/e/blissweather/api/OpenWeatherApi.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/kotlin/foundation/e/blissweather/widget/WidgetViewUtils.kt b/android/src/main/kotlin/foundation/e/blissweather/widget/WidgetViewUtils.kt index 369394d..705efa0 100644 --- a/android/src/main/kotlin/foundation/e/blissweather/widget/WidgetViewUtils.kt +++ b/android/src/main/kotlin/foundation/e/blissweather/widget/WidgetViewUtils.kt @@ -104,10 +104,10 @@ fun RemoteViews.updateWeatherView( val calendar = Calendar.getInstance() val currentDay = calendar.get(Calendar.DAY_OF_WEEK) - val forecasts = data.forecasts?.list?.drop(1)?.take(5) ?: emptyList() + val forecasts = data.forecasts?.list ?: emptyList() forecasts.forEachIndexed { index, day -> - val nextDay = currentDay + (index + 1) + val nextDay = currentDay + index val dayName = calendar .apply { set(Calendar.DAY_OF_WEEK, nextDay) } diff --git a/data/src/main/kotlin/foundation/e/blissweather/api/OpenWeatherApi.kt b/data/src/main/kotlin/foundation/e/blissweather/api/OpenWeatherApi.kt index 5736d95..bb1e3d3 100644 --- a/data/src/main/kotlin/foundation/e/blissweather/api/OpenWeatherApi.kt +++ b/data/src/main/kotlin/foundation/e/blissweather/api/OpenWeatherApi.kt @@ -41,7 +41,7 @@ interface OpenWeatherApi { @Query("appid") apiKey: String, @Query("units") units: Units = Units.METRIC, @Query("lang") lang: String = "en", - @Query("cnt") count: Int = 6, + @Query("cnt") count: Int = 5, ): Response } -- GitLab