From ff026b892617fdc7307ac104fdf2534ad1d51c32 Mon Sep 17 00:00:00 2001 From: PranshulGG Date: Tue, 26 May 2026 11:46:06 +0530 Subject: [PATCH] rename current_and_hourly_widget_info to weather_widget_info, add API 31 widget configuration, and add startNow to WeatherUpdateScheduler --- .../data/worker/WeatherUpdateScheduler.kt | 4 ++++ app/src/main/res/xml-v31/weather_widget_info.xml | 13 +++++++++++++ ...urly_widget_info.xml => weather_widget_info.xml} | 10 +++++----- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 app/src/main/res/xml-v31/weather_widget_info.xml rename app/src/main/res/xml/{current_and_hourly_widget_info.xml => weather_widget_info.xml} (52%) diff --git a/app/src/main/java/com/pranshulgg/weather_master_app/data/worker/WeatherUpdateScheduler.kt b/app/src/main/java/com/pranshulgg/weather_master_app/data/worker/WeatherUpdateScheduler.kt index ebc7abe24..435078fd9 100644 --- a/app/src/main/java/com/pranshulgg/weather_master_app/data/worker/WeatherUpdateScheduler.kt +++ b/app/src/main/java/com/pranshulgg/weather_master_app/data/worker/WeatherUpdateScheduler.kt @@ -39,4 +39,8 @@ object WeatherUpdateScheduler { WorkManager.getInstance(context) .cancelUniqueWork("@pranshulgg_weather_master_updates") } + + fun startNow(context: Context, skipForegroundCheck: Boolean = false) { + WeatherWorker.startNow(context, skipForegroundCheck) + } } \ No newline at end of file diff --git a/app/src/main/res/xml-v31/weather_widget_info.xml b/app/src/main/res/xml-v31/weather_widget_info.xml new file mode 100644 index 000000000..07783cdc5 --- /dev/null +++ b/app/src/main/res/xml-v31/weather_widget_info.xml @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/app/src/main/res/xml/current_and_hourly_widget_info.xml b/app/src/main/res/xml/weather_widget_info.xml similarity index 52% rename from app/src/main/res/xml/current_and_hourly_widget_info.xml rename to app/src/main/res/xml/weather_widget_info.xml index 15735e785..a027ac9af 100644 --- a/app/src/main/res/xml/current_and_hourly_widget_info.xml +++ b/app/src/main/res/xml/weather_widget_info.xml @@ -1,9 +1,9 @@ - - \ No newline at end of file + android:previewImage="@drawable/weather_preview" /> \ No newline at end of file