1<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2011 The Android Open Source Project 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14--> 15<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 16 android:layout_width="match_parent" 17 android:layout_height="match_parent" 18 android:layout_marginBottom="@dimen/widget_margin_bottom" 19 android:layout_marginLeft="@dimen/widget_margin_left" 20 android:layout_marginRight="@dimen/widget_margin_right" 21 android:layout_marginTop="@dimen/widget_margin_top" 22 android:orientation="vertical"> 23 <!-- We define separate margins to allow for flexibility in twiddling the margins 24 depending on device form factor and target SDK version. --> 25 26 <LinearLayout 27 android:layout_width="match_parent" 28 android:layout_height="80dp" 29 android:background="#F8F8F8" 30 android:orientation="horizontal"> 31 32 <ImageView 33 android:id="@+id/city_weather" 34 android:layout_width="wrap_content" 35 android:layout_height="wrap_content" 36 android:adjustViewBounds="true" 37 android:padding="12dp" 38 android:scaleType="fitStart" 39 android:src="@drawable/sunny" /> 40 41 <TextView 42 android:id="@+id/city_name" 43 android:layout_width="wrap_content" 44 android:layout_height="wrap_content" 45 android:layout_gravity="center_vertical" 46 android:text="@string/city_name" 47 android:textAllCaps="true" 48 android:textColor="#232323" 49 android:textSize="24sp" /> 50 </LinearLayout> 51 52 <FrameLayout 53 android:layout_width="match_parent" 54 android:layout_height="match_parent" 55 android:layout_gravity="center" 56 android:layout_weight="1" 57 android:background="#F8F8F8"> 58 59 <ListView 60 android:id="@+id/weather_list" 61 android:layout_width="match_parent" 62 android:layout_height="match_parent" /> 63 64 <TextView 65 android:id="@+id/empty_view" 66 android:layout_width="match_parent" 67 android:layout_height="match_parent" 68 android:gravity="center" 69 android:text="@string/empty_view_text" 70 android:textColor="#ffffff" 71 android:textSize="20sp" 72 android:visibility="gone" /> 73 </FrameLayout> 74 75 <Button 76 android:id="@+id/refresh" 77 android:layout_width="match_parent" 78 android:layout_height="wrap_content" 79 android:background="#F8F8F8" 80 android:gravity="center" 81 android:padding="12dp" 82 android:text="@string/refresh" 83 android:textAllCaps="true" 84 android:textColor="#232323" 85 android:textSize="14sp" /> 86</LinearLayout> 87