Skip to content

Commit bf6d21c

Browse files
committed
Adjust size and preview of the weather widget in platform samples.
- 4x2 is the recommended size for such widget - avoid 3x? sizes - Uses glance loading layout resource instead of the local xml - Update the preview image
1 parent 4dc3b2e commit bf6d21c

File tree

4 files changed

+3
-32
lines changed

4 files changed

+3
-32
lines changed
75.6 KB
Loading

samples/user-interface/appwidgets/src/main/res/layout/widget_loading.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

samples/user-interface/appwidgets/src/main/res/xml/app_widget_weather_forecast.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
android:previewImage="@drawable/weather_forecast_widget_preview"
2828
android:previewLayout="@layout/widget_weather_forecast_small"
2929
android:resizeMode="horizontal|vertical"
30-
android:targetCellWidth="3"
30+
android:targetCellWidth="4"
3131
android:targetCellHeight="2"
3232
android:updatePeriodMillis="86400000"
3333
android:widgetCategory="home_screen" />

samples/user-interface/appwidgets/src/main/res/xml/app_widget_weather_forecast_glance.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
-->
1616
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
1717
android:description="@string/app_widget_weather_description"
18-
android:initialLayout="@layout/widget_loading"
18+
android:initialLayout="@layout/glance_default_loading_layout"
1919
android:minWidth="184dp"
2020
android:minHeight="184dp"
2121
android:minResizeWidth="120dp"
2222
android:minResizeHeight="120dp"
2323
android:previewImage="@drawable/weather_forecast_widget_preview"
2424
android:previewLayout="@layout/widget_weather_forecast_small"
2525
android:resizeMode="horizontal|vertical"
26-
android:targetCellWidth="3"
26+
android:targetCellWidth="4"
2727
android:targetCellHeight="2"
2828
android:updatePeriodMillis="1800000"
2929
android:widgetCategory="home_screen" />

0 commit comments

Comments
 (0)