OmniGears: rework of color picker dialog layouts

Change-Id: I5b9df7dfdf3d6a1a0befacfb8492eed92937aa0e
diff --git a/res/layout-land/dialog_battery_settings.xml b/res/layout-land/dialog_battery_settings.xml
index a81676f..330a7d8 100644
--- a/res/layout-land/dialog_battery_settings.xml
+++ b/res/layout-land/dialog_battery_settings.xml
@@ -12,28 +12,27 @@
      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. -->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
+     limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical"
+    android:orientation="horizontal" >
     <org.omnirom.omnigears.ui.ColorPickerView
         android:id="@+id/color_picker_view"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_centerVertical="true"
         android:layout_marginEnd="5dp"
         android:layout_marginStart="10dp" />
     <LinearLayout
         android:id="@+id/color_panel_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginBottom="4dp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="5dp"
         android:layout_marginEnd="10dp"
         android:layout_marginStart="5dp"
-        android:layout_marginTop="4dp"
-        android:layout_toRightOf="@id/color_picker_view"
+        android:layout_marginTop="5dp"
         android:orientation="vertical" >
         <EditText
             android:id="@+id/hex_color_input"
@@ -45,35 +44,29 @@
         <org.omnirom.omnigears.ui.ColorPanelView
             android:id="@+id/color_panel"
             android:layout_width="match_parent"
-            android:layout_height="30dp" />
+            android:layout_height="40dp" />
     </LinearLayout>
-
     <LinearLayout
         android:id="@+id/color_list_view"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="10dp"
-        android:layout_marginEnd="10dp"
-        android:layout_marginTop="5dp"
         android:layout_marginBottom="5dp"
+        android:layout_marginEnd="10dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginTop="5dp"
         android:orientation="horizontal" >
-
-             <Spinner
-                android:id="@+id/color_list_spinner"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_vertical"
-                android:layout_weight="0.5" />
-
-            <View
-                android:layout_width="8dip"
-                android:layout_height="match_parent" />
-
-             <org.omnirom.omnigears.ui.ColorPanelView
-                android:id="@+id/color_list_panel"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_gravity="center_vertical"
-                android:layout_weight="0.5" />
+        <Spinner
+            android:id="@+id/color_list_spinner"
+            android:layout_width="0px"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:layout_weight="0.5" />
+        <org.omnirom.omnigears.ui.ColorPanelView
+            android:id="@+id/color_list_panel"
+            android:layout_width="0px"
+            android:layout_height="40dp"
+            android:layout_gravity="center_vertical"
+            android:layout_marginStart="10dp"
+            android:layout_weight="0.5" />
     </LinearLayout>
-</RelativeLayout>
+</LinearLayout>
diff --git a/res/layout-land/dialog_color_picker.xml b/res/layout-land/dialog_color_picker.xml
index 6a34181..334f76f 100644
--- a/res/layout-land/dialog_color_picker.xml
+++ b/res/layout-land/dialog_color_picker.xml
@@ -14,25 +14,25 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content"
-    android:layout_height="wrap_content" >
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical"
+    android:orientation="horizontal" >
     <org.omnirom.omnigears.ui.ColorPickerView
         android:id="@+id/color_picker_view"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_centerVertical="true"
         android:layout_marginEnd="5dp"
         android:layout_marginStart="10dp" />
     <LinearLayout
         android:id="@+id/color_panel_view"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginBottom="4dp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="5dp"
         android:layout_marginEnd="10dp"
         android:layout_marginStart="5dp"
-        android:layout_marginTop="4dp"
-        android:layout_toRightOf="@id/color_picker_view"
+        android:layout_marginTop="5dp"
         android:orientation="vertical" >
         <EditText
             android:id="@+id/hex_color_input"
@@ -46,4 +46,4 @@
             android:layout_width="match_parent"
             android:layout_height="40dp" />
     </LinearLayout>
-</RelativeLayout>
+</LinearLayout>
diff --git a/res/layout-land/dialog_light_settings.xml b/res/layout-land/dialog_light_settings.xml
index c845275..e4ec129 100644
--- a/res/layout-land/dialog_light_settings.xml
+++ b/res/layout-land/dialog_light_settings.xml
@@ -12,54 +12,51 @@
      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. -->
