From 8f5afa41f5ecde8da6b879c6f3eaa34c350d7a5f Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 14 Mar 2024 17:30:11 +0530 Subject: [PATCH 1/2] weather: add widget preview --- .../layout/layout_weather_info_preview.xml | 295 ++++++++++++++++++ .../main/res/xml/weather_appwidget_info.xml | 1 + 2 files changed, 296 insertions(+) create mode 100644 android/src/main/res/layout/layout_weather_info_preview.xml diff --git a/android/src/main/res/layout/layout_weather_info_preview.xml b/android/src/main/res/layout/layout_weather_info_preview.xml new file mode 100644 index 0000000..16a74be --- /dev/null +++ b/android/src/main/res/layout/layout_weather_info_preview.xml @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/src/main/res/xml/weather_appwidget_info.xml b/android/src/main/res/xml/weather_appwidget_info.xml index c3d3e60..edff021 100644 --- a/android/src/main/res/xml/weather_appwidget_info.xml +++ b/android/src/main/res/xml/weather_appwidget_info.xml @@ -9,5 +9,6 @@ android:targetCellWidth="4" android:targetCellHeight="3" android:updatePeriodMillis="0" + android:previewLayout="@layout/layout_weather_info_preview" android:widgetCategory="home_screen" tools:ignore="UnusedAttribute" /> -- GitLab From 49ada7ebb7afc8528fa2789e09b359adbc7bb767 Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 14 Mar 2024 17:46:45 +0530 Subject: [PATCH 2/2] weather: Adjust minWidth/Height for high density --- android/src/main/res/xml/weather_appwidget_info.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/res/xml/weather_appwidget_info.xml b/android/src/main/res/xml/weather_appwidget_info.xml index edff021..014ee38 100644 --- a/android/src/main/res/xml/weather_appwidget_info.xml +++ b/android/src/main/res/xml/weather_appwidget_info.xml @@ -3,8 +3,8 @@ xmlns:tools="http://schemas.android.com/tools" android:description="@string/weather" android:initialLayout="@layout/layout_weather_info" - android:minWidth="280dp" - android:minHeight="70dp" + android:minWidth="270dp" + android:minHeight="60dp" android:resizeMode="none" android:targetCellWidth="4" android:targetCellHeight="3" -- GitLab