Bug 962622 - Work around Android pre-v12 rounded corners bug. r=rnewman
authorNick Alexander <nalexander@mozilla.com>
Tue, 15 Apr 2014 18:04:06 -0700
changeset 179589 3b4a911abb02a6459941bb15dc02e902140015de
parent 179588 8a3bc080200e450abe794d60d1349528549f93ec
child 179590 64bfb458f73901560f1f543bc9a5a7f14f4a490f
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersrnewman
bugs962622, 12505934
milestone31.0a1
Bug 962622 - Work around Android pre-v12 rounded corners bug. r=rnewman ======== https://github.com/mozilla-services/android-sync/commit/08f022b13438d73487cec13e0b6d66fd2011bb25 Author: Nick Alexander <nalexander@mozilla.com> Bug 962622 - Work around Android pre-v12 rounded corners bug. This is discussed at http://stackoverflow.com/a/12505934 and tracked at http://code.google.com/p/android/issues/detail?id=9161.
mobile/android/base/resources/drawable-v12/fxaccount_password_active.xml
mobile/android/base/resources/drawable-v12/fxaccount_password_button_hide_active.xml
mobile/android/base/resources/drawable-v12/fxaccount_password_button_show_active.xml
mobile/android/base/resources/drawable-v12/fxaccount_password_inactive.xml
mobile/android/base/resources/drawable/fxaccount_password_active.xml
mobile/android/base/resources/drawable/fxaccount_password_button_hide_active.xml
mobile/android/base/resources/drawable/fxaccount_password_button_show_active.xml
mobile/android/base/resources/drawable/fxaccount_password_inactive.xml
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable-v12/fxaccount_password_active.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="rectangle">
+  <solid
+      android:color="@android:color/white" />
+  <stroke
+      android:width="@dimen/fxaccount_stroke_width"
+      android:color="@color/fxaccount_input_borderActive" />
+  <corners
+      android:radius="@dimen/fxaccount_corner_radius"
+      android:topLeftRadius="@dimen/fxaccount_corner_radius"
+      android:topRightRadius="0dp"
+      android:bottomLeftRadius="@dimen/fxaccount_corner_radius"
+      android:bottomRightRadius="0dp" />
+</shape>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable-v12/fxaccount_password_button_hide_active.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="rectangle">
+  <solid
+      android:color="@color/fxaccount_password_hide_backgroundcolor" />
+  <stroke
+      android:width="@dimen/fxaccount_stroke_width"
+      android:color="@color/fxaccount_input_borderActive" />
+  <corners
+      android:radius="@dimen/fxaccount_corner_radius"
+      android:topLeftRadius="0dp"
+      android:topRightRadius="@dimen/fxaccount_corner_radius"
+      android:bottomLeftRadius="0dp"
+      android:bottomRightRadius="@dimen/fxaccount_corner_radius" />
+</shape>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable-v12/fxaccount_password_button_show_active.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="rectangle">
+  <solid
+      android:color="@color/fxaccount_password_show_backgroundcolor" />
+  <stroke
+      android:width="@dimen/fxaccount_stroke_width"
+      android:color="@color/fxaccount_input_borderActive" />
+  <corners
+      android:radius="@dimen/fxaccount_corner_radius"
+      android:topLeftRadius="0dp"
+      android:topRightRadius="@dimen/fxaccount_corner_radius"
+      android:bottomLeftRadius="0dp"
+      android:bottomRightRadius="@dimen/fxaccount_corner_radius" />
+</shape>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable-v12/fxaccount_password_inactive.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="rectangle">
+  <solid
+      android:color="@android:color/white" />
+  <stroke
+      android:width="@dimen/fxaccount_stroke_width"
+      android:color="@color/fxaccount_input_borderInactive" />
+  <corners
+      android:radius="@dimen/fxaccount_corner_radius"
+      android:topLeftRadius="@dimen/fxaccount_corner_radius"
+      android:topRightRadius="0dp"
+      android:bottomLeftRadius="@dimen/fxaccount_corner_radius"
+      android:bottomRightRadius="0dp" />
+</shape>
--- a/mobile/android/base/resources/drawable/fxaccount_password_active.xml
+++ b/mobile/android/base/resources/drawable/fxaccount_password_active.xml
@@ -5,15 +5,18 @@
 
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
   <solid
       android:color="@android:color/white" />
   <stroke
       android:width="@dimen/fxaccount_stroke_width"
       android:color="@color/fxaccount_input_borderActive" />