-
+     limitations under the License.
+-->
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical"
     android:orientation="horizontal" >
-
     <org.omnirom.omnigears.ui.ColorPickerView
         android:id="@+id/color_picker_view"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_centerVertical="true"
         android:layout_marginEnd="5dp"
-        android:layout_marginStart="10dp"/>
-
+        android:layout_marginStart="10dp" />
     <LinearLayout
         android:id="@+id/color_list_view"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="10dp"
-        android:layout_marginEnd="5dp"
-        android:layout_marginTop="5dp"
         android:layout_marginBottom="5dp"
+        android:layout_marginEnd="5dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginTop="5dp"
         android:layout_weight="0.5"
+        android:layout_gravity="center_vertical"
         android:orientation="vertical" >
-
-         <Spinner
+        <Spinner
             android:id="@+id/color_list_spinner"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
-         <org.omnirom.omnigears.ui.ColorPanelView
+            android:layout_height="wrap_content"
+            android:layout_weight="0.5" />
+        <org.omnirom.omnigears.ui.ColorPanelView
             android:id="@+id/color_list_panel"
-            android:layout_width="180dp"
-            android:layout_height="50dp"/>
-
+            android:layout_width="match_parent"
+            android:layout_height="40dp"
+            android:layout_weight="0.5" />
     </LinearLayout>
-
     <LinearLayout
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="5dp"
         android:layout_marginEnd="10dp"
         android:layout_marginStart="5dp"
         android:layout_marginTop="5dp"
-        android:layout_marginBottom="5dp"
-        android:orientation="vertical"
-        android:layout_weight="0.5" >
-
+        android:layout_weight="0.5"
+        android:layout_gravity="center_vertical"
+        android:orientation="vertical" >
         <LinearLayout
             android:id="@+id/color_panel_view"
             android:layout_width="match_parent"
@@ -72,23 +69,18 @@
                 android:digits="0123456789ABCDEFabcdef"
                 android:inputType="textNoSuggestions"
                 android:maxLength="6" />
-
             <org.omnirom.omnigears.ui.ColorPanelView
                 android:id="@+id/color_panel"
                 android:layout_width="match_parent"
-                android:layout_height="30dp" />
-
+                android:layout_height="40dp" />
         </LinearLayout>
-
         <Spinner
             android:id="@+id/on_spinner"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
+            android:layout_height="wrap_content" />
         <Spinner
             android:id="@+id/off_spinner"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
-
+            android:layout_height="wrap_content" />
     </LinearLayout>
 </LinearLayout>
diff --git a/res/layout/dialog_battery_settings.xml b/res/layout/dialog_battery_settings.xml
index 670f918..0792d54 100644
--- a/res/layout/dialog_battery_settings.xml
+++ b/res/layout/dialog_battery_settings.xml
@@ -12,77 +12,63 @@
      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. -->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
+     limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="vertical" >
     <org.omnirom.omnigears.ui.ColorPickerView
         android:id="@+id/color_picker_view"
-        android:layout_width="match_parent"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_centerHorizontal="true"
-        android:layout_marginStart="10dp"
-        android:layout_marginEnd="10dp" />
-
+        android:layout_marginEnd="10dp"
+        android:layout_marginStart="10dp" />
     <LinearLayout
         android:id="@+id/color_panel_view"
         android:layout_width="match_parent"
         android:layout_height="40dp"
-        android:layout_alignStart="@id/color_picker_view"
-        android:layout_alignEnd="@id/color_picker_view"
-        android:layout_below="@id/color_picker_view"
-        android:layout_marginBottom="4dp"
-        android:layout_marginTop="4dp"
+        android:layout_marginBottom="5dp"
+        android:layout_marginEnd="10dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginTop="5dp"
         android:orientation="horizontal" >
-
         <EditText
             android:id="@+id/hex_color_input"
             android:layout_width="0px"
-            android:maxLength="6"
+            android:layout_height="match_parent"
+            android:layout_weight="0.5"
             android:digits="0123456789ABCDEFabcdef"
             android:inputType="textNoSuggestions"
