Updating the sample widget with some better resources.

Change-Id: I74192f00b2f539c3431f3c327575f0e99f907be8
diff --git a/samples/WeatherListWidget/AndroidManifest.xml b/samples/WeatherListWidget/AndroidManifest.xml
index cfb2372..7b1638f 100644
--- a/samples/WeatherListWidget/AndroidManifest.xml
+++ b/samples/WeatherListWidget/AndroidManifest.xml
@@ -21,7 +21,9 @@
      to come from a domain that you own or have control over. -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.example.android.weatherlistwidget">
-    <uses-sdk android:minSdkVersion="11" />
+
+    <uses-sdk android:minSdkVersion="11"
+              android:targetSdkVersion="14"/>
     <application android:label="Weather Widget Sample">
         <!-- The widget provider -->
         <receiver android:name="WeatherWidgetProvider">
@@ -42,4 +44,4 @@
         <provider android:name="WeatherDataProvider"
               android:authorities="com.example.android.weatherlistwidget.provider" />
     </application>
-</manifest>
\ No newline at end of file
+</manifest>
diff --git a/samples/WeatherListWidget/res/drawable-hdpi/body.png b/samples/WeatherListWidget/res/drawable-hdpi/body.png
index 0a2c1d1..17d303f 100644
--- a/samples/WeatherListWidget/res/drawable-hdpi/body.png
+++ b/samples/WeatherListWidget/res/drawable-hdpi/body.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-hdpi/footer.png b/samples/WeatherListWidget/res/drawable-hdpi/footer.png
index 73cc95c..43962f7 100644
--- a/samples/WeatherListWidget/res/drawable-hdpi/footer.png
+++ b/samples/WeatherListWidget/res/drawable-hdpi/footer.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-hdpi/header.9.png b/samples/WeatherListWidget/res/drawable-hdpi/header.9.png
new file mode 100644
index 0000000..5f34768
--- /dev/null
+++ b/samples/WeatherListWidget/res/drawable-hdpi/header.9.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-hdpi/header.png b/samples/WeatherListWidget/res/drawable-hdpi/header.png
deleted file mode 100644
index e659aee..0000000
--- a/samples/WeatherListWidget/res/drawable-hdpi/header.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-hdpi/item_bg_dark.png b/samples/WeatherListWidget/res/drawable-hdpi/item_bg_dark.png
index 5097ab7..f5886bd 100644
--- a/samples/WeatherListWidget/res/drawable-hdpi/item_bg_dark.png
+++ b/samples/WeatherListWidget/res/drawable-hdpi/item_bg_dark.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-hdpi/item_bg_light.png b/samples/WeatherListWidget/res/drawable-hdpi/item_bg_light.png
index 019f36c..e8b5aaf 100644
--- a/samples/WeatherListWidget/res/drawable-hdpi/item_bg_light.png
+++ b/samples/WeatherListWidget/res/drawable-hdpi/item_bg_light.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-hdpi/refresh.png b/samples/WeatherListWidget/res/drawable-hdpi/refresh.png
index 2847773..eaec9cb 100644
--- a/samples/WeatherListWidget/res/drawable-hdpi/refresh.png
+++ b/samples/WeatherListWidget/res/drawable-hdpi/refresh.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-hdpi/refresh_pressed.png b/samples/WeatherListWidget/res/drawable-hdpi/refresh_pressed.png
index 820cc36..34438b7 100644
--- a/samples/WeatherListWidget/res/drawable-hdpi/refresh_pressed.png
+++ b/samples/WeatherListWidget/res/drawable-hdpi/refresh_pressed.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-ldpi/body.png b/samples/WeatherListWidget/res/drawable-ldpi/body.png
deleted file mode 100644
index 3ce4276..0000000
--- a/samples/WeatherListWidget/res/drawable-ldpi/body.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-ldpi/footer.png b/samples/WeatherListWidget/res/drawable-ldpi/footer.png
deleted file mode 100644
index ab89bf3..0000000
--- a/samples/WeatherListWidget/res/drawable-ldpi/footer.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-ldpi/header.png b/samples/WeatherListWidget/res/drawable-ldpi/header.png
deleted file mode 100644
index ff29577..0000000
--- a/samples/WeatherListWidget/res/drawable-ldpi/header.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-ldpi/icon.png b/samples/WeatherListWidget/res/drawable-ldpi/icon.png
deleted file mode 100644
index 1095584..0000000
--- a/samples/WeatherListWidget/res/drawable-ldpi/icon.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-ldpi/item_bg_dark.png b/samples/WeatherListWidget/res/drawable-ldpi/item_bg_dark.png
deleted file mode 100644
index c945b5f..0000000
--- a/samples/WeatherListWidget/res/drawable-ldpi/item_bg_dark.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-ldpi/item_bg_light.png b/samples/WeatherListWidget/res/drawable-ldpi/item_bg_light.png
deleted file mode 100644
index a14b9a6..0000000
--- a/samples/WeatherListWidget/res/drawable-ldpi/item_bg_light.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-ldpi/refresh.png b/samples/WeatherListWidget/res/drawable-ldpi/refresh.png
deleted file mode 100644
index d08343c..0000000
--- a/samples/WeatherListWidget/res/drawable-ldpi/refresh.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-ldpi/refresh_pressed.png b/samples/WeatherListWidget/res/drawable-ldpi/refresh_pressed.png
deleted file mode 100644
index 3da3ae6..0000000
--- a/samples/WeatherListWidget/res/drawable-ldpi/refresh_pressed.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-mdpi/body.png b/samples/WeatherListWidget/res/drawable-mdpi/body.png
index 5331a9a..a08d03b 100644
--- a/samples/WeatherListWidget/res/drawable-mdpi/body.png
+++ b/samples/WeatherListWidget/res/drawable-mdpi/body.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-mdpi/footer.png b/samples/WeatherListWidget/res/drawable-mdpi/footer.png
index ca8b7ec..d3960a7 100644
--- a/samples/WeatherListWidget/res/drawable-mdpi/footer.png
+++ b/samples/WeatherListWidget/res/drawable-mdpi/footer.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-mdpi/header.9.png b/samples/WeatherListWidget/res/drawable-mdpi/header.9.png
new file mode 100644
index 0000000..2372225
--- /dev/null
+++ b/samples/WeatherListWidget/res/drawable-mdpi/header.9.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-mdpi/header.png b/samples/WeatherListWidget/res/drawable-mdpi/header.png
deleted file mode 100644
index 5452abf..0000000
--- a/samples/WeatherListWidget/res/drawable-mdpi/header.png
+++ /dev/null
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-mdpi/item_bg_dark.png b/samples/WeatherListWidget/res/drawable-mdpi/item_bg_dark.png
index 5ae5480..a3ac9d7 100644
--- a/samples/WeatherListWidget/res/drawable-mdpi/item_bg_dark.png
+++ b/samples/WeatherListWidget/res/drawable-mdpi/item_bg_dark.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-mdpi/item_bg_light.png b/samples/WeatherListWidget/res/drawable-mdpi/item_bg_light.png
index 5696944..ec6f5aa 100644
--- a/samples/WeatherListWidget/res/drawable-mdpi/item_bg_light.png
+++ b/samples/WeatherListWidget/res/drawable-mdpi/item_bg_light.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-mdpi/refresh.png b/samples/WeatherListWidget/res/drawable-mdpi/refresh.png
index 569b360..006bcc5 100644
--- a/samples/WeatherListWidget/res/drawable-mdpi/refresh.png
+++ b/samples/WeatherListWidget/res/drawable-mdpi/refresh.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/drawable-mdpi/refresh_pressed.png b/samples/WeatherListWidget/res/drawable-mdpi/refresh_pressed.png
index 5f10662..d8ca9b5 100644
--- a/samples/WeatherListWidget/res/drawable-mdpi/refresh_pressed.png
+++ b/samples/WeatherListWidget/res/drawable-mdpi/refresh_pressed.png
Binary files differ
diff --git a/samples/WeatherListWidget/res/layout/widget_layout.xml b/samples/WeatherListWidget/res/layout/widget_layout.xml
index 4b09efc..4c58fa7 100644
--- a/samples/WeatherListWidget/res/layout/widget_layout.xml
+++ b/samples/WeatherListWidget/res/layout/widget_layout.xml
@@ -14,9 +14,15 @@
      limitations under the License.
 -->
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="294dp"
+    android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical">
+    android:orientation="vertical"
+    android:layout_marginTop="@dimen/widget_margin_top"
+    android:layout_marginBottom="@dimen/widget_margin_bottom"
+    android:layout_marginLeft="@dimen/widget_margin_left"
+    android:layout_marginRight="@dimen/widget_margin_right">
+    <!-- We define separate margins to allow for flexibility in twiddling the margins
+         depending on device form factor and target SDK version. -->
     <FrameLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
