Remove errors related to API 11
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Wed, 31 Aug 2016 21:30:39 +0000 (23:30 +0200)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Wed, 31 Aug 2016 21:43:33 +0000 (23:43 +0200)
app/build.gradle
app/src/main/res/layout/appwidget_configure.xml
app/src/main/res/layout/weather_current_fragment.xml
app/src/main/res/layout/weather_map.xml

index f22eb2e..a0172a7 100644 (file)
@@ -21,6 +21,7 @@ android {
         jackOptions {
             enabled true
         }
+        vectorDrawables.useSupportLibrary = true
     }
     buildTypes {
         release {
@@ -51,10 +52,17 @@ android {
 }
 
 dependencies {
-    compile 'com.android.support:support-v4:+'
-    compile 'com.google.android.gms:play-services-maps:+'
-    compile 'com.google.android.gms:play-services-analytics:+'
-    compile 'com.android.support:design:+'
+    // There are a few nasty issues: https://code.google.com/p/android/issues/detail?id=216597
+    // Update once that bug is fixed.
+    compile 'com.android.support:support-v4:24.2.0'
+
+    compile 'com.google.android.gms:play-services-maps:9.4.0'
+    compile 'com.google.android.gms:play-services-analytics:9.4.0'
+    // There are a few nasty issues: https://code.google.com/p/android/issues/detail?id=216597
+    // Update once that bug is fixed.
+    compile 'com.android.support:design:24.2.0'
+    compile 'com.android.support:gridlayout-v7:24.2.0'
+
     compile 'com.fasterxml.jackson.core:jackson-core:2.3.3'
     compile 'com.jakewharton.timber:timber:2.5.0'
 }
index 05556bd..95be9d3 100644 (file)
@@ -15,6 +15,7 @@
     limitations under the License.
 -->
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent">
 
@@ -59,6 +60,7 @@
                 android:orientation="horizontal"
                 android:padding="30dp">
 
+                <!-- TODO: We must use CheckBox for API 11 -->
                 <Switch android:id="@+id/weather_appwidget_configure_country"
                     android:layout_width="fill_parent"
                     android:layout_height="wrap_content"
 
             <View style="@style/Divider"/>
 
-            <GridLayout
+            <android.support.v7.widget.GridLayout
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                android:orientation="horizontal"
+                app:orientation="horizontal"
                 android:padding="30dp">
 
                 <TextView
                     android:textAppearance="?android:attr/textAppearanceMedium"
                     android:text="@string/widget_configure_button_refresh_summary"
                     android:padding="5dp"
-                    android:layout_gravity="start" />
+                    app:layout_gravity="start" />
 
                 <Button android:id="@+id/weather_appwidget_configure_refresh_button"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_gravity="end"
+                    app:layout_gravity="end"
                     android:textAlignment="center"
                     android:onClick="onClickRefresh"
                     android:text="@string/widget_preferences_button_refresh"/>
 
-            </GridLayout>
+            </android.support.v7.widget.GridLayout>
 
         </LinearLayout>
     </ScrollView>
index 78cab5e..eb51186 100644 (file)
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:paddingEnd="10dp"
+                        android:paddingRight="10dp"
                         android:paddingStart="20dp"
+                        android:paddingLeft="20dp"
                         android:singleLine="true"
                         android:text="55ºC"
+                        android:layout_gravity="start"
                         android:textAlignment="textStart"
                         android:textAppearance="?android:attr/textAppearanceLarge"
                         android:textStyle="bold" />
                         android:id="@+id/weather_current_temp_min"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
+                        android:layout_gravity="start"
                         android:textAlignment="textStart"
                         android:paddingEnd="10dp"
+                        android:paddingRight="10dp"
                         android:paddingStart="20dp"
+                        android:paddingLeft="20dp"
                         android:singleLine="true"
                         android:text="25ºC"
                         android:textAppearance="?android:attr/textAppearanceMedium"
                         android:layout_marginTop="5dp"
                         android:layout_marginBottom="5dp"
                         android:layout_marginEnd="5dp"
+                        android:layout_marginRight="5dp"
                         android:textAppearance="?android:attr/textAppearanceSmall"
                         android:textStyle="bold" />
                 </LinearLayout>
                         android:layout_marginTop="5dp"
                         android:layout_marginBottom="5dp"
                         android:layout_marginEnd="5dp"
+                        android:layout_marginRight="5dp"
                         android:textAppearance="?android:attr/textAppearanceSmall"
                         android:textStyle="bold" />
                 </LinearLayout>
                         android:layout_marginTop="5dp"
                         android:layout_marginBottom="5dp"
                         android:layout_marginEnd="5dp"
+                        android:layout_marginRight="5dp"
                         android:textAppearance="?android:attr/textAppearanceSmall"
                         android:textStyle="bold" />
                 </LinearLayout>
                         android:layout_marginTop="5dp"
                         android:layout_marginBottom="5dp"
                         android:layout_marginEnd="5dp"
+                        android:layout_marginRight="5dp"
                         android:textAppearance="?android:attr/textAppearanceSmall"
                         android:textStyle="bold" />
                 </LinearLayout>
                         android:layout_marginTop="5dp"
                         android:layout_marginBottom="5dp"
                         android:layout_marginEnd="5dp"
+                        android:layout_marginRight="5dp"
                         android:textAppearance="?android:attr/textAppearanceSmall"
                         android:textStyle="bold" />
                 </LinearLayout>
                         android:layout_marginTop="5dp"
                         android:layout_marginBottom="5dp"
                         android:layout_marginEnd="5dp"
+                        android:layout_marginRight="5dp"
                         android:textAppearance="?android:attr/textAppearanceSmall"
                         android:textStyle="bold" />
                 </LinearLayout>
                     android:layout_marginTop="5dp"
                     android:layout_marginBottom="5dp"
                     android:layout_marginEnd="5dp"
+                    android:layout_marginRight="5dp"
                     android:textAppearance="?android:attr/textAppearanceSmall"
                     android:textStyle="bold" />
             </LinearLayout>
index 9438f28..5b73a6c 100644 (file)
@@ -27,6 +27,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_alignParentTop="true"
+               android:layout_alignParentLeft="true"
         android:layout_alignParentStart="true" >
        <LinearLayout
                android:id="@+id/weather_map_city_container"
@@ -91,6 +92,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_alignParentBottom="true"
+               android:layout_alignParentLeft="true"
         android:layout_alignParentStart="true"
         android:orientation="horizontal"
         android:baselineAligned="false" >