+  <!-- On Android pre v12/3.0/Gingerbread, bottom left and bottom
+       right are swapped. These values correct this bug; the resources
+       that don't need correction are in res/drawable-v12. -->
   <corners
       android:radius="@dimen/fxaccount_corner_radius"
       android:topLeftRadius="@dimen/fxaccount_corner_radius"
       android:topRightRadius="0dp"
-      android:bottomLeftRadius="@dimen/fxaccount_corner_radius"
-      android:bottomRightRadius="0dp" />
+      android:bottomLeftRadius="0dp"
+      android:bottomRightRadius="@dimen/fxaccount_corner_radius" />
 </shape>
--- a/mobile/android/base/resources/drawable/fxaccount_password_button_hide_active.xml
+++ b/mobile/android/base/resources/drawable/fxaccount_password_button_hide_active.xml
@@ -5,15 +5,18 @@
 
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
   <solid
       android:color="@color/fxaccount_password_hide_backgroundcolor" />
   <stroke
       android:width="@dimen/fxaccount_stroke_width"
       android:color="@color/fxaccount_input_borderActive" />
+  <!-- On Android pre v12/3.0/Gingerbread, bottom left and bottom
+       right are swapped. These values correct this bug; the resources
+       that don't need correction are in res/drawable-v12. -->
   <corners
       android:radius="@dimen/fxaccount_corner_radius"
       android:topLeftRadius="0dp"
       android:topRightRadius="@dimen/fxaccount_corner_radius"
-      android:bottomLeftRadius="0dp"
-      android:bottomRightRadius="@dimen/fxaccount_corner_radius" />
+      android:bottomRightRadius="0dp"
+      android:bottomLeftRadius="@dimen/fxaccount_corner_radius" />
 </shape>
--- a/mobile/android/base/resources/drawable/fxaccount_password_button_show_active.xml
+++ b/mobile/android/base/resources/drawable/fxaccount_password_button_show_active.xml
@@ -5,15 +5,18 @@
 
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
   <solid
       android:color="@color/fxaccount_password_show_backgroundcolor" />
   <stroke
       android:width="@dimen/fxaccount_stroke_width"
       android:color="@color/fxaccount_input_borderActive" />
+  <!-- On Android pre v12/3.0/Gingerbread, bottom left and bottom
+       right are swapped. These values correct this bug; the resources
+       that don't need correction are in res/drawable-v12. -->
   <corners
       android:radius="@dimen/fxaccount_corner_radius"
       android:topLeftRadius="0dp"
       android:topRightRadius="@dimen/fxaccount_corner_radius"
-      android:bottomLeftRadius="0dp"
-      android:bottomRightRadius="@dimen/fxaccount_corner_radius" />
+      android:bottomRightRadius="0dp"
+      android:bottomLeftRadius="@dimen/fxaccount_corner_radius" />
 </shape>
--- a/mobile/android/base/resources/drawable/fxaccount_password_inactive.xml
+++ b/mobile/android/base/resources/drawable/fxaccount_password_inactive.xml
@@ -5,15 +5,18 @@
 
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
   <solid
       android:color="@android:color/white" />
   <stroke
       android:width="@dimen/fxaccount_stroke_width"
       android:color="@color/fxaccount_input_borderInactive" />
+  <!-- On Android pre v12/3.0/Gingerbread, bottom left and bottom
+       right are swapped. These values correct this bug; the resources
+       that don't need correction are in res/drawable-v12. -->
   <corners
       android:radius="@dimen/fxaccount_corner_radius"
       android:topLeftRadius="@dimen/fxaccount_corner_radius"
       android:topRightRadius="0dp"
-      android:bottomLeftRadius="@dimen/fxaccount_corner_radius"
-      android:bottomRightRadius="0dp" />
+      android:bottomLeftRadius="0dp"
+      android:bottomRightRadius="@dimen/fxaccount_corner_radius" />
 </shape>