-            android:layout_height="match_parent"
-            android:layout_weight="0.5" />
-
-        <View
-            android:layout_width="8dip"
-            android:layout_height="match_parent" />
-
+            android:maxLength="6" />
         <org.omnirom.omnigears.ui.ColorPanelView
             android:id="@+id/color_panel"
             android:layout_width="0px"
             android:layout_height="match_parent"
+            android:layout_marginStart="10dp"
             android:layout_weight="0.5" />
     </LinearLayout>
-
     <LinearLayout
         android:id="@+id/color_list_view"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="10dp"
-        android:layout_marginEnd="10dp"
-        android:layout_marginTop="5dp"
         android:layout_marginBottom="5dp"
+        android:layout_marginEnd="10dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginTop="5dp"
         android:orientation="horizontal" >
-
-             <Spinner
-                android:id="@+id/color_list_spinner"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_vertical"
-                android:layout_weight="0.5" />
-
-            <View
-                android:layout_width="8dip"
-                android:layout_height="match_parent" />
-
-             <org.omnirom.omnigears.ui.ColorPanelView
-                android:id="@+id/color_list_panel"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_gravity="center_vertical"
-                android:layout_weight="0.5" />
+        <Spinner
+            android:id="@+id/color_list_spinner"
+            android:layout_width="0px"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:layout_weight="0.5" />
+        <org.omnirom.omnigears.ui.ColorPanelView
+            android:id="@+id/color_list_panel"
+            android:layout_width="0px"
+            android:layout_height="40dp"
+            android:layout_gravity="center_vertical"
+            android:layout_marginStart="10dp"
+            android:layout_weight="0.5" />
     </LinearLayout>
-</RelativeLayout>
+</LinearLayout>
diff --git a/res/layout/dialog_color_picker.xml b/res/layout/dialog_color_picker.xml
index 1284878..e611382 100644
--- a/res/layout/dialog_color_picker.xml
+++ b/res/layout/dialog_color_picker.xml
@@ -12,44 +12,40 @@
      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. -->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
+     limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="vertical" >
     <org.omnirom.omnigears.ui.ColorPickerView
         android:id="@+id/color_picker_view"
-        android:layout_width="match_parent"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_centerHorizontal="true"
-        android:layout_marginStart="10dp"
-        android:layout_marginEnd="10dp" />
-
+        android:layout_marginEnd="10dp"
+        android:layout_marginStart="10dp" />
     <LinearLayout
         android:id="@+id/color_panel_view"
         android:layout_width="match_parent"
         android:layout_height="40dp"
-        android:layout_alignStart="@id/color_picker_view"
-        android:layout_alignEnd="@id/color_picker_view"
-        android:layout_below="@id/color_picker_view"
-        android:layout_marginBottom="4dp"
-        android:layout_marginTop="4dp"
+        android:layout_marginBottom="5dp"
+        android:layout_marginEnd="10dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginTop="5dp"
         android:orientation="horizontal" >
-
         <EditText
             android:id="@+id/hex_color_input"
             android:layout_width="0px"
-            android:maxLength="6"
+            android:layout_height="match_parent"
+            android:layout_weight="0.5"
             android:digits="0123456789ABCDEFabcdef"
             android:inputType="textNoSuggestions"
-            android:layout_height="match_parent"
-            android:layout_weight="0.5" />
-
+            android:maxLength="6" />
         <org.omnirom.omnigears.ui.ColorPanelView
             android:id="@+id/color_panel"
             android:layout_width="0px"
             android:layout_height="match_parent"
+            android:layout_marginStart="10dp"
             android:layout_weight="0.5" />
     </LinearLayout>
-</RelativeLayout>
+</LinearLayout>
diff --git a/res/layout/dialog_light_settings.xml b/res/layout/dialog_light_settings.xml
index d96d65f..d185cee 100644
--- a/res/layout/dialog_light_settings.xml
+++ b/res/layout/dialog_light_settings.xml
@@ -12,118 +12,100 @@
      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. -->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
+     limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:orientation="vertical" >
     <org.omnirom.omnigears.ui.ColorPickerView
         android:id="@+id/color_picker_view"
-        android:layout_width="match_parent"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_centerHorizontal="true"
-        android:layout_marginStart="10dp"
-        android:layout_marginEnd="10dp" />
-
+        android:layout_marginEnd="10dp"
+        android:layout_marginStart="10dp" />
     <LinearLayout
         android:id="@+id/color_panel_view"
         android:layout_width="match_parent"
         android:layout_height="40dp"