@@ -24,12 +30,14 @@
             android:id="@+id/header"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:scaleType="fitXY"
             android:src="@drawable/header" />
         <ImageButton
             android:id="@+id/refresh"
             android:layout_width="56dp"
             android:layout_height="39dp"
-            android:layout_marginLeft="222dp"
+            android:layout_gravity="right|top"
+            android:layout_marginRight="15dp"
             android:layout_marginTop="20dp"
             android:background="@drawable/refresh_button" />
     </FrameLayout>
@@ -57,5 +65,6 @@
         android:id="@+id/footer"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:scaleType="fitXY"
         android:src="@drawable/footer" />
 </LinearLayout>
diff --git a/samples/WeatherListWidget/res/values-v14/dimens.xml b/samples/WeatherListWidget/res/values-v14/dimens.xml
new file mode 100644
index 0000000..8b5494e
--- /dev/null
+++ b/samples/WeatherListWidget/res/values-v14/dimens.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources>
+    <dimen name="widget_margin_top">0dp</dimen>
+    <dimen name="widget_margin_bottom">0dp</dimen>
+    <dimen name="widget_margin_left">0dp</dimen>
+    <dimen name="widget_margin_right">0dp</dimen>
+</resources>
diff --git a/samples/WeatherListWidget/res/values/dimens.xml b/samples/WeatherListWidget/res/values/dimens.xml
new file mode 100644
index 0000000..00257a9
--- /dev/null
+++ b/samples/WeatherListWidget/res/values/dimens.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources>
+    <dimen name="widget_margin_top">8dp</dimen>
+    <dimen name="widget_margin_bottom">8dp</dimen>
+    <dimen name="widget_margin_left">8dp</dimen>
+    <dimen name="widget_margin_right">8dp</dimen>
+</resources>
\ No newline at end of file
diff --git a/samples/WeatherListWidget/res/xml/widgetinfo.xml b/samples/WeatherListWidget/res/xml/widgetinfo.xml
index af64106..e6e9cf3 100644
--- a/samples/WeatherListWidget/res/xml/widgetinfo.xml
+++ b/samples/WeatherListWidget/res/xml/widgetinfo.xml
@@ -15,10 +15,12 @@
 -->
 <appwidget-provider
   xmlns:android="http://schemas.android.com/apk/res/android"
-  android:minWidth="222dip"
-  android:minHeight="222dip"
+  android:minWidth="250dp"
+  android:minHeight="180dp"
   android:updatePeriodMillis="1800000"
   android:initialLayout="@layout/widget_layout"
   android:resizeMode="vertical"
+  android:minResizeWidth="250dp"
+  android:minResizeHeight="110dp"
   android:previewImage="@drawable/preview">
 </appwidget-provider>
diff --git a/samples/WeatherListWidget/src/com/example/android/weatherlistwidget/WeatherWidgetService.java b/samples/WeatherListWidget/src/com/example/android/weatherlistwidget/WeatherWidgetService.java
index e0bc682..1d3c349 100644
--- a/samples/WeatherListWidget/src/com/example/android/weatherlistwidget/WeatherWidgetService.java
+++ b/samples/WeatherListWidget/src/com/example/android/weatherlistwidget/WeatherWidgetService.java
@@ -123,4 +123,4 @@
         mCursor = mContext.getContentResolver().query(WeatherDataProvider.CONTENT_URI, null, null,
                 null, null);
     }
-}
\ No newline at end of file
+}