Merge "Updating the sample widget with some better resources."
@@ -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>
|
||||
</manifest>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 459 B |
|
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 218 B |
BIN
samples/WeatherListWidget/res/drawable-hdpi/header.9.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 558 B After Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 315 B |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 164 B |
BIN
samples/WeatherListWidget/res/drawable-mdpi/header.9.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 399 B After Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 438 B After Width: | Height: | Size: 192 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -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>
|
||||
|
||||
21
samples/WeatherListWidget/res/values-v14/dimens.xml
Normal file
@@ -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>
|
||||
21
samples/WeatherListWidget/res/values/dimens.xml
Normal file
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -123,4 +123,4 @@ class StackRemoteViewsFactory implements RemoteViewsService.RemoteViewsFactory {
|
||||
mCursor = mContext.getContentResolver().query(WeatherDataProvider.CONTENT_URI, null, null,
|
||||
null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||