-        android:layout_alignStart="@id/color_picker_view"
-        android:layout_alignEnd="@id/color_picker_view"
-        android:layout_below="@id/color_picker_view"
-        android:layout_marginBottom="4dp"
-        android:layout_marginTop="4dp"
+        android:layout_marginBottom="5dp"
+        android:layout_marginEnd="10dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginTop="5dp"
         android:orientation="horizontal" >
-
         <EditText
             android:id="@+id/hex_color_input"
             android:layout_width="0px"
-            android:maxLength="6"
+            android:layout_height="match_parent"
+            android:layout_weight="0.5"
             android:digits="0123456789ABCDEFabcdef"
             android:inputType="textNoSuggestions"
-            android:layout_height="match_parent"
-            android:layout_weight="0.5" />
-
+            android:maxLength="6" />
         <org.omnirom.omnigears.ui.ColorPanelView
             android:id="@+id/color_panel"
             android:layout_width="0px"
             android:layout_height="match_parent"
+            android:layout_marginStart="10dp"
             android:layout_weight="0.5" />
     </LinearLayout>
-
     <LinearLayout
         android:id="@+id/color_list_view"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_below="@id/color_panel_view"
-        android:layout_marginStart="10dp"
+        android:layout_marginBottom="5dp"
         android:layout_marginEnd="10dp"
+        android:layout_marginStart="10dp"
         android:layout_marginTop="5dp"
-        android:paddingBottom="5dip"
         android:orientation="horizontal" >
-
-             <Spinner
-                android:id="@+id/color_list_spinner"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_weight="1" />
-
-             <View
-                android:layout_width="8dip"
-                android:layout_height="match_parent" />
-
-             <org.omnirom.omnigears.ui.ColorPanelView
-                android:id="@+id/color_list_panel"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_weight="1" />
+        <Spinner
+            android:id="@+id/color_list_spinner"
+            android:layout_width="0px"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:layout_weight="0.5" />
+        <org.omnirom.omnigears.ui.ColorPanelView
+            android:id="@+id/color_list_panel"
+            android:layout_width="0px"
+            android:layout_height="40dp"
+            android:layout_gravity="center_vertical"
+            android:layout_marginStart="10dp"
+            android:layout_weight="0.5" />
     </LinearLayout>
-
     <LinearLayout
         android:id="@+id/speed_title_view"
-        android:layout_width="match_parent"
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_below="@id/color_list_view"
-        android:layout_marginStart="10dp"
+        android:layout_marginBottom="5dp"
         android:layout_marginEnd="10dp"
-        android:layout_marginTop="4dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginTop="5dp"
         android:orientation="vertical" >
-
         <View
             android:layout_width="match_parent"
             android:layout_height="2dp"
             android:background="@android:drawable/divider_horizontal_dark" />
-
         <TextView
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginTop="4dp"
             android:text="@string/pulse_speed_title"
             android:textAppearance="?android:attr/textAppearanceSmall" />
-
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="horizontal"
-            android:paddingBottom="4dip" >
-
+            android:paddingBottom="5dip" >
             <Spinner
                 android:id="@+id/on_spinner"
-                android:layout_width="match_parent"
+                android:layout_width="0px"
                 android:layout_height="wrap_content"
                 android:layout_weight="1" />
-
-            <View
-                android:layout_width="8dip"
-                android:layout_height="match_parent" />
-
             <Spinner
                 android:id="@+id/off_spinner"
-                android:layout_width="match_parent"
+                android:layout_width="0px"
                 android:layout_height="wrap_content"
+                android:layout_marginStart="10dp"
                 android:layout_weight="1" />
         </LinearLayout>
     </LinearLayout>
-</RelativeLayout>
+</LinearLayout>
diff --git a/res/values/custom_arrays.xml b/res/values/custom_arrays.xml
index b84ade5..e6e40dc 100644
--- a/res/values/custom_arrays.xml
+++ b/res/values/custom_arrays.xml
@@ -65,7 +65,7 @@
         <item>250</item>
         <item>500</item>
         <item>1000</item>
-        <item>2500</item>
+        <item>2000</item>
         <item>5000</item>
     </string-array>