WeatherInformation: widget WIP
authorgu.martinm@gmail.com <gu.martinm@gmail.com>
Fri, 26 Sep 2014 01:51:06 +0000 (03:51 +0200)
committergu.martinm@gmail.com <gu.martinm@gmail.com>
Fri, 26 Sep 2014 01:51:06 +0000 (03:51 +0200)
Android/WeatherInformation/res/layout/appwidget.xml
Android/WeatherInformation/res/values/styles.xml
Android/WeatherInformation/res/xml/appwidget_provider.xml

index d00a9b6..c83527d 100644 (file)
@@ -5,6 +5,7 @@
     android:layout_gravity="fill"
     android:orientation="horizontal"
     android:baselineAligned="false"
+    android:background="@color/widget_background_holo_dark"
     android:padding="@dimen/widget_margin" >
 
     <LinearLayout
         android:layout_height="match_parent"
         android:layout_gravity="center"
         android:gravity="center"
+        android:padding="4dp"
         android:orientation="vertical" >
     
        <ImageView
+               android:id="@+id/weather_appwidget_image"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="start"
                android:contentDescription="@string/icon_weather_description"
                android:orientation="vertical"
-               android:src="@drawable/ic_launcher" />
-    </LinearLayout>
+               android:src="@drawable/weather_showers" />
     
-
-       
-    <LinearLayout
-        android:layout_width="0dp"
-        android:layout_height="match_parent"
-        android:layout_gravity="center"
-        android:layout_weight="2"
-        android:gravity="center"
-        android:orientation="vertical" >
-        
-        <TextView
-            android:id="@+id/weather_appwidget_city"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center"
-            android:text="Morata de Tajuña"
-            android:textAlignment="center"
-            android:textAppearance="?android:attr/textAppearanceSmall"
-            android:textStyle="bold" />
-    
-        <TextView
-            android:id="@+id/weather_appwidget_country"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center"
-            android:text="Spain"
-            android:textAlignment="center"
-            android:textAppearance="?android:attr/textAppearanceSmall"
-            android:textStyle="normal" />
     </LinearLayout>
-            
+    
     <LinearLayout
-        android:layout_width="0dp"
+        android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:layout_gravity="center"
-        android:layout_weight="1"
         android:gravity="center"
+        android:padding="4dp"
         android:orientation="vertical" >
         
         <TextView
         android:layout_height="match_parent"
         android:layout_gravity="center"
         android:gravity="center"
+        android:padding="4dp"
         android:orientation="vertical" >
+        
+        <TextView
+            android:id="@+id/weather_appwidget_city"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:text="Morata de Tajuña"
+            android:textAlignment="center"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textStyle="bold" />
     
-       <ImageView
-               android:id="@+id/weather_appwidget_image"
-               android:layout_width="wrap_content"
-               android:layout_height="wrap_content"
-               android:layout_gravity="end"
-               android:contentDescription="@string/icon_weather_description"
-               android:orientation="vertical"
-               android:src="@drawable/ic_launcher" />
-    
+        <TextView
+            android:id="@+id/weather_appwidget_country"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:text="Spain"
+            android:textAlignment="center"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textStyle="normal" />
     </LinearLayout>
+            
+
+    
+
 
 </LinearLayout>
index 628fe9b..034465a 100644 (file)
@@ -19,5 +19,6 @@
     
 
     <color name="weather_time_of_day_color_title">#48aed4</color>
+    <color name="widget_background_holo_dark">#ff000000</color>
 
 </resources>
index 90ffc87..396c70a 100644 (file)
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
-    android:minWidth="40dp"
+    android:minWidth="180dp"
     android:minHeight="40dp"
-    android:minResizeWidth="40dp"
+    android:minResizeWidth="180dp"
     android:minResizeHeight="40dp"
     android:resizeMode="none"
     android:previewImage="@drawable/ic_launcher"
     android:initialLayout="@layout/appwidget"
     android:configure="de.example.exampletdd.widget.WeatherInformationWidgetConfigure" 
     android:widgetCategory="home_screen|keyguard"
-    android:updatePeriodMillis="86400000">
+    android:updatePeriodMillis="900000">
 </appwidget-